Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning when XML is not bound to a grammar #218

Closed
angelozerr opened this issue Nov 13, 2018 · 8 comments
Closed

Add warning when XML is not bound to a grammar #218

angelozerr opened this issue Nov 13, 2018 · 8 comments
Assignees
Labels
Milestone

Comments

@angelozerr
Copy link
Contributor

When we try to bound a grammar to a XML file and this binding is not well confured (ex: XML file associations is not well configured, XML catalog not well configured) it's hard to see that.

A proposition si to mark XML root element as warning ("no grammar constraints") like WTP does:

image

This warning should be a preference. @fbricon @NikolasKomonen what do you think about this idea?

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

preference value should be an enum: {ignore, hint, info, warning, error}

I'd use hint by default, as I find it less intrusive. It doesn't generate a marker in the problems view in vscode, only in the open file.

@fbricon fbricon added the enhancement New feature or request label Nov 13, 2018
@angelozerr
Copy link
Contributor Author

Perfect!

@angelozerr angelozerr self-assigned this Nov 13, 2018
@angelozerr angelozerr added this to the v0.0.3 milestone Nov 13, 2018
angelozerr added a commit that referenced this issue Nov 13, 2018
@angelozerr
Copy link
Contributor Author

@fbricon @NikolasKomonen I have implemented this feature. I must write test yet.

I have choosen warnNoGrammar as preference name https:/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/settings/ContentModelSettings.java#L26 but if you don't like it, please tell me, I will change it.

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

can we call it "problems.noGrammar"? It'll allow us to handle similar messages in the future. And there's no severity implied in the name.

@angelozerr
Copy link
Contributor Author

can we call it "problems.noGrammar"?

You mean having ContentModelSettings#getProblems()#setNoGrammar(String noGrammar) ?

@fbricon
Copy link
Contributor

fbricon commented Nov 13, 2018

yes

angelozerr added a commit that referenced this issue Nov 13, 2018
@angelozerr
Copy link
Contributor Author

Done @fbricon

@fbricon fbricon closed this as completed Nov 15, 2018
@angelozerr angelozerr reopened this Nov 15, 2018
@angelozerr
Copy link
Contributor Author

@fbricon I reopen this issue because I must write tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants