Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

There is no language field exist in tokens/scopes when inspect in vscode #312

Closed
gRox167 opened this issue Sep 26, 2023 · 2 comments
Closed
Labels
enhancement New feature or request language server Related to the language server needs investigation Some investigation work is needed to understand the issue before it can be resolved

Comments

@gRox167
Copy link

gRox167 commented Sep 26, 2023

  • Component:
    • VSCode Extension
  • Extension version: v0.10.1
  • OS version and name: macOS13.5.1 (22G90) and Windows 11
  • I am on the latest stable version of the extension/LSP.
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I start using typst-lsp from v0.3.2, and I update to the latest version recently. I find out that hypersnips extension doesn't work with typst-lsp normally, and this issue in hypersnips as a reference https://github.com/draivin/hsnips/issues/176.
In previous version of typst-lsp, this language blank field is filled with typst as the name of the language.
image

@nvarner
Copy link
Owner

nvarner commented Oct 11, 2023

I've spent an hour or so investigating this, and I'm not sure how to set that language option. Unlike most languages, typst-lsp uses semantic tokens for syntax highlighting instead of a TextMate grammar, which comes with a lot of advantages. However, it's a slight abuse of the feature, and it isn't integrated as well into VS Code, so it may not be possible to set this without some trick.

Notably, rust-analyzer also uses semantic tokens, but does have this language set. I wasn't able to figure out how they do it, but if you (or someone else) has the interest to investigate, it should be possible to reverse engineer and figure out how it's done.

@nvarner nvarner added enhancement New feature or request language server Related to the language server needs investigation Some investigation work is needed to understand the issue before it can be resolved labels Oct 11, 2023
@gRox167 gRox167 closed this as completed Nov 10, 2023
@gRox167
Copy link
Author

gRox167 commented Nov 10, 2023

Seems that in the v0.11.0, this problem is solved. Thanks for all of the work you have done @nvarner, this is really a perfect lsp for typst!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request language server Related to the language server needs investigation Some investigation work is needed to understand the issue before it can be resolved
Projects
None yet
Development

No branches or pull requests

2 participants