Skip to content

Support for textDocument/semanticTokens #238

Closed

Description

@angelozerr

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.

Activity

  1. added
    enhancement
    on Apr 21, 2024
  2. angelozerr commented on Jun 20, 2024

    @angelozerr
    ContributorAuthor

    @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.

  3. angelozerr commented on Jun 22, 2024

    @angelozerr
    ContributorAuthor

    @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.

  4. added 12 commits that reference this issue on Jun 22, 2024
    08c851a
    5f9a5dd
    182f046
    8d5c2b0
    ac55b54
    5000385
    45ae6be
    5ef8ce6
    0cfbee1
    aaede63
    6486f49
    6511cf4
  5. 7 remaining items

  6. added 5 commits that reference this issue on Jun 30, 2024
    6dbf7b3
    87415c2
    1438257
    06f9fd2
    40a8022
  7. added this to the 0.3.0 milestone on Jul 1, 2024
  8. self-assigned this
    on Jul 1, 2024
  9. added a commit that references this issue on Jul 1, 2024
    97980bd
  10. moved this to ✅ Done in IDE Cloudaptorson Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementsemantic tokens

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions