helix
helix copied to clipboard
Grammars: Missing support for proto2
I'm planning to work on this, so feel free to assign (I don't have permissions).
Current situation:
- Grammar used by Helix is https://github.com/yusdacra/tree-sitter-protobuf at
19c211a01434d9f03efff99f85e19f967591b175 - Grammar used by nvim is https://github.com/treywood/tree-sitter-proto (at
main?)
Problems of current situation:
- no proto2 support (also no support Editions but this is not supported anywhere so out of scope for now)
- different grammar than nvim leads to fragmentation
- neither of the grammars' feature sets is a superset of the other one --> upstream work needed
- inconsistent language identifier (
protovsprotobuf)
Plan of action
- [ ] agree with @yusdacra and @treywood on a unification plan. Probably consolidating on treywood/tree-sitter-proto is easier because its network graph is larger (e.g it's used by nvim-treesitter).
- [X] reach out to @yusdacra to get agreement for that
- [ ] reach out to @treywood about adding missing features to https://github.com/treywood/tree-sitter-proto
- [ ] implement missing features in https://github.com/treywood/tree-sitter-proto
- [ ] get missing features into https://github.com/treywood/tree-sitter-proto master branch
- [ ] switch Helix over to the new grammars (and
protoidentifier) - [ ] fix reverse-query-precedence-ordering branch if needed
Analysis of missing features
Features missing for highlights.scm:
- missing
mapName,extendName,fieldNameandenumVariantName - missing
optionName- this is fixed in thefixupsbranch but needs merging into main
Features missing for indents.scm:
oneofBody,serviceBodyandrpcBodyare missing. You can useoneof,serviceandrpcinstead, but this probably leads to some regressions. Not sure if there is a severe enough case to block on this. I noticed a difference with declarations like this inhybridindent heuristic, but they actually both misbehave.rpc FooRpc(FooRpcRequest) returns (FooRpcResponse) { option deadline = 20.0; }
Features missing for textobjects.scm:
- missing
serviceBody