-
Notifications
You must be signed in to change notification settings - Fork 50
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
perf: LSP cancellation support #1093
Conversation
src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServerExcecutionContext.java
Outdated
Show resolved
Hide resolved
a895bf3
to
cbe5dc6
Compare
src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServerExcecutionContext.java
Outdated
Show resolved
Hide resolved
bf8402a
to
57ce183
Compare
The PR is ready and all operations completion, inlayhint, etc managed cancellation support. The cancel support is interesting when language server takes some times to give a response and a new request is called. You should see now in the trace
As our language server are fast, it can be difficult to produce a cancel. To reproduce this cancel, I created an application.properties with 1500 lines and I type fast to open / close the completion and you should see |
Please note that when a cancelRequest occurs it will not cancel the future which is created on IJ side (IndexAwareLanguageClient). We need to do some improvement on our language server |
92082ba
to
80183a2
Compare
src/main/java/com/redhat/devtools/intellij/lsp4ij/internal/CancellationSupport.java
Outdated
Show resolved
Hide resolved
src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServerItem.java
Outdated
Show resolved
Hide resolved
/** | ||
* Itemwhich stores the initialized LSP4j language server and the language server wrapper. | ||
*/ | ||
public class LanguageServerItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll have to turn this into a record, once Java 17 is required
...java/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSPCompletionContributor.java
Outdated
Show resolved
Hide resolved
} | ||
}).filter(Objects::nonNull).collect(Collectors.toList())); | ||
.map(languageServer -> | ||
cancellationSupport.execute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it runs in async, there's a small risk that at this point cancellationSupport could be null-ed by other methods
80183a2
to
05e338f
Compare
I opened https://github.com/ia3andy/quarkus-blast/blob/main/src/main/resources/templates/GameController/partials/grid.html, clicked on an inlay hint and got that exception:
|
Also saw this in my logs:
No idea what caused it. |
05e338f
to
95baa2b
Compare
Fixes redhat-developer#791 Signed-off-by: azerr <[email protected]>
95baa2b
to
8853b08
Compare
Kudos, SonarCloud Quality Gate passed! |
I don't know -( |
Should be fixed |
Thanks @angelozerr |
perf: LSP cancellation support
Fixes #791