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

Root rules should not be highlighted as "unused parse rule" #243

Closed
KvanTTT opened this issue Dec 21, 2015 · 7 comments
Closed

Root rules should not be highlighted as "unused parse rule" #243

KvanTTT opened this issue Dec 21, 2015 · 7 comments

Comments

@KvanTTT
Copy link
Member

KvanTTT commented Dec 21, 2015

Also discussion is here: antlr/antlr4#1069

@yegorpetrov
Copy link

I don't think it's even possible to decide whether a rule is used or unused. So may be there should be some special highlighting for "top-level rules". That could be enough of a hint for grammar developers without being false positive about use.

@parrt
Copy link
Member

parrt commented Jun 5, 2016

Any rule can be start symbol so no way to turn off grey squiggly. it's more useful to have than not so i'll close. thanks though!

@Enerccio
Copy link

maybe add a comment like // toplevel that would turn the spurious warning?

@MrCoder
Copy link

MrCoder commented Jan 21, 2021

maybe add a comment like // toplevel that would turn the spurious warning?

https://eslint.org/docs/2.13.1/user-guide/configuring#disabling-rules-with-inline-comments This is how eslint handles it.

@KvanTTT
Copy link
Member Author

KvanTTT commented Nov 6, 2023

@MrCoder "Page not found". Could you please update the link and add its content to the comment?

@j4k0xb
Copy link

j4k0xb commented Mar 7, 2024

@MrCoder "Page not found". Could you please update the link and add its content to the comment?

https://eslint.org/docs/latest/use/configure/rules#disabling-rules

To disable a specific rule on a specific line:

alert('foo'); // eslint-disable-line no-alert

// eslint-disable-next-line no-alert
alert('foo');

alert('foo'); /* eslint-disable-line no-alert */

/* eslint-disable-next-line no-alert */
alert('foo');

@bjansen
Copy link
Collaborator

bjansen commented Mar 7, 2024

In Java it's possible to use //noinspection <Inspection name>, I'll see if it's possible to have the same thing in ANTLR.

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

No branches or pull requests

7 participants