Skip to content

Commit

Permalink
Merge pull request #966 from julia-vscode/sp/ssc-download-setting
Browse files Browse the repository at this point in the history
make symbolcache downloads configurable
  • Loading branch information
davidanthoff authored Jul 19, 2021
2 parents 287be7f + 4504b14 commit 3093d16
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/languageserverinstance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mutable struct LanguageServerInstance
status::Symbol

number_of_outstanding_symserver_requests::Int
symserver_use_download::Bool

current_symserver_progress_token::Union{Nothing,String}

Expand All @@ -63,7 +64,7 @@ mutable struct LanguageServerInstance

shutdown_requested::Bool

function LanguageServerInstance(pipe_in, pipe_out, env_path="", depot_path="", err_handler=nothing, symserver_store_path=nothing)
function LanguageServerInstance(pipe_in, pipe_out, env_path="", depot_path="", err_handler=nothing, symserver_store_path=nothing, download=true)
new(
JSONRPC.JSONRPCEndpoint(pipe_in, pipe_out, err_handler),
Set{String}(),
Expand All @@ -80,11 +81,12 @@ mutable struct LanguageServerInstance
StaticLint.LintOptions(),
:all,
LINT_DIABLED_DIRS,
:import, # options: :import or :qualify, anything else turns this off
:qualify, # options: :import or :qualify, anything else turns this off
Channel{Any}(Inf),
err_handler,
:created,
0,
download,
nothing,
false,
false,
Expand Down Expand Up @@ -171,6 +173,10 @@ function trigger_symbolstore_reload(server::LanguageServerInstance)
end
server.number_of_outstanding_symserver_requests += 1

if server.symserver_use_download
@debug "Will download symbol server caches for this instance."
end

@async try
# TODO Add try catch handler that links into crash reporting
ssi_ret, payload = SymbolServer.getstore(
Expand All @@ -188,7 +194,7 @@ function trigger_symbolstore_reload(server::LanguageServerInstance)
end
end,
server.err_handler,
download = true
download = server.symserver_use_download
)

server.number_of_outstanding_symserver_requests -= 1
Expand Down

0 comments on commit 3093d16

Please sign in to comment.