Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fade out unnecessary usings #2646

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/features/diagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of a hack. Roslyn has analyzers that will fade all sorts of unused things, so it might be nice to properly flow that information from omnisharp so we can fade everything...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that sounds right. Will look into it.

{
//fade out the unnecessary usings
diagnostic.tags = [vscode.DiagnosticTag.Unnecessary];
}

return diagnostic;
}

private static _asDiagnosticSeverity(logLevel: string): vscode.DiagnosticSeverity {
Expand Down