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

Tree Sitter doesn't apply some scopes #240884

Closed
usernamehw opened this issue Feb 15, 2025 · 1 comment · Fixed by #240983
Closed

Tree Sitter doesn't apply some scopes #240884

usernamehw opened this issue Feb 15, 2025 · 1 comment · Fixed by #240983
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tree-sitter
Milestone

Comments

@usernamehw
Copy link
Contributor

usernamehw commented Feb 15, 2025

"editor.experimental.preferTreeSitter": [
	"typescript",
],

Example using this theme: https://marketplace.visualstudio.com/items?itemName=usernamehw.prism

https://github.com/usernamehw/vscode-theme-prism/blob/master/themes/Prism-color-theme.json

Command to inspect tokens show that correct scope was chosen, but the color/bold is not applied: editor.action.inspectTMScopes Developer: Inspect Editor Tokens and Scopes

{
    "scope": [
        "constant.numeric",
        "constant.character",
        "constant",
        "constant.language.boolean",// <===
        "constant.language.nan",
        "constant.language.infinity",
        "constant.language.undefined",
        "constant.language.null",
        "source.editorconfig constant.language"
    ],
    "settings": {
        "foreground": "#990055",
        "fontStyle": "bold"
    }
},

Image


{
	"scope": "punctuation",
	"settings": {
		"foreground": "#999999"
	}
},

Image

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tree-sitter labels Feb 17, 2025
@alexr00 alexr00 added this to the February 2025 milestone Feb 17, 2025
@alexr00
Copy link
Member

alexr00 commented Feb 17, 2025

This kind of issue is very helpful to understand what textmate scopes we need to translate into tree sitter, thank you!

alexr00 added a commit that referenced this issue Feb 17, 2025
…240983)

* Add boolean and punctuation scopes for typescript with tree sitter
Fixes #240884

* Fix tokenization tests
@vs-code-engineering vs-code-engineering bot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tree-sitter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants