Closed GoNZooo closed 9 months ago
I can't reproduce with your snippets - I need a full reproducer else this isn't actionable
You can clone https://github.com/GoNZooo/odin-cli to see it fail in action if you want. Here is d165dbee27617dab2653e38737d96ede1030d14f
and the same areas, by the way, confirming that it was caused by your fix for v1.0.1
:
I think i found the possible cause of this issue. Opening the project OP provided, odin-cli, and then using a tool like Playground will show numerous errors, with the first one appearing at this line: After some debugging it looks like the parser has trouble with comas on the return statement, when they are in new lines:
Here is the snippet which causes this error:
package main
test :: proc() -> (int, int, int) {
return 1,
1, 1,
}
This particular comma placement appears multiple times OPs' project and my guess is it causes more and more parse errors to happen until the issue becomes more visible with the strings.
It should be noted that this formatting is the default formatting of odinfmt
, the formatter that is used in ols
, the defacto standard language server, so it would definitely be useful for this formatting to not break the parser.
Sorry about the delay, this is now fixed and I've added support for the new stuff odin seemingly has added, like or_continue, or_break, and some tidying up
Lately I've noticed that most of my projects are having syntax highlighting issues with strings being highlighted as not closed despite having clear end markers. I didn't notice it being at all this bad until recently, which I think coincides with an upgrade (unexpected downgrade) of the
nvim-treesitter
plugin which bundles this repository as the Odin parser by default.Some examples:
What actually seems to close the example above is yet another missed closing quote:
The above one goes on for several procedures and type definitions until we reach this: