Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update for documentformat option changes
  • Loading branch information
ZacLN committed Jun 9, 2020
commit ec1f3eaecd54a7edf55c647e297948b1589cfeb1
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
JSON = "0.20, 0.21"
julia = "1"
CSTParser = "2.2"
DocumentFormat = "2.2"
DocumentFormat = "3"
StaticLint = "4.3"
Tokenize = "0.5.7"
SymbolServer = "4.2"
Expand Down
17 changes: 9 additions & 8 deletions src/requests/workspace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ function request_julia_config(server::LanguageServerInstance, conn)
ConfigurationItem(missing, "julia.format.comments"),
ConfigurationItem(missing, "julia.format.docs"),
ConfigurationItem(missing, "julia.format.lineends"),
ConfigurationItem(missing, "julia.format.kw"),
ConfigurationItem(missing, "julia.format.keywords"),
ConfigurationItem(missing, "julia.format.kwspacing"),
ConfigurationItem(missing, "julia.lint.call"), # LintOptions
ConfigurationItem(missing, "julia.lint.iter"),
ConfigurationItem(missing, "julia.lint.nothingcomp"),
Expand All @@ -106,15 +107,15 @@ function request_julia_config(server::LanguageServerInstance, conn)
]))

if server.clientInfo isa InfoParams && server.clientInfo.name == "vscode"
server.format_options = DocumentFormat.FormatOptions([isnothing(a) ? (DocumentFormat.default_options[i] isa Bool ? false : DocumentFormat.default_options[i]) : a for (i, a) in enumerate(response[1:11])]...)
new_runlinter = isnothing(response[22]) ? false : true
new_SL_opts = StaticLint.LintOptions([isnothing(a) ? (StaticLint.default_options[i] isa Bool ? false : StaticLint.default_options[i]) : a for (i, a) in enumerate(response[12:21])]...)
server.format_options = DocumentFormat.FormatOptions([isnothing(a) ? (DocumentFormat.default_options[i] isa Bool ? false : DocumentFormat.default_options[i]) : a for (i, a) in enumerate(response[1:12])]...)
new_runlinter = isnothing(response[23]) ? false : true
new_SL_opts = StaticLint.LintOptions([isnothing(a) ? (StaticLint.default_options[i] isa Bool ? false : StaticLint.default_options[i]) : a for (i, a) in enumerate(response[13:22])]...)
else
server.format_options = DocumentFormat.FormatOptions(response[1:11]...)
new_runlinter = something(response[22], true)
new_SL_opts = StaticLint.LintOptions(response[12:21]...)
server.format_options = DocumentFormat.FormatOptions(response[1:12]...)
new_runlinter = something(response[23], true)
new_SL_opts = StaticLint.LintOptions(response[13:22]...)
end
new_lint_missingrefs = Symbol(something(response[23], :all))
new_lint_missingrefs = Symbol(something(response[24], :all))

rerun_lint = any(getproperty(server.lint_options, opt) != getproperty(new_SL_opts, opt) for opt in fieldnames(StaticLint.LintOptions)) ||
server.runlinter != new_runlinter || server.lint_missingrefs != new_lint_missingrefs
Expand Down