Merge remote-tracking branch 'origin/master' into pr/spahnke/48

This commit is contained in:
Alex Dima 2019-12-17 08:59:09 +01:00
commit fd244a1577
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
2 changed files with 4 additions and 1 deletions

View file

@ -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);
@ -201,7 +202,8 @@ export class DiagnosticsAdapter extends Adapter {
endColumn, endColumn,
message: flattenDiagnosticMessageText(diag.messageText, '\n'), message: flattenDiagnosticMessageText(diag.messageText, '\n'),
code: diag.code.toString(), code: diag.code.toString(),
relatedInformation: this._convertRelatedInformation(resource, diag.relatedInformation) tags: diag.reportsUnnecessary ? [monaco.MarkerTag.Unnecessary] : [],
relatedInformation: this._convertRelatedInformation(resource, diag.relatedInformation),
}; };
} }

1
src/monaco.d.ts vendored
View file

@ -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 {