mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Add support to ignore certain diagnostics
This commit is contained in:
parent
c050127710
commit
d5b5ce14f4
2 changed files with 2 additions and 0 deletions
|
|
@ -181,6 +181,7 @@ export class DiagnosticsAdapter extends Adapter {
|
||||||
}
|
}
|
||||||
const markers = diagnostics
|
const markers = diagnostics
|
||||||
.reduce((p, c) => c.concat(p), [])
|
.reduce((p, c) => c.concat(p), [])
|
||||||
|
.filter(d => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1)
|
||||||
.map(d => this._convertDiagnostics(resource, d));
|
.map(d => this._convertDiagnostics(resource, d));
|
||||||
|
|
||||||
monaco.editor.setModelMarkers(monaco.editor.getModel(resource), this._selector, markers);
|
monaco.editor.setModelMarkers(monaco.editor.getModel(resource), this._selector, markers);
|
||||||
|
|
|
||||||
1
src/monaco.d.ts
vendored
1
src/monaco.d.ts
vendored
|
|
@ -129,6 +129,7 @@ declare module monaco.languages.typescript {
|
||||||
noSemanticValidation?: boolean;
|
noSemanticValidation?: boolean;
|
||||||
noSyntaxValidation?: boolean;
|
noSyntaxValidation?: boolean;
|
||||||
noSuggestionDiagnostics?: boolean;
|
noSuggestionDiagnostics?: boolean;
|
||||||
|
diagnosticCodesToIgnore?: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LanguageServiceDefaults {
|
export interface LanguageServiceDefaults {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue