From 63d538af7a0d3b57ef3a2e3690e66c3d3837d180 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Fri, 2 Nov 2018 12:49:56 +0530 Subject: [PATCH] Mark the diagnostic as unnecessary to fade out the using --- src/features/diagnosticsProvider.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/features/diagnosticsProvider.ts b/src/features/diagnosticsProvider.ts index feacb7236..51fbf52db 100644 --- a/src/features/diagnosticsProvider.ts +++ b/src/features/diagnosticsProvider.ts @@ -325,7 +325,14 @@ class DiagnosticsProvider extends AbstractSupport { private static _asDiagnostic(quickFix: protocol.QuickFix): vscode.Diagnostic { let severity = DiagnosticsProvider._asDiagnosticSeverity(quickFix.LogLevel); let message = `${quickFix.Text} [${quickFix.Projects.map(n => DiagnosticsProvider._asProjectLabel(n)).join(', ')}]`; - return new vscode.Diagnostic(toRange(quickFix), message, severity); + let diagnostic = new vscode.Diagnostic(toRange(quickFix), message, severity); + if(diagnostic.message.includes("Unnecessary using directive")) + { + //fade out the unnecessary usings + diagnostic.tags = [vscode.DiagnosticTag.Unnecessary]; + } + + return diagnostic; } private static _asDiagnosticSeverity(logLevel: string): vscode.DiagnosticSeverity {