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 support for textDocument/linkedEditingRange #991

Merged
merged 1 commit into from
Jun 3, 2021

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Feb 18, 2021

Add support for textDocument/linkedEditingRange

Fixes #987

Signed-off-by: azerr [email protected]

@angelozerr
Copy link
Contributor Author

angelozerr commented Feb 18, 2021

This PR requires LSP4J 0.11.0 which is not released (I'm using SNAPSHOT for the moment).

This PR requires the vscode-xml PR redhat-developer/vscode-xml#426

@angelozerr angelozerr changed the title Add support for linked editing Add support for textDocument/linkedEditingRange Feb 18, 2021
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@jonahgraham
Copy link

Thanks @angelozerr for commenting on eclipse-lsp4j/lsp4j#466.

I have a question for you. How does this language server work with the Eclipse SimRel? Can it have a different version of LSP4J than the version that LSP4E uses and is part of SimRel? Is Lemminx part of SimRel (presumably via WWD if it is)? The answers to these questions will help determined when best to release 0.11.0 of LSP4J.

@jonahgraham
Copy link

PS Has lemminx had a release yet? None are listed on https://projects.eclipse.org/projects/technology.lemminx/governance but I thought that WWD was using it and it is making releases.

@rgrunber
Copy link
Contributor

rgrunber commented Feb 19, 2021

I have a question for you. How does this language server work with the Eclipse SimRel? Can it have a different version of LSP4J than the version that LSP4E uses and is part of SimRel? Is Lemminx part of SimRel (presumably via WWD if it is)? The answers to these questions will help determined when best to release 0.11.0 of LSP4J.

Looking in WWD snapshot builds, they appear to be using lemminx releases from repo.eclipse.org and embedding it. @angelozerr mentioned LemMinX will generally adopt the latest version of lsp4j so I'm guessing that's usually what lsp4e would use. I think as long as new changes can be broadcast to clients (like this one), we likely won't have issues updating.

PS Has lemminx had a release yet? None are listed on https://projects.eclipse.org/projects/technology.lemminx/governance but I thought that WWD was using it and it is making releases.

I believe it's in incubation. The releases can be found at https://download.eclipse.org/lemminx/ .

@jonahgraham
Copy link

I have a question for you. How does this language server work with the Eclipse SimRel? Can it have a different version of LSP4J than the version that LSP4E uses and is part of SimRel? Is Lemminx part of SimRel (presumably via WWD if it is)? The answers to these questions will help determined when best to release 0.11.0 of LSP4J.

Looking in WWD snapshot builds, they appear to be using lemminx releases from repo.eclipse.org and embedding it. @angelozerr mentioned LemMinX will generally adopt the latest version of lsp4j so I'm guessing that's usually what lsp4e would use. I think as long as new changes can be broadcast to clients (like this one), we likely won't have issues updating.

Thanks. It looks like wwd is using a lemminx uber jar, IIUC that means the version of lsp4j in lemminx can be different than that of lsp4e. We have pretty much decided not to release lsp4j 0.11.0 to 2021-03 simrel as we can't do it in time and let all adopters in simrel upgrade to that version. But if we do release 0.11.0 soon, then lemminx can start using it independently.

PS Has lemminx had a release yet? None are listed on https://projects.eclipse.org/projects/technology.lemminx/governance but I thought that WWD was using it and it is making releases.

I believe it's in incubation. The releases can be found at https://download.eclipse.org/lemminx/ .

OK. I think it still needs release records for the releases and a release review once per year. Being in incubation does not matter for that requirement of EDP.

@angelozerr
Copy link
Contributor Author

Thanks. It looks like wwd is using a lemminx uber jar, IIUC that means the version of lsp4j in lemminx can be different than that of lsp4e.

Exactly and my draft PR which consumes 0.11.0 works with the current LSP4E which doesn't consume 0.11.0.

We have pretty much decided not to release lsp4j 0.11.0 to 2021-03 simrel as we can't do it in time and let all adopters in simrel upgrade to that version. But if we do release 0.11.0 soon, then lemminx can start using it independently.

If I understand correctly you mean that you could do a release next week for instance? If it that it should be really fantastic because we have the intention to do a release of vscode-xml soon and we could provide this linked editing support inside vscode-xml.

@jonahgraham
Copy link

We have pretty much decided not to release lsp4j 0.11.0 to 2021-03 simrel as we can't do it in time and let all adopters in simrel upgrade to that version. But if we do release 0.11.0 soon, then lemminx can start using it independently.

If I understand correctly you mean that you could do a release next week for instance? If it that it should be really fantastic because we have the intention to do a release of vscode-xml soon and we could provide this linked editing support inside vscode-xml.

I am still waiting (gently pushing) to get LSP 3.16.0 support finished in LSP4J 0.11.0. I only meant that we can release 0.11.0 independently of the release train and that you could start using it, also independent of the release train. Sorry for not giving you more/better visibility on what it will take for 0.11.0 to release. https://github.com/eclipse/lsp4j/milestone/18 has the progress on getting all the issues resolved.

@rgrunber
Copy link
Contributor

FWIW, we'll likely end up sticking with lsp4j 0.9.0 for our upcoming release, and update to latest afterwards, so this isn't blocking us.

@jonahgraham
Copy link

FWIW, we'll likely end up sticking with lsp4j 0.9.0 for our upcoming release, and update to latest afterwards, so this isn't blocking us.

Thanks for letting me know - the LSP4J release is imminent now - eclipse-lsp4j/lsp4j#466 (comment)

@jonahgraham
Copy link

The LSP4J release is now done: eclipse-lsp4j/lsp4j#466 (comment)

@angelozerr
Copy link
Contributor Author

The LSP4J release is now done: eclipse-lsp4j/lsp4j#466 (comment)

Thanks @jonahgraham for your feedback. I have updated my PR to consume now the 0.11.0 release of LSP4J.

@datho7561
Copy link
Contributor

When using lsp4j 0.12.0, this PR breaks the server. The server will issue diagnostics when it first starts, but when the other capabilities are dynamically registered, the server becomes unresponsive.

If I change the lsp4j version to 0.11.0, the server and the linked editing works great.

@angelozerr angelozerr force-pushed the linked-editing branch 3 times, most recently from a66ae60 to 5048754 Compare April 16, 2021 14:01
@fbricon
Copy link
Contributor

fbricon commented Apr 16, 2021

Binary builds fail with

Error: Error parsing reflection configuration in jar:file:/home/runner/work/lemminx/lemminx/org.eclipse.lemminx/target/org.eclipse.lemminx-0.16.1-SNAPSHOT.jar!/META-INF/native-image/reflect-config.json:
Could not resolve org.eclipse.lsp4j.SemanticHighlightingCapabilities for reflection configuration. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationResources.
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception

@datho7561
Copy link
Contributor

datho7561 commented Apr 16, 2021

Binary still doesn't work from my testing
EDIT: binary from master doesn't work with vscode-xml, probably something from vscode-languageclient 7.0.0

@datho7561 datho7561 self-requested a review May 26, 2021 13:35
@datho7561
Copy link
Contributor

I found that this case is broken:

mirror-cursor-glitch

@angelozerr angelozerr force-pushed the linked-editing branch 5 times, most recently from 42a7aac to bc24f20 Compare May 31, 2021 09:08
pom.xml Outdated Show resolved Hide resolved
@angelozerr angelozerr force-pushed the linked-editing branch 3 times, most recently from 83b44b5 to e75374e Compare June 1, 2021 09:36
@angelozerr
Copy link
Contributor Author

I found that this case is broken:

fixed.

@angelozerr angelozerr marked this pull request as ready for review June 1, 2021 09:47
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.

A few more reflection configuration changes that need to be made:

Modify:

        {
                "name": "org.eclipse.lsp4j.InsertTextMode",
-               "fields": [{
-                       "name": "value"
-               }]
+               "allDeclaredFields": true
        },

Then, add:

{
         "name": "org.eclipse.lsp4j.SetTraceParams",
         "allDeclaredFields": true,
         "methods": [{
                  "name": "<init>",
                "parameterTypes": []
        }]
},

@angelozerr
Copy link
Contributor Author

All should be fixed, thanks for your feedback.

@datho7561
Copy link
Contributor

One more reflection entry to add (sorry, I think this is the last):

{
        "name": "org.eclipse.lsp4j.adapters.CompletionItemTextEditTypeAdapter",
        "methods": [{
        "name": "<init>",
                 "parameterTypes": []
        }]
},

@datho7561 datho7561 merged commit 4d1b436 into eclipse-lemminx:master Jun 3, 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.

Add support for linked editing
5 participants