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 semantic token MultilineTokenSupport #401

Closed
CppCXY opened this issue Jul 2, 2024 · 9 comments · Fixed by #406
Closed

Support semantic token MultilineTokenSupport #401

CppCXY opened this issue Jul 2, 2024 · 9 comments · Fixed by #406
Assignees
Labels
bug Something isn't working semantic tokens
Milestone

Comments

@CppCXY
Copy link
Contributor

CppCXY commented Jul 2, 2024

If multiline tokens are not supported and a tokens length takes it past the end of the line, it should be treated as if the token ends at the end of the line and will not wrap onto the next line.

If the length of a token exceeds the end of this line, it should not continue to the next line.

@angelozerr
Copy link
Contributor

Have you a usecase?

@angelozerr angelozerr added bug Something isn't working semantic tokens labels Jul 2, 2024
@CppCXY
Copy link
Contributor Author

CppCXY commented Jul 2, 2024

test script here:
test2.zip

If the language server detects that the client does not support multiline tokens, it will return multiple single-line tokens, each with a length of 9999. According to LSP, overly long tokens should not continue to the next line. However, LSP4IJ continues them to the following lines, causing the string color to change.

the response:
image

@angelozerr
Copy link
Contributor

Could you share please your LSP traces, because I would like to start writting tests for sem1ntic tokens by using real LSP traces. I need your full trace with initialize which return legend and semanticTokens/full

@CppCXY
Copy link
Contributor Author

CppCXY commented Jul 2, 2024

LSPIJ.zip

@angelozerr
Copy link
Contributor

angelozerr commented Jul 4, 2024

@CppCXY do you have some coloration, or does semantic fail with a stack trace error?

@CppCXY
Copy link
Contributor Author

CppCXY commented Jul 4, 2024

@CppCXY do you have some coloration, or does semantic fail with a stack trace error?

no stack trace,

@angelozerr
Copy link
Contributor

Are you sure that your semanticFull trace is for the content of your file that you have attached?

Could you add a screenshot with the result of the problem please.

@CppCXY
Copy link
Contributor Author

CppCXY commented Jul 4, 2024

"hello" was rendered in gray:
image

@CppCXY
Copy link
Contributor Author

CppCXY commented Jul 4, 2024

This is because Luals splits tokens that span multiple lines into several single-line tokens and sets the token length to 9999, which is in accordance with the language server specifications.

@angelozerr angelozerr changed the title semantic token implement issue Support semantic token MultilineTokenSupport Jul 4, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jul 4, 2024
@angelozerr angelozerr added this to the 0.3.0 milestone Jul 4, 2024
@angelozerr angelozerr self-assigned this Jul 4, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Jul 4, 2024
@fbricon fbricon closed this as completed in 58147b4 Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semantic tokens
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants