Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/SymbolServer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getstore(ssi::SymbolServerInstance, environment_path::AbstractString, p

# see if we can download any package cache's before
if download
manifest_filename = isfile(joinpath(environment_path, "JuliaManifest.toml")) ? joinpath(environment_path, "JuliaManifest.toml") : joinpath(environment_path, "Manifest.toml")
manifest_filename = toml_path(environment_path, Base.manifest_names)
if isfile(manifest_filename)
let manifest = Pkg.Types.read_manifest(manifest_filename)
asyncmap(collect(validate_disc_store(ssi.store_path, manifest)), ntasks = 10) do pkg
Expand Down Expand Up @@ -131,7 +131,7 @@ function getstore(ssi::SymbolServerInstance, environment_path::AbstractString, p
end

function load_project_packages_into_store!(ssi::SymbolServerInstance, environment_path, store)
project_filename = isfile(joinpath(environment_path, "JuliaProject.toml")) ? joinpath(environment_path, "JuliaProject.toml") : joinpath(environment_path, "Project.toml")
project_filename = toml_path(environment_path, Base.project_names)
project = try
Pkg.API.read_project(project_filename)
catch err
Expand All @@ -143,7 +143,7 @@ function load_project_packages_into_store!(ssi::SymbolServerInstance, environmen
end
end

manifest_filename = isfile(joinpath(environment_path, "JuliaManifest.toml")) ? joinpath(environment_path, "JuliaManifest.toml") : joinpath(environment_path, "Manifest.toml")
manifest_filename = toml_path(environment_path, Base.manifest_names)
manifest = try
Pkg.API.read_manifest(manifest_filename)
catch err
Expand Down
12 changes: 12 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,15 @@ function write_depot(server::Server, ctx, written_caches)
!isempty(written_path) && push!(written_caches, written_path)
end
end

function toml_path(p, candidates)
if isfile(p) && basename(p) in candidates
return p
elseif isdir(p)
for c in candidates
pc = joinpath(p, c)
isfile(pc) && return pc
end
end
return nothing
end