-
Notifications
You must be signed in to change notification settings - Fork 75
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
base: main
Are you sure you want to change the base?
Conversation
59cd7b0
to
136a1f9
Compare
136a1f9
to
b05bcac
Compare
FYI: I just resolved conflicts with |
… parsing, but for cross-references eclipse-langium#1309
…th explicitly inferred type - including a WIP fix for InferredTypes in the grammar
…lity and comments
b05bcac
to
359e54e
Compare
FYI: I just resolved conflicts with While this validation looks like a small one, I found this issue in several projects in practice 🙂 |
@@ -180,6 +183,67 @@ export class LangiumGrammarCodeActionProvider implements CodeActionProvider { | |||
return undefined; | |||
} | |||
|
|||
private isRuleReplaceable(rule: ast.ParserRule): boolean { | |||
/** at the moment, only "pure" parser rules are supported: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Do you plan to support more parser rules? I.e. those that should be transformed into interfaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, I don't plan to support more parser rules. In practice, I saw only the handled "simple" cases. I am not sure whether it is worth the effort to support more cases. Do you have some examples we should handle?
Thanks @msujew for your review! I just pushed the corresponding fixes. |
This PR contributes the following things and closes #1309:
testQuickFix
inpackages/langium/src/test/langium-test.ts
). This function is tested by applying it to the mentioned new quick-fix for the Langium grammar.