Skip to content

Commit 254b084

Browse files
authored
Merge branch 'master' into remsetpath
2 parents 5d5c593 + fa5744f commit 254b084

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ JSON = "0.20, 0.21"
2626
julia = "1"
2727
CSTParser = "2.2"
2828
DocumentFormat = "2.1"
29-
StaticLint = "4"
29+
StaticLint = "4.1"
3030
Tokenize = "0.5.7"
3131
SymbolServer = "4.2"
3232
URIParser = "0.4.1"

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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ end
269269

270270
function mark_errors(doc, out = Diagnostic[])
271271
line_offsets = get_line_offsets(doc)
272-
errs = StaticLint.collect_hints(getcst(doc))
272+
errs = StaticLint.collect_hints(getcst(doc), doc.server)
273273
n = length(errs)
274274
n == 0 && return out
275275
i = 1
@@ -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)