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

Support users to replace parser rules which are used only as type for cross-references by type declarations #1391

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

JohannesMeierSE
Copy link
Contributor

@JohannesMeierSE JohannesMeierSE commented Feb 29, 2024

This PR contributes the following things and closes #1309:

  • At the moment parser rules which are used not for parsing but whose type is used in cross-references are marked as "unused" for users. This message is not accurate and could confuse inexperienced users. Therefore, the message of the validation is improved to "This parser rule is not used for parsing, but referenced by cross-references. Consider to replace this rule by a type declaration.". See Parser rule used as type for cross-reference is marked as "unused" #1309 for details.
  • Additionally, a quick-fix is provided for users to replace such a parser rule by a type declaration.
  • While the two contributions above target a quite special case, this PR contributes also a generic helper functionality to check quick-fixes (testQuickFix in packages/langium/src/test/langium-test.ts). This function is tested by applying it to the mentioned new quick-fix for the Langium grammar.

@JohannesMeierSE JohannesMeierSE force-pushed the validation-unused-rule-crossreference branch from 59cd7b0 to 136a1f9 Compare March 8, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parser rule used as type for cross-reference is marked as "unused"
1 participant