Skip to content

Commit

Permalink
feat: stop validation after lexing/parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Oct 22, 2023
1 parent c03f637 commit 8bcd74f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/language/safe-ds-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { SafeDsTypeChecker } from './typing/safe-ds-type-checker.js';
import { SafeDsCoreTypes } from './typing/safe-ds-core-types.js';
import { SafeDsNodeKindProvider } from './lsp/safe-ds-node-kind-provider.js';
import { SafeDsDocumentSymbolProvider } from './lsp/safe-ds-document-symbol-provider.js';
import { SafeDsDocumentBuilder } from './workspace/safe-ds-document-builder.js';

/**
* Declaration of custom services - add your own service classes here.
Expand Down Expand Up @@ -106,6 +107,7 @@ export const SafeDsSharedModule: Module<SafeDsSharedServices, DeepPartial<SafeDs
NodeKindProvider: () => new SafeDsNodeKindProvider(),
},
workspace: {
DocumentBuilder: (services) => new SafeDsDocumentBuilder(services),
WorkspaceManager: (services) => new SafeDsWorkspaceManager(services),
},
};
Expand Down
11 changes: 11 additions & 0 deletions src/language/workspace/safe-ds-document-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { BuildOptions, DefaultDocumentBuilder } from 'langium';

export class SafeDsDocumentBuilder extends DefaultDocumentBuilder {
override updateBuildOptions: BuildOptions = {
validation: {
categories: ['built-in', 'fast'],
stopAfterLexingErrors: true,
stopAfterParsingErrors: true,
},
};
}

0 comments on commit 8bcd74f

Please sign in to comment.