tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
152 stars 36 forks source link

layout elements with implicit semicolon break queries #32

Closed tek closed 3 years ago

tek commented 3 years ago

When a semicolon is deduced from indent in the scanner, the next node is skipped when I use tree-sitter for neovim highlighting.

Example:

import Foo.Bar
import Foo.Bar

In this case, only the first line is highlighted, and the second line doesn't even appear in the tree displayed by :TSPlaygroundToggle. However, with tree-sitter parse, it is correctly included in the tree.

On the other hand, with an explicit semicolon:

import Foo.Bar;
import Foo.Bar

the second line is highlighted as well.

The scanner consumes the newline as part of the implicit semicolon. Maybe that's the problem?

@maxbrunsfeld @patrickt any advice?

tek commented 3 years ago

even though I have the get_column fix in my system treesitter, is it possible that neovim doesn't have it yet and therefore exhibits this behaviour when parsing? matter of fact, there are still those col value outside range errors in nvim

tek commented 3 years ago

ping @maxbrunsfeld

tek commented 3 years ago

ping again @maxbrunsfeld

maxbrunsfeld commented 3 years ago

I don't have very much context on the Neovim side of things, so I think you'll need to figure out:

If the Tree-sitter version is current, and the bug is on the Tree-sitter side, we may need a minimal way to reproduce the bug outside of the context of Neovim.

tek commented 3 years ago

this is not present anymore in current nvim.