Skip to content

Commit fa5744f

Browse files
authored
Merge pull request #678 from julia-vscode/farguse
support for func arg use check in SL
2 parents 826e025 + 698efbd commit fa5744f

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/protocol/basic.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ const DiagnosticSeverities = (Error = 1,
5858
Hint = 4)
5959

6060
const DiagnosticTag = Int
61-
const DiagnosticTags = (Error = 1,
62-
Warning = 2,
63-
Information = 3,
64-
Hint = 4)
61+
const DiagnosticTags = (Unnecessary = 1,
62+
Deprecated = 2)
6563

6664
struct DiagnosticRelatedInformation
6765
location::Location

src/requests/textdocument.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,11 @@ function mark_errors(doc, out = Diagnostic[])
305305
elseif CSTParser.isidentifier(errs[i][2]) && !StaticLint.haserror(errs[i][2])
306306
push!(out, Diagnostic(Range(r[1] - 1, r[2], line - 1, char), DiagnosticSeverities.Warning, "Julia", "Julia", "Missing reference: $(errs[i][2].val)", missing, missing))
307307
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
309313
end
310314
i += 1
311315
i>n && break

src/requests/workspace.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ function request_julia_config(server)
107107
response[N + 7]===nothing ? false : response[N + 7],
108108
response[N + 8]===nothing ? false : response[N + 8],
109109
response[N + 9]===nothing ? false : response[N + 9],
110+
response[N + 10]===nothing ? false : response[N + 10],
110111
)
111112

112113
new_run_lint_value = x===nothing ? false : true

0 commit comments

Comments
 (0)