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 multiline and overlapping semantic tokens #545

Open
michaelpj opened this issue Jan 18, 2024 · 3 comments
Open

Support multiline and overlapping semantic tokens #545

michaelpj opened this issue Jan 18, 2024 · 3 comments

Comments

@michaelpj
Copy link
Collaborator

There are client capabilities for if the client supports these. But if they don't, we can still support them gracefully I think. The conversion functions can take the client capabilities and then implement a workaround if the capabilities aren't supported:

  • For overlapping tokens, split the overlapped token so into the part before the overlapping token and the part after the overlapping token, so you get something like: [<string>"hello ${a} world"][<variable>a] -> [<string>"hello ${][<variable>a][<string>} world"]
  • For multiline tokens, split them at the line breaks into one token per line.
@michaelpj michaelpj changed the title Support multiline and overlapping tokens Support multiline and overlapping semantic tokens Jan 18, 2024
@soulomoon
Copy link
Collaborator

There are client capabilities for if the client supports these. But if they don't, we can still support them gracefully I think. The conversion functions can take the client capabilities and then implement a workaround if the capabilities aren't supported:

  • For overlapping tokens, split the overlapped token so into the part before the overlapping token and the part after the overlapping token, so you get something like: [<string>"hello ${a} world"][<variable>a] -> [<string>"hello ${][<variable>a][<string>} world"]

  • For multiline tokens, split them at the line breaks into one token per line.

This idea look pretty nice.

@soulomoon
Copy link
Collaborator

soulomoon commented Jan 26, 2024

I wonder how overlappingToken look like in SemanticTokenRelative.
we might have nagative delta, but UInt is unsigned. 🤔

@michaelpj
Copy link
Collaborator Author

It's also quite possible that it doesn't actually work out. It's not implemented in vscode, so it could just not make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants