|
269 | 269 |
|
270 | 270 | function mark_errors(doc, out = Diagnostic[]) |
271 | 271 | line_offsets = get_line_offsets(doc) |
272 | | - errs = StaticLint.collect_hints(getcst(doc)) |
| 272 | + errs = StaticLint.collect_hints(getcst(doc), doc.server) |
273 | 273 | n = length(errs) |
274 | 274 | n == 0 && return out |
275 | 275 | i = 1 |
@@ -305,7 +305,11 @@ function mark_errors(doc, out = Diagnostic[]) |
305 | 305 | elseif CSTParser.isidentifier(errs[i][2]) && !StaticLint.haserror(errs[i][2]) |
306 | 306 | push!(out, Diagnostic(Range(r[1] - 1, r[2], line - 1, char), DiagnosticSeverities.Warning, "Julia", "Julia", "Missing reference: $(errs[i][2].val)", missing, missing)) |
307 | 307 | elseif StaticLint.haserror(errs[i][2]) && StaticLint.errorof(errs[i][2]) isa StaticLint.LintCodes |
308 | | - push!(out, Diagnostic(Range(r[1] - 1, r[2], line - 1, char), DiagnosticSeverities.Information, "Julia", "Julia", get(StaticLint.LintCodeDescriptions, StaticLint.errorof(errs[i][2]), ""), missing, missing)) |
| 308 | + if StaticLint.errorof(errs[i][2]) === StaticLint.UnusedFunctionArgument |
| 309 | + push!(out, Diagnostic(Range(r[1] - 1, r[2], line - 1, char), DiagnosticSeverities.Hint, "Julia", "Julia", get(StaticLint.LintCodeDescriptions, StaticLint.errorof(errs[i][2]), ""), [DiagnosticTags.Unnecessary], missing)) |
| 310 | + else |
| 311 | + push!(out, Diagnostic(Range(r[1] - 1, r[2], line - 1, char), DiagnosticSeverities.Information, "Julia", "Julia", get(StaticLint.LintCodeDescriptions, StaticLint.errorof(errs[i][2]), ""), missing, missing)) |
| 312 | + end |
309 | 313 | end |
310 | 314 | i += 1 |
311 | 315 | i>n && break |
|
0 commit comments