Move diagnostic tags api out of proposed

Also rename `customTags` to `tags`

Fixes #51104
This commit is contained in:
Matt Bierner
2018-06-18 10:07:21 -07:00
parent c64a6f291b
commit 2e5253d493
11 changed files with 36 additions and 34 deletions

View File

@@ -155,7 +155,7 @@ export class DiagnosticsManager {
return this._diagnostics.get(DiagnosticKind.Suggestion)!.get(file).filter(x => {
if (!this._enableSuggestions) {
// Still show unused
return x.customTags && x.customTags.indexOf(vscode.DiagnosticTag.Unnecessary) !== -1;
return x.tags && x.tags.indexOf(vscode.DiagnosticTag.Unnecessary) !== -1;
}
return true;
});

View File

@@ -154,7 +154,7 @@ export default class LanguageProvider {
const reportUnnecessary = config.get<boolean>('showUnused', true);
this.diagnosticsManager.diagnosticsReceived(diagnosticsKind, file, diagnostics.filter(diag => {
if (!reportUnnecessary) {
diag.customTags = undefined;
diag.tags = undefined;
if (diag.reportUnnecessary && diag.severity === vscode.DiagnosticSeverity.Hint) {
return false;
}

View File

@@ -298,7 +298,7 @@ export default class TypeScriptServiceClientHost {
}).filter((x: any) => !!x) as DiagnosticRelatedInformation[];
}
if (diagnostic.reportsUnnecessary) {
converted.customTags = [DiagnosticTag.Unnecessary];
converted.tags = [DiagnosticTag.Unnecessary];
}
(converted as Diagnostic & { reportUnnecessary: any }).reportUnnecessary = diagnostic.reportsUnnecessary;
return converted as Diagnostic & { reportUnnecessary: any };