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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pr/spahnke/48
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Dec 17, 2019
2 parents 8b18d16 + 92c4b95 commit fd244a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/languageFeatures.ts
Original file line number Diff line number Diff line change
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)
.map(d => this._convertDiagnostics(resource, d));

monaco.editor.setModelMarkers(monaco.editor.getModel(resource), this._selector, markers);
Expand All @@ -201,7 +202,8 @@ export class DiagnosticsAdapter extends Adapter {
endColumn,
message: flattenDiagnosticMessageText(diag.messageText, '\n'),
code: diag.code.toString(),
relatedInformation: this._convertRelatedInformation(resource, diag.relatedInformation)
tags: diag.reportsUnnecessary ? [monaco.MarkerTag.Unnecessary] : [],
relatedInformation: this._convertRelatedInformation(resource, diag.relatedInformation),
};
}

Expand Down
1 change: 1 addition & 0 deletions src/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ declare module monaco.languages.typescript {
noSemanticValidation?: boolean;
noSyntaxValidation?: boolean;
noSuggestionDiagnostics?: boolean;
diagnosticCodesToIgnore?: number[];
}

export interface LanguageServiceDefaults {
Expand Down

0 comments on commit fd244a1

Please sign in to comment.