Skip to content

Commit

Permalink
make symbolcache downloads configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pfitzseb committed Jul 19, 2021
1 parent 287be7f commit 4504b14
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 4504b14

Please sign in to comment.