-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added request for 'canBindGrammar' for vscode-xml command #1084
Conversation
To be consistent with binding grammar command please use custom command instead of adding new method to the xml language server and services |
Atm this is a custom command on the client side, where it uses the |
This isn't a command itself though, it is the check to see if the command defined on the vscode-xml side should be exposed or not. For example, if we have an xml document: <tag
attr1=""
attr2=""/> then the command I made in vscode-xml should be exposed on the command palette (XML: Bind to grammar/schema) If instead we have: <tag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="foo.xsd"
attr1=""
attr2=""/> Then you shouldn't be able to find the command on the command palette. The command itself is defined and registered in vscode-xml, the check is the communication between the client and server to see if the command should run at all. So the command to associate grammar, https://github.com/eclipse/lemminx/blob/master/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands/AssociateGrammarCommand.java, is the command that will be run if the client exposes the "Bind to grammar/schema file", which I believe means I don't need a new command on the lemminx side. Please correct me if I've misunderstood. |
Has grammar? -> yes -> Dont expose "Bind to ..." |
Just to confirm, I understand your ask, which is to keep this out of |
Yes i understand that. In the vscode xml you create a new request type but please dont do that since now we have the capability to consume command line we did with xml.associate.grammar.insert. please consume the new xml.associat.grammar.canBinding command on vscode-xml side registered on lemminx side |
Yes i confirm that. To understand more command |
...main/java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommand.java
Outdated
Show resolved
Hide resolved
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/ContentModelPlugin.java
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/XMLLanguageService.java
Outdated
Show resolved
Hide resolved
Please write test for
|
Writing tests in progress |
...se.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/ContentModelPlugin.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommand.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommand.java
Outdated
Show resolved
Hide resolved
...t/java/org/eclipse/lemminx/extensions/contentmodel/commands/AssociateGrammarCommandTest.java
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommandTest.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommandTest.java
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommandTest.java
Outdated
Show resolved
Hide resolved
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/XMLLanguageService.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommand.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/lemminx/extensions/contentmodel/commands/CheckBoundGrammarCommand.java
Outdated
Show resolved
Hide resolved
Great job @AlexXuChen ! |
Added request for 'canBindGrammar' for vscode-xml 'Open Binding Wizard' command.
References: redhat-developer/vscode-xml/pull/544
Signed-off-by: Alexander Chen alchen@redhat.com