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

Fixed end of file indenting and code completion for ANTLR v4 #4878

Merged
merged 2 commits into from
Oct 30, 2022

Conversation

lkishalmi
Copy link
Contributor

Well, if we would have a 16-rc3 this would be a nice to have.

This one makes the formatting work if the editing happens at the end of the file.

The code completion has a fix and a feature creep. At the end of the file due to the bug in AntlrTokenSequence it was offering (lexer, parser, grammar).

The feature creep is a trivial one. We already have the unknown references collected during parsing, so why not offer to define those while not in a rule definition.

@lkishalmi lkishalmi added this to the NB16 milestone Oct 29, 2022
@neilcsmith-net
Copy link
Member

@lkishalmi we aim to have at least 3 release candidates, so 16-rc3 is happening. Have retriggered the failing tests (failure in binary downloads so not related to changes). I'll wait for @matthiasblaesing review.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me. I noticed another bug in the formatting though (not introduced here).

  1. Open the ANTLRv4Lexer.g4 file
  2. Format it
  3. You get this:
    image

Line 49 and 53 should not be indented in my mind.

@neilcsmith-net neilcsmith-net merged commit 5a65ece into apache:delivery Oct 30, 2022
@lkishalmi
Copy link
Contributor Author

@neilcsmith-net Thanks for the merge!

@matthiasblaesing I've tried to solve this indenting issue, but that got too convoluted, and caused other issues. I fear I have to rewrite the formatting code for that. So far what that's just heuristics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants