-
Hello guys, I'm trying to suppress validators when there are linking errors. I think in a non-language-server environment (e.g., CLI, I can pass the I guess I must have missed something obvious. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
OK, I think I've got it to work by implementing a custom document builder and override export class ZModelDocumentBuilder extends DefaultDocumentBuilder {
override buildDocuments(documents: LangiumDocument[], options: BuildOptions, cancelToken: any): Promise<void> {
console.log('Building documents: ' + documents.map((d) => d.uri).join(', '));
return super.buildDocuments(
documents,
{
...options,
validation: {
stopAfterLexingErrors: true,
stopAfterParsingErrors: true,
stopAfterLinkingErrors: true,
},
},
cancelToken,
);
}
} Not sure if it's the right way to do it. |
Beta Was this translation helpful? Give feedback.
Hey @ymc9,
That's a reasonable solution. However, you can also just adjust the following property of the document builder:
langium/packages/langium/src/workspace/document-builder.ts
Lines 142 to 147 in 98460c8