-
Hello! everyone Let's get to the point Here is my language grammar
Grammar above is for
As you see,
Until here, There is nothing special or difficult.. Example can be changed follow.. I know it cause the errors.. BUT error messages is very strange
Error of line 2 is normal result, but error of line 3 is not same as line 2, it is "AST node has no document" My point is Why "AST node has no document" cause and How can I fix it... I append full source project for this.. you can get the same situation by runing Thank you for listening my sufficient explanation and help me... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hey @negahama, Thanks for providing a reproducible project. I've been trying to hunt down this issue forever, but failed to find some reproducible setup. I'll take a look in the upcoming days :) |
Beta Was this translation helpful? Give feedback.
-
Hi.. everyone. Anyway... I want to discuss this issue again because my grammar is so complex, so I want to use the So I'll explain this problem one more time in other way
I want to process my code below by using above grammar
It works successfully Now that I change the grammar to below to reduce the complexity of grammar.
As you can see, It works successfully too Until this moment, everything work as we expected... I append new export class MyLanguageScopeProvider extends DefaultScopeProvider {
constructor(services: LangiumServices) {
super(services)
}
override getScope(context: ReferenceInfo): Scope {
const call = context.container as ast.MemberCall
const previous = call.previous
if (previous) {
// console.log('ref:', previous.element.ref?.name, previous.element.ref?.$type)
}
return super.getScope(context)
}
} It works well until I active the console.log comment.. So My point is... When I use The Langium throws exception This is absolutely not a irreproducible issue. As usual, I will cut it short in anticipation of quick action. |
Beta Was this translation helpful? Give feedback.
See fix and test case in #1762.