Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Add support to ignore certain diagnostics #46

Merged
merged 1 commit into from Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languageFeatures.ts
Expand Up @@ -181,6 +181,7 @@ export class DiagnosticsAdapter extends Adapter {
}
const markers = diagnostics
.reduce((p, c) => c.concat(p), [])
.filter(d => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use indexOf to be compatible with IE 11

.map(d => this._convertDiagnostics(resource, d));

monaco.editor.setModelMarkers(monaco.editor.getModel(resource), this._selector, markers);
Expand Down
1 change: 1 addition & 0 deletions src/monaco.d.ts
Expand Up @@ -129,6 +129,7 @@ declare module monaco.languages.typescript {
noSemanticValidation?: boolean;
noSyntaxValidation?: boolean;
noSuggestionDiagnostics?: boolean;
diagnosticCodesToIgnore?: number[];
}

export interface LanguageServiceDefaults {
Expand Down