LhKipp / tree-sitter-nu

A tree-sitter grammar for the nushell language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

highlight issue: '#' in a string causes rest of line to be treated as comment

colemickens opened this issue · comments

screenshot-1694084397

I believe those strings should be fully rendered as strings, rather than partially be rendered as if they were a comment, owing to the # usage.

If I change a single line to double quotes, things get even stranger:

screenshot-1694084477

In fact, maybe this is linked to what I'm seeing in #9 ... I likely have this construct elsewhere in this file that might be confusing the parser? tree-sitter? etc.

Hi colemickens,

thanks for opening this issue. I can't create a minimal reproducible example while using the latest version of nvim-nu. Can you please either provide a minimal example or the whole script as text?

image

I will definitely work on cutting this down, but my first crude attempt is showing all sorts of other interesting behavior as I remove various functions in pursuit of a minimal case.

FWIW, what I'm working with is helix-tip and this file: https://github.com/colemickens/nixcfg/blob/4f3fbe340dd25aafd45cc54007224914d84369d1/main.nu

If you grep for def "main up" you'll find the portion I used to file this bug, and if you start removing functions above it, you'll see some interesting behavior (note how def is highlighted as you go, etc).

I will keep this tab open with the hopes of cutting it down, but maybe you'll look and see something obvious too?

Closing this. Helix uses nushell/tree-sitter-nu, not this repo. My mistake.