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

Fixed invalid grammar validation error #1020

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

gfontorbe
Copy link
Contributor

Closes #940

Updated how assignments are collected to get rid of the following validation errors:

interface A {
	b: string
}

A  returns A: B | C;     // <-- error: Property 'b' is missing in a rule 'A', but is required in type 'A'.
AA returns A: B;         // <-- error: Property 'b' is missing in a rule 'AA', but is required in type 'A'. even if C is not referenced.

B returns A: b='foo';

interface C extends A {};
C returns A: { C } b='bar';

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed a minor issue that we should probably address in a separate PR:

interface Y {
    event: @Event;
    state: @State;
}

Transition returns Y:
    Transition2;

Transition2: event=[Event] '=>' state=[State];

When trying to navigate to the declaration of the event assignment, nothing happens. However, when looking for references of the event property in the Y interface, we get the event assignment back. Those two functions should work in tandem. However, this is a bit unrelated to the issue at hand.

So, looks good to me 👍

@gfontorbe gfontorbe merged commit 6d1de48 into main Apr 13, 2023
@gfontorbe gfontorbe deleted the gfontorbe/940-invalid-validation-rule branch April 13, 2023 07:56
@msujew msujew added this to the v1.2.0 milestone May 2, 2023
emilkrebs added a commit that referenced this pull request May 15, 2023
* added missing arithmetics validations and potences and modulo operations

* added essential steps

* Fixed validation and the arithmetics language server

* fixed the arithmetics examples

* resolved the issues mentioned in 1013

* Normalize line endings for yeoman generator (#1005)

* Fix document highlighting for non-local references (#1000)

* [utils/streams] replicated signature overloads to 'StreamImpl'

this way they're also applied to vars of the ...Impl types
(TypeScript apparently doesn't apply interface overloads to implementing classes)

* Fixed invalid grammar validation error (#1020)

* Add validation for cross-reference to union type (#1017)

* Add validation for cross-reference to union type

* Update packages/langium/src/grammar/validation/validator.ts

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Update packages/langium/src/grammar/validation/validator.ts

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Return only one error for multiple non AST nodes

---------

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>

* Fix build error (#1023)

Fixed build error

* Add IPA for 'Langium' (#1024)

* resolved the issues mentioned by @sailingfox

* Improve completion behavior for cross references (#1004)

* Automate release process (#1031)

* Publish version 1.2.0 (#1035)

* Add publishing permissions (#1036)

* fixed the language server

* Fix missing files in yeoman generator (#1038)

* Another fix for the broken `generator-langium` (#1040)

* Import types instead of import and prepare update to TS5.0 (#1018)

* Import types instead of import and prepare update to TS5.0

* Update yeoman generator test

* Remove hello-world from package-lock

* Fix import type in ast-generator.ts

* Fix rebase errors

* Rebase

* a small fix

* changed "default" to "case"

* improved arithmetics example

* throws an error when using a unsupported operator

* added comments and fixed some small issues

* added missing arithmetics validations and potences and modulo operations

* added essential steps

* Fixed validation and the arithmetics language server

* fixed the arithmetics examples

* resolved the issues mentioned in 1013

* resolved the issues mentioned by @sailingfox

* fixed the language server

* a small fix

* changed "default" to "case"

* improved arithmetics example

* throws an error when using a unsupported operator

* added comments and fixed some small issues

* fixed some rebasing issues

* added a $ to the evaluations array

---------

Co-authored-by: Mark Sujew <mark.sujew@typefox.io>
Co-authored-by: Christian Schneider <christian.schneider@typefox.io>
Co-authored-by: Guillaume Fontorbe <guillaume.fontorbe@typefox.io>
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.

Invalid grammar validation errors on rules with unassigned rule calls
2 participants