Skip to content

Commit

Permalink
filter out info level in vscode validation extension (#7915)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanluo911 authored Mar 7, 2022
1 parent 7e17016 commit b06fe09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/specs/lsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,14 @@ languageServer:
.openpublishing.publish.config.json: "{}"
- expectDiagnostics:
.openpublishing.publish.config.json: [{"code": "config-not-found"}]
---
# Info-level errors will be filtered out.
inputs:
docfx.yml:
a.md:
languageServer:
- openFiles:
a.md: |
<br2/>
- expectDiagnostics:
a.md: []
1 change: 1 addition & 0 deletions src/docfx/serve/LanguageServerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private void PublishDiagnosticsParams(ErrorList errors, IEnumerable<PathString>
{
List<PathString> filesWithDiagnostics = new();
var diagnosticsGroupByFile = from error in errors.ToArray()
where error.Level != ErrorLevel.Info
let source = error.Source ?? new SourceInfo(new FilePath(".openpublishing.publish.config.json"), 0, 0)
let diagnostic = ConvertToDiagnostics(error, source)
group diagnostic by source.File;
Expand Down

0 comments on commit b06fe09

Please sign in to comment.