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

Support for textDocument/semanticTokens #238

Closed
angelozerr opened this issue Apr 21, 2024 · 3 comments · Fixed by #392
Closed

Support for textDocument/semanticTokens #238

angelozerr opened this issue Apr 21, 2024 · 3 comments · Fixed by #392
Assignees
Labels
enhancement New feature or request semantic tokens
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Apr 21, 2024

See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens

To implement this LSP textDocument/semanticTokens support, I think we should:

The implementation should use a new class LSPSemanticTokensSupport like we did for any LSP features, see for instance

LSPFoldingRangeSupport foldingRangeSupport = LSPFileSupport.getSupport(file).getFoldingRangeSupport();

Those class LSP*Support are registered in an LSPFileSUpport which is registered with a key in a PsiFile. It give the capability for instance to cancel the LSP request when file is closed. LSP4IJ support too LSP cancel request to cancel the LSP request when file changed or Intellij throws a ProcessCanceledException to avoid using TimeOut.

@angelozerr
Copy link
Contributor Author

@FalsePattern , as you have already implemented textDocument/semanticTokens in your project, are you interested to work on this issue?

I have tried to explain how to implement this LSP support inside LSP4IJ, I know you did the solution 3, but I think it should be cleaner to use an IJ extension point (see solution 1 (the best I think) or solution 2).

Please note that LSP4IJ support cancelRequest which I think is very important for this LSP support. I think too we should use some LSP4E classes https://github.com/eclipse/lsp4e/tree/main/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/semanticTokens like https://github.com/eclipse/lsp4e/blob/main/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/semanticTokens/SemanticTokensDataStreamProcessor.java because I know that several Eclipse contributor have worked hard to omplement this feature and fixes several bugs.

LSP4IJ contains too a lof tests and I have tried to write test for important features like completion, hover (see https://github.com/redhat-developer/lsp4ij/tree/main/src/test/java/com/redhat/devtools/lsp4ij/features)

We should have too tests for textDocument/semanticTokens.

@angelozerr
Copy link
Contributor Author

@FalsePattern it seems it is a blocker issue to adopt LSP4IJ, I will try to investigate how to implement this feature in my spare time since it is not for us (Red Hat) our priority, but if you want to try to implement it, please tell me.

angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 22, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 23, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 24, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 24, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 24, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 24, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 25, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 27, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 27, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 27, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jun 30, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jul 1, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jul 1, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jul 1, 2024
@angelozerr angelozerr added this to the 0.3.0 milestone Jul 1, 2024
@angelozerr angelozerr self-assigned this Jul 1, 2024
@angelozerr
Copy link
Contributor Author

angelozerr commented Jul 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semantic tokens
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant