typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

Semantic Token Scopes not provided #601

Open evoactivity opened 1 year ago

evoactivity commented 1 year ago

Semantic tokens add additional syntax highlighting for things like decorators etc.

Also tracking in https://github.com/chiragpat/vscode-glimmer/issues/14

When this is used with vscode-glimmer, I don't think the language server provides the semanticTokenScopes required to apply the correct colours ontop of the syntax highlighting.

Typescript Language Server provides semantic tokens here https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/languageFeatures/semanticTokens.ts

Incorrect Correct
image image
image image
evoactivity commented 1 year ago

Actually not sure if this would be a glint concern or an ember language server concern.

I'm tracking an issue related to code folding on ELS here https://github.com/lifeart/vscode-ember/issues/43 and if the fix for code folding is for ELS to provide JS/TS folding, the fix for semantic tokens might also be to add it to ELS.

Since the typescript language server is not running for a glimmer-ts or glimmer-js files one of the projects will need to fill in the missing features but I'm not sure which project is the right one.

NullVoxPopuli commented 11 months ago

I think adding semantic folding here makes sense as well, at the very least for the js/ts stuff.

To do the in-<template>-tag folding, we'd need to also produce an AST for for the things within the template, which I know @patricklx has been playing with in other tools (eslint)