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 codelens and command to register/unregister catalog #1390

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

JessicaJHee
Copy link
Contributor

Peek 2022-12-06 12-41

Fixes redhat-developer/vscode-xml#572

Signed-off-by: Jessica He jhe@redhat.com

@angelozerr
Copy link
Contributor

It looks promising @JessicaJHee !

I noticed that you created an custom command on client side for only XML catalog.

My idea was to do like we did for vscode-microprofile, to provide a generic command which updates a given configuration on client side.

The main idea is to provide a generic command which update settings on client side. If you think it is doable, it should be nice otherwise let's give up my idea, but I think if we have more and more codeaction, codelens which need to update settings we should change that.

@JessicaJHee JessicaJHee force-pushed the 572-catalog-codelens branch 2 times, most recently from fc15339 to 3903219 Compare December 8, 2022 20:01
@angelozerr
Copy link
Contributor

@JessicaJHee please fix conflicts

@angelozerr
Copy link
Contributor

It should be really nice to refresh coelens when xml.catalogs changed (on server side).

To do that I suggets to add this following code after https://github.com/eclipse/lemminx/blob/de9c702be26f5380be84b3a38d6d16f6913011df/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/XMLTextDocumentService.java#L590

if (context.isRefreshCodeLenses()) {
	xmlLanguageServer.getLanguageClient().refreshCodeLenses();
}

isRefreshCodeLenses() is a new method which returns a boolean to know if codelens must be refreshed or not when a settings a changed.

After https://github.com/eclipse/lemminx/blob/74689af7f882732c9e59f27ce23ea0652fe2dbc5/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/ContentModelPlugin.java#L139

you update the refresh code lens flag

context.setRefreshCodeLenses(true)

@JessicaJHee JessicaJHee force-pushed the 572-catalog-codelens branch 2 times, most recently from d05a520 to a191899 Compare December 9, 2022 15:49
Signed-off-by: Jessica He <jhe@redhat.com>
@angelozerr angelozerr merged commit 03a811e into eclipse-lemminx:main Dec 11, 2022
@angelozerr
Copy link
Contributor

It works like a charm. Thanks @JessicaJHee !

@JessicaJHee JessicaJHee deleted the 572-catalog-codelens branch December 12, 2022 19:19
@JessicaJHee JessicaJHee modified the milestone: 0.23.0 Dec 12, 2022
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.

CodeLens for registering/unregistering catalog
3 participants