diff --git a/README.md b/README.md index 13d88f84..9615ce2c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![](https://github.com/julia-vscode/SymbolServer.jl/workflows/Run%20CI%20on%20master/badge.svg) [![codecov.io](http://codecov.io/github/julia-vscode/SymbolServer.jl/coverage.svg?branch=master)](http://codecov.io/github/julia-vscode/SymbolServer.jl?branch=master) -SymbolServer is a helper package for LanguageServer.jl that provides information about internal and exported variables of packages (without loading them). A package's symbol information is initially loaded in an external process but then stored on disc for (quick loading) future use. +SymbolServer is a helper package for LanguageServer.jl that provides information about internal and exported variables of packages (without loading them). A package's symbol information is initially loaded in an external process but then stored on disk for (quick loading) future use. ## Installation and Usage ```julia diff --git a/docs/src/index.md b/docs/src/index.md index 14a81d9e..75613f97 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -9,7 +9,7 @@ CurrentModule = SymbolServer ![](https://github.com/julia-vscode/SymbolServer.jl/workflows/Run%20CI%20on%20master/badge.svg) [![codecov.io](http://codecov.io/github/julia-vscode/SymbolServer.jl/coverage.svg?branch=master)](http://codecov.io/github/julia-vscode/SymbolServer.jl?branch=master) -SymbolServer is a helper package for LanguageServer.jl that provides information about internal and exported variables of packages (without loading them). A package's symbol information is initially loaded in an external process but then stored on disc for (quick loading) future use. +SymbolServer is a helper package for LanguageServer.jl that provides information about internal and exported variables of packages (without loading them). A package's symbol information is initially loaded in an external process but then stored on disk for (quick loading) future use. ## Installation and Usage diff --git a/src/SymbolServer.jl b/src/SymbolServer.jl index ffb56a73..caf8ccea 100644 --- a/src/SymbolServer.jl +++ b/src/SymbolServer.jl @@ -41,7 +41,7 @@ function getstore(ssi::SymbolServerInstance, environment_path::AbstractString, p let manifest = read_manifest(manifest_filename) if manifest !== nothing @debug "Downloading cache files for manifest at $(manifest_filename)." - to_download = collect(validate_disc_store(ssi.store_path, manifest)) + to_download = collect(validate_disk_store(ssi.store_path, manifest)) batches = Iterators.partition(to_download, max(1, floor(Int, length(to_download)รท50))) for (i, batch) in enumerate(batches) percentage = round(Int, 100*(i - 1)/length(batches)) @@ -138,7 +138,7 @@ function getstore(ssi::SymbolServerInstance, environment_path::AbstractString, p if success(p) # Now we create a new symbol store and load everything into that - # from disc + # from disk new_store = recursive_copy(stdlibs) load_project_packages_into_store!(ssi, environment_path, new_store, progress_callback) @debug "SymbolStore: store success" @@ -201,7 +201,7 @@ end """ load_package_from_cache_into_store!(ssp::SymbolServerInstance, uuid, store) -Tries to load the on-disc stored cache for a package (uuid). Attempts to generate (and save to disc) a new cache if the file does not exist or is unopenable. +Tries to load the on-disk stored cache for a package (uuid). Attempts to generate (and save to disk) a new cache if the file does not exist or is unopenable. """ function load_package_from_cache_into_store!(ssi::SymbolServerInstance, uuid::UUID, environment_path, manifest, store, progress_callback = nothing, percentage = missing) yield() @@ -234,7 +234,7 @@ function load_package_from_cache_into_store!(ssi::SymbolServerInstance, uuid::UU end catch err Base.display_error(stderr, err, catch_backtrace()) - @warn "Tried to load $pe_name but failed to load from disc, re-caching." + @warn "Tried to load $pe_name but failed to load from disk, re-caching." try rm(cache_path) catch err2 @@ -244,12 +244,12 @@ function load_package_from_cache_into_store!(ssi::SymbolServerInstance, uuid::UU end end else - @warn "$(pe_name) not stored on disc" + @warn "$(pe_name) not stored on disk" store[Symbol(pe_name)] = ModuleStore(VarRef(nothing, Symbol(pe_name)), Dict{Symbol,Any}(), "$pe_name failed to load.", true, Symbol[], Symbol[]) end end -function clear_disc_store(ssi::SymbolServerInstance) +function clear_disk_store(ssi::SymbolServerInstance) for f in readdir(ssi.store_path) if occursin(f, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") rm(joinpath(ssi.store_path, f), recursive = true) diff --git a/src/symbols.jl b/src/symbols.jl index f3544897..18977fbe 100644 --- a/src/symbols.jl +++ b/src/symbols.jl @@ -177,7 +177,7 @@ function cache_methods(@nospecialize(f), name, env, get_return_type) # Get inferred method return type if get_return_type sparams = Core.svec(sparam_syms(m[3])...) - rt = try + rt = try @static if isdefined(Core.Compiler, :NativeInterpreter) Core.Compiler.typeinf_type(Core.Compiler.NativeInterpreter(), m[3], m[3].sig, sparams) else @@ -472,8 +472,7 @@ function load_core(; get_return_type = false) symbols(cache, get_return_type = get_return_type) cache[:Main] = ModuleStore(VarRef(nothing, :Main), Dict(), "", true, [], []) - # This is wrong. As per the docs the Base.include each module should have it's own - # version. + # This is wrong. As per the docs the Base.include each module should have its own version. push!(cache[:Base].exportednames, :include) # Add special cases for built-ins diff --git a/src/utils.jl b/src/utils.jl index 9663c288..4ee5ce7f 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -531,11 +531,11 @@ function get_file_from_cloud(manifest, uuid, environment_path, depot_dir, cache_ end """ - validate_disc_store(store_path, manifest) + validate_disk_store(store_path, manifest) -This returns a list of non-jll packages in the manifest that don't have caches on disc. +This returns a list of non-jll packages in the manifest that don't have caches on disk. """ -function validate_disc_store(store_path, manifest) +function validate_disk_store(store_path, manifest) filter(manifest) do pkg uuid = packageuuid(pkg) endswith(packagename(manifest, uuid), "_jll") && return false @@ -637,7 +637,7 @@ end function write_cache(uuid, pkg::Package, outpath) mkpath(dirname(outpath)) - @info "Now writing to disc $uuid" + @info "Now writing to disk $uuid" open(outpath, "w") do io CacheStore.write(io, pkg) end diff --git a/test/runtests.jl b/test/runtests.jl index 118ba020..74e4de0e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -127,7 +127,7 @@ end @test haskey(store2, :Markdown) @test haskey(store2, :TableTraits) - SymbolServer.clear_disc_store(ssi) + SymbolServer.clear_disk_store(ssi) @test length(readdir(store_path)) == 0 end