Skip to content
Merged
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
make symbolcache downloads configurable
  • Loading branch information
pfitzseb committed Jul 19, 2021
commit 4504b14f9c756cb14488fe8ef178ddc1ef2e7d7f
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