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

Problems disappear (or change) after saving #12

Closed
eternalphane opened this issue Dec 4, 2017 · 2 comments
Closed

Problems disappear (or change) after saving #12

eternalphane opened this issue Dec 4, 2017 · 2 comments
Labels

Comments

@eternalphane
Copy link

The visual example (sry the quality is suck):

screenshot

Well, I can't tell whether this is a bug of the extension or vsc itself. Anyway, please try to reproduce this to figure out.

@mike-lischke
Copy link
Owner

This is normal behavior. When you save the grammar all diagnostics collected by the extension are replaced by those reported from ANTLR4. This usually gives you more issues than what was found internally. In your case however it seems that ANTLR4 only issues a warning, but no error. Hence your unkown rule/token errors disappear.

This could happen when ANTLR4 can find those rules and the extension cannot, which is a rather strange situation unless you have a special setup and the extension cannot find an import or a token vocabulary. Please check if e.g. that FLOATING_POINT_LITERAL is defined somewhere else which makes ANTLR4 able to resolve it. Is it perhaps in a .tokens file only? This is not examined by the extension and can hence lead to slightly different behavior.

@eternalphane
Copy link
Author

Well, I didn't set antlr4.generation.importDir, and it seems that code won't generate if there's any error in .g4 file, so .tokens file doesn't exist as well.

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

No branches or pull requests

2 participants