Skip to content

Commit

Permalink
Implemented version without 'suppressHiddenDiagnostics' and returned …
Browse files Browse the repository at this point in the history
…hard codings for CSxxxx fadings.
  • Loading branch information
savpek committed Apr 10, 2019
1 parent c8e8dd2 commit 7a24182
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,6 @@
"default": false,
"description": "Suppress the warning that project.json is no longer a supported project format for .NET Core applications"
},
"csharp.suppressHiddenDiagnostics": {
"type": "boolean",
"default": true,
"description": "Suppress 'hidden' diagnostics (such as 'unnecessary using directives') from appearing in the editor or the Problems pane."
},
"csharp.referencesCodeLens.enabled": {
"type": "boolean",
"default": true,
Expand Down
4 changes: 3 additions & 1 deletion src/features/diagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ class DiagnosticsProvider extends AbstractSupport {
}

private _asDiagnostic(quickFix: protocol.QuickFix): vscode.Diagnostic | undefined {
let isFadeout = (quickFix.Tags && !!quickFix.Tags.find(x => x.toLowerCase() == 'unnecessary'));
// CS0162 & CS8019 => Unnused using and unreachable code.
// These hard coded values bring some goodnes of fading even when analyzers are disabled.
let isFadeout = (quickFix.Tags && !!quickFix.Tags.find(x => x.toLowerCase() == 'unnecessary')) || quickFix.Id == "CS0162" || quickFix.Id == "CS8019";

let severity = this._asDiagnosticSeverity(quickFix, isFadeout);

Expand Down

0 comments on commit 7a24182

Please sign in to comment.