antlr4-intellij-adaptor: syntax error highlighting quirks
This issue was migrated from this jetbrains dev forum post; you can the whole discussion up to this point there. I kind of hijacked that thread – sorry about that! Probably should’ve moved stuff here sooner 😃
Here are some of the latest syntax error highlighting quirks I’ve stumbled across.
I have a uses/import list rule that looks like:
usesList
: 'uses' ID (',' ID)* ';'
;
So I type
Precis X;
uses y
end X;
doesn’t point out the missing semicolon after y
.
If I do something like uses x, y
it’ll complain – so it’s only for lists with a single element then I guess?
Another one too:
Precis X;
//error, should be something (not semi colon) immediately after ':'
Definition x : ;
end X;
The grammar for this lang can be read here. It has a fairly big expression hierarchy and just two types of declarations: definitions and theorems. Definition’s can take on several signature styles such prefix, postfix, outfix. I’ve only tried the prefix right now, before I ran into the issue mentioned above.
The rules composing the definition construct mentioned above starts at mathStandardDefinitionDecl
(the signature referenced will be mathPrefixDefinitionSig
).
About this issue
- Original URL
- State: open
- Created 9 years ago
- Reactions: 1
- Comments: 21 (4 by maintainers)
Commits related to this issue
- Fix error highlighting for missing tokens https://github.com/antlr/jetbrains/issues/2 https://github.com/protostuff/protobuf-jetbrains-plugin/issues/25 — committed to kshchepanovskyi/antlr4-jetbrains-adapter by kshchepanovskyi 8 years ago
- Issue #2, "some syntax errors don't get highlighted" — committed to matozoid/antlr4-intellij-adaptor by matozoid 3 years ago
- Merge pull request #19 from matozoid/issue_2_highlighting_again Issue #2, "some syntax errors don't get highlighted" — committed to antlr/antlr4-intellij-adaptor by bjansen a year ago
- chore: add unit tests for #2 — committed to antlr/antlr4-intellij-adaptor by bjansen a year ago
- fix: better fix for #2 — committed to antlr/antlr4-intellij-adaptor by bjansen a year ago
@Shan1024 I published patch here; my fork contains many other changes, unfortunately I cannot make regular PR, it will take too much time.