nushell / tree-sitter-nu

A tree-sitter grammar for nu-lang, the language of nushell
MIT License
97 stars 24 forks source link

Syntax Highlighting #1

Closed jgollenz closed 2 weeks ago

jgollenz commented 1 year ago

Do you have any plans for syntax highlighting in this repo? It appears common that treesitter repos (I sampled cpp, js and python) do have highlights.scm files. My general experience so far was that syntax highlighting starts working once I install the parser with TSInstall.

I started looking into it and if you don't mind, I'd like to give it a try :)

fdncred commented 1 year ago

I was planning on it but wanted to finish the syntax first. I'm fine with any positive contribution at any time.

jgollenz commented 1 year ago

I see. I'm new to tree-sitter in general, so it doesn't really matter what I work on, it will be trial-and-error either way.

May I ask what your workflow is? So far I managed to get the parser working by itself and add it to neovim where I can inspect it in ts-playground (although it is not updating when the buffer changes). However, the syntax highlighting module is not enabled and I don't know how I can do so. Running tree-sitter highlight some-file.nu works fine, but no highlighting inside neovim.

fdncred commented 1 year ago

My workflow is maybe less than that. I just do what I put in the read me. For inspiration, you can see how the helix editor shows the syntax highlighting. Someone contributed the scm files a few months ago.

jgollenz commented 1 year ago

see how the helix editor shows the syntax highlighting

could you please drop me a link to it? :)

fdncred commented 1 year ago

no problem https://github.com/helix-editor/helix/tree/master/runtime/queries/nu

Feel-ix-343 commented 8 months ago

Can this be closed? TSInstall nu enables highlighting

fdncred commented 8 months ago

The syntax highlighting is minimal and can be made better via queries.

mrdgo commented 2 weeks ago

I believe that this issue can be closed. There are only specific issues that need to be specifically addressed.