mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
Move diagnostic tags api out of proposed
Also rename `customTags` to `tags` Fixes #51104
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user