Skip to content

Commit adb27e5

Browse files
committed
enable/disable deprecated diagnostics in core instead of requiring each diagnostic provider do so
1 parent a8f1fed commit adb27e5

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

extensions/typescript-language-features/src/languageProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export default class LanguageProvider extends Disposable {
127127
const reportUnnecessary = config.get<boolean>('showUnused', true);
128128
const reportDeprecated = config.get<boolean>('showDeprecated', true);
129129
this.client.diagnosticsManager.updateDiagnostics(file, this._diagnosticLanguage, diagnosticsKind, diagnostics.filter(diag => {
130+
// Don't both reporting diagnostics we know will not be rendered
130131
if (!reportUnnecessary) {
131132
if (diag.reportUnnecessary && diag.severity === vscode.DiagnosticSeverity.Hint) {
132133
return false;

src/vs/editor/browser/widget/codeEditorWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,5 +2011,5 @@ registerThemingParticipant((theme, collector) => {
20112011
}
20122012

20132013
const deprecatedForeground = theme.getColor(editorForeground) || 'inherit';
2014-
collector.addRule(`.monaco-editor .${ClassName.EditorDeprecatedInlineDecoration} { text-decoration: line-through; text-decoration-color: ${deprecatedForeground}}`);
2014+
collector.addRule(`.monaco-editor.showDeprecated .${ClassName.EditorDeprecatedInlineDecoration} { text-decoration: line-through; text-decoration-color: ${deprecatedForeground}}`);
20152015
});

src/vs/editor/common/config/editorOptions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,10 @@ class EditorClassName extends ComputedEditorOption<EditorOption.editorClassName,
12321232
if (options.get(EditorOption.showUnused)) {
12331233
className += ' showUnused';
12341234
}
1235+
1236+
if (options.get(EditorOption.showDeprecated)) {
1237+
className += ' showDeprecated';
1238+
}
12351239
return className;
12361240
}
12371241
}

0 commit comments

Comments
 (0)