WeetHet / typst.zed

Typst extension for zed
Apache License 2.0
0 stars 1 forks source link

Better highlighting #1

Open jens-hj opened 1 month ago

jens-hj commented 1 month ago

Hi, I am used to typst syntax highlighting in vscode with the typst extension, which leaves me with a lot of highlighting making it easy to visually find things:

VSCode: image

Zed Editor: image

Notice how I am using the same theme; Nanowise, and in VSCode I have a separate colour for headings, inline code, and when switching to code mode in content e.g. with #acr("RNG"). Is this something that is easily achievable or is something inhibiting this goal?

WeetHet commented 1 month ago

I'm actually not sure. The thing is, zed uses treesitter for parsing and highlighting. As far as I know, vscode has its own API. You could try asking the VSCode extension developer if they use treesitter and if they do, ask for the grammar. You could then provide it to me, and I would update the extension to use it. I could also try looking into the grammar-defined highlights to see if I can adjust them a bit to provide better highlighting, but as I'm pretty busy now, I don't know when I would be able to do that

Myriad-Dreamin commented 1 month ago

vscode uses textmate grammar for instant syntax highlighting. It then uses lsp's semantic tokens api for slower semantic highlighting, with a slightly higher priority than semantic highlighting.

WeetHet commented 1 month ago

vscode uses textmate grammar for instant syntax highlighting. It then uses lsp's semantic tokens api for slower semantic highlighting, with a slightly higher priority than semantic highlighting.

Oh, okay, then I don't know if I can do anything about subpar highlighting in zed. It might be better to go to the grammar author and ask for more highlights there? I honestly don't know :(