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

Include syntax highlighting in vscode extension #1363

Closed
simonzkl opened this issue Jun 15, 2023 · 5 comments
Closed

Include syntax highlighting in vscode extension #1363

simonzkl opened this issue Jun 15, 2023 · 5 comments

Comments

@simonzkl
Copy link

simonzkl commented Jun 15, 2023

Is your feature request related to a problem? Please describe.
The vscode extension right now only does LSP and relies on a third party vscode extension for syntax highlighting. The third party extension is out of date as well and doesn't support keywords introduced in 1.0.

Describe the solution you'd like
The syntax highlighting should be implemented in the official vscode extension.

Describe alternatives you've considered
I don't feel like having these separate makes sense from a user's perspective. Especially as the official lsp extension relies on the nickel language being registered. So the unofficial syntax highlighting extension is actually a hard requirement.

@yannham
Copy link
Member

yannham commented Jun 15, 2023

I'm not a VSCode user, so I don't know much about extension development, but that would be great if we could just piggy-back on tree-sitter, as we maintain a fairly up-to-date grammar already. It's hard to keep the number down (Vim, the Nickel parser, Prism.js for highlighting on the website, etc.), but the less grammars we have to maintain, the better 🙂

@szlend
Copy link
Contributor

szlend commented Jun 17, 2023

There's no vscode tree-sitter support yet, but they're discussing it. Until then I quickly hacked together a more complete and up to date vscode package:

https://marketplace.visualstudio.com/items?itemName=szlend.unofficial-vscode-nickel

@yannham
Copy link
Member

yannham commented Jun 19, 2023

Thanks @szlend, we're going to take a look, maybe re-use what you did as a base. I dream that one day we will only write one grammar specification, and derive a parser, various highlighters and plugins for editors, whatever is needed for a formatter, etc. but that day hasn't come yet 😞

@szlend
Copy link
Contributor

szlend commented Jun 26, 2023

Done in PR #1405

@yannham
Copy link
Member

yannham commented Jun 30, 2023

Syntax highlighting has been added and the extension is now available on the VSCode Market Place: https://marketplace.visualstudio.com/items?itemName=Tweag.vscode-nickel

@yannham yannham closed this as completed Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants