Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grammars: Missing support for proto2 #11794

Open
3 of 7 tasks
sdoerner opened this issue Sep 29, 2024 · 4 comments · May be fixed by #12225
Open
3 of 7 tasks

Grammars: Missing support for proto2 #11794

sdoerner opened this issue Sep 29, 2024 · 4 comments · May be fixed by #12225
Labels
A-language-support Area: Support for programming/text languages C-enhancement Category: Improvements

Comments

@sdoerner
Copy link
Contributor

sdoerner commented Sep 29, 2024

I'm planning to work on this, so feel free to assign (I don't have permissions).

Current situation:

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 (proto vs protobuf)

Plan of action

Analysis of missing features

Features missing for highlights.scm:

  • missing mapName, extendName, fieldName and enumVariantName
  • missing optionName - this is fixed in the fixups branch but needs merging into main

Features missing for indents.scm:

  • oneofBody, serviceBody and rpcBody are missing. You can use oneof, service and rpc instead, 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 in hybrid indent heuristic, but they actually both misbehave.
    rpc FooRpc(FooRpcRequest)
        returns (FooRpcResponse) {
      option deadline = 20.0;
    }
    

Features missing for textobjects.scm:

  • missing serviceBody
@sdoerner
Copy link
Contributor Author

@yusdacra @treywood - feel free to comment directly here on the above. Otherwise I'll try to reach out more directly.

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements A-language-support Area: Support for programming/text languages labels Sep 29, 2024
@yusdacra
Copy link
Contributor

yusdacra commented Oct 3, 2024

yeah sure, i don't mind unifying work somewhere else. i haven't looked at the grammar in a long while anyway 😅

@sdoerner
Copy link
Contributor Author

sdoerner commented Nov 1, 2024

Couldn't get in touch with @treywood so far. There is also an open PR without a response after 3 weeks. So upstreaming may be difficult.

My updated plan is now to create a new fork with the following features:

@sdoerner sdoerner linked a pull request Dec 9, 2024 that will close this issue
@sdoerner
Copy link
Contributor Author

sdoerner commented Dec 9, 2024

Created a draft PR for now, to provide some time for feedback from other proto users. Please let me know if you see any issues (in particular @yusdacra, in case you still use protos regularly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants