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

added CodeAction for opening XML binding wizard #1088

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

AlexXuChen
Copy link
Contributor

@AlexXuChen AlexXuChen commented Jul 22, 2021

Added CodeAction for opening XML binding wizard to bind document to existing grammar/schema file.
(edit) made binding wizard CodeAction dependent on client support (reference: #1088 (review))

Closes redhat-developer/vscode-xml/issues/515

Signed-off-by: Alexander Chen alchen@redhat.com

@datho7561 datho7561 self-requested a review July 22, 2021 18:11
@datho7561
Copy link
Contributor

Take a look into the test failures; I think they shouldn't be too hard to resolve

@AlexXuChen AlexXuChen force-pushed the issue515 branch 2 times, most recently from e3349c3 to 53b35fa Compare July 23, 2021 15:31
@AlexXuChen AlexXuChen requested a review from datho7561 July 23, 2021 15:55
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes that you have made look good, and it works for me.

I think we may want to add a new "extended client capability" for the binding wizard, and hide the CodeAction when the binding wizard is not supported by the client. That way, clients that have implemented a binding wizard (such as vscode-xml) can send this information to the server, and the CodeAction is listed. However, if the client hasn't implemented a binding wizard yet (i.e. Eclipse, vim, ...), then the CodeAction doesn't appear. This should prevent end users from getting confusing messages when trying to use the CodeAction when it's not supported.

Take a look at ExtendedClientCapabilities.java, and for an example of how to pass the setting to the language server in the client, see xmlClient.ts:122 in vscode-xml.

@AlexXuChen AlexXuChen requested a review from angelozerr July 26, 2021 15:01
@angelozerr angelozerr merged commit afe0257 into eclipse-lemminx:master Jul 26, 2021
@angelozerr
Copy link
Contributor

Good job @AlexXuChen

@AlexXuChen AlexXuChen deleted the issue515 branch July 26, 2021 15:10
@angelozerr angelozerr added this to the 0.17.2 milestone Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Bind to grammar/schema..." should be available as a quick fix
3 participants