microsoft / vscode-anycode

MIT License
326 stars 38 forks source link

Troubleshooting Highlighting on New Language Extension #100

Closed aheber closed 1 month ago

aheber commented 1 month ago

I'm working on building an extension to support Salesforce's Apex language in anycode. I already have a tree-sitter grammar definition @ https://github.com/aheber/tree-sitter-sfapex

I have the new extension generally built and functional for some features such as finding references. This is wonderfully exciting to see something working.

image

I think I have rough versions of the various query files created and functional and they are working in some cases. I'm not able to figure out how to get the highlighting working inside of VS Code. I have the fixtures/highlights.cls file created and passing tests. I don't know why the highlighting isn't applied inside of the VS Code editor experience. (desktop/node)

If I use Developer: Inspect Editor Tokens and Scopes in VS Code it tells me "No grammar or semantic tokens available." where I would expect anycode to be providing something, if I'm understanding it's capabilities correctly.

If there is something simple please point me in the right direction. If you need to see the code/project to troubleshoot I'm happy to make it available.

jrieken commented 1 month ago

I'm not able to figure out how to get the highlighting working inside of VS Code. I have the fixtures/highlights.cls file created and passing tests. I don't know why the highlighting isn't applied inside of the VS Code editor experience. (desktop/node)

This currently isn't possible - neither with anycode nor with vscode. However, there is an effort to support treesitter based highlights directly within vscode. However, the latter is currently being worked on and we might be able to open this up for extensions in the near future

aheber commented 1 month ago

Thank you for the response. Is there a specific issue on the VSCode side that tracks this effort?