Open Akselmo opened 2 months ago
No, this is definitely a parsing issue that has to be fixed by the grammar upstream. (I also can't find that quote anywhere)
I saw the quote when making a bug report. Anyhow, thanks for clarification, will make a bug upstream :)
Just for reference, this is not just linked to the odin
language. This happens also in php
and other languages, most of the time if the letter M
is involved.
That's unrelated - it's because the k
is lowercase so it's not highlighted as a constant. That's up to php's queries in runtime/queries/php/highlights.scm
Summary
Hi, I wasn't exactly sure where to report this, since https://github.com/tree-sitter-grammars/tree-sitter-odin mentioned following:
The bug
If I create a map with strings as keys, the coloring seems to get confused.
Best shown with a screenshot:
The first line,
MOVE_FRONT
, is correct. Any subsequent lines look wrong.Tree-sitter scopes seem to error out?
Reproduction Steps
I tried this: 1. `hx` 2. Paste following snippet ```odin package test import rl "vendor:raylib" WeirdMap := map[string]bool \ { "MOVE_FRONT" = rl.IsKeyDown(cast(rl.KeyboardKey)settings.Values.keyMoveForward), "MOVE_BACK" = rl.IsKeyDown(cast(rl.KeyboardKey)settings.Values.keyMoveBackward), "MOVE_RIGHT" = rl.IsKeyDown(cast(rl.KeyboardKey)settings.Values.keyMoveRight), "MOVE_LEFT" = rl.IsKeyDown(cast(rl.KeyboardKey)settings.Values.keyMoveLeft), } ``` I expected this to happen: Syntax highlighting for string would be correct, like on the first line. Instead, this happened: Seems helix thinks for some reason that the next line with `MOVE_BACK` with the first `"` is not start of string? ### Helix log~/.cache/helix/helix.log
``` please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines ```