Skip to content

Commit

Permalink
move severity update to Scan() loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Jun 6, 2021
1 parent 7f7e277 commit 7fac68c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions langserver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@ func (h *langHandler) lint(ctx context.Context, uri DocumentURI) ([]Diagnostic,
source = &configs[i].LintSource
}

severity := 1
if config.LintSeverity != 0 {
severity = config.LintSeverity
}
scanner := efms.NewScanner(bytes.NewReader(b))
for scanner.Scan() {
entry := scanner.Entry()
Expand Down Expand Up @@ -461,6 +457,10 @@ func (h *langHandler) lint(ctx context.Context, uri DocumentURI) ([]Diagnostic,
if len(config.LintCategoryMap) > 0 {
entry.Type = []rune(config.LintCategoryMap[string(entry.Type)])[0]
}
severity := 1
if config.LintSeverity != 0 {
severity = config.LintSeverity
}
switch {
case entry.Type == 'E' || entry.Type == 'e':
severity = 1
Expand Down

0 comments on commit 7fac68c

Please sign in to comment.