#190 feat: get_symbol_server

Open Amin Yahyaabadi aminya
Coverage Reach

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 1 files from the diff.

@@ -1,6 +1,6 @@
Loading
1 1
module SymbolServer
2 2
3 -
export SymbolServerInstance, getstore
3 +
export SymbolServerInstance, getstore, get_symbol_server
4 4
5 5
using Serialization, Pkg, SHA
6 6
using Base: UUID, Process
@@ -202,6 +202,36 @@
Loading
202 202
203 203
const stdlibs = load_core()
204 204
205 +
206 +
VersionFloat(v::VersionNumber) = join(split(string(v),'.')[1:2],'.')
207 +
208 +
global_env_path = joinpath(homedir(),".julia/environments/v$(VersionFloat(VERSION))")
209 +
210 +
"""
211 +
    symbol_server, symbol_extends = get_symbol_server(module_sym::Vector{Symbol}, env_path = global_env_path)
212 +
    symbol_server, symbol_extends = get_symbol_server(module_sym::Symbol)
213 +
    symbol_server, symbol_extends = get_symbol_server(module_sym::Nothing = nothing)
214 +
215 +
Get symbols for the given module or current environment
216 +
"""
217 +
function get_symbol_server(module_sym::Vector{Symbol}, env_path = global_env_path)
218 +
    # TODO write these to a file
219 +
    printstyled("Getting the symbols. Please wait....", color = :yellow)
220 +
    env = SymbolServer.getenvtree(module_sym)
221 +
    # symbol_server = SymbolServer.symbols(env)
222 +
    symbol_server = getstore(SymbolServerInstance(env_path), env_path)[2]
223 +
    symbol_extends =  SymbolServer.collect_extended_methods(env)
224 +
    return symbol_server, symbol_extends
225 +
end
226 +
227 +
get_symbol_server(module_sym::Symbol) = get_symbol_server([module_sym])
228 +
229 +
function get_symbol_server(module_sym::Nothing = nothing)
230 +
    symbol_server = SymbolServer.stdlibs
231 +
    symbol_extends =  SymbolServer.collect_extended_methods(SymbolServer.stdlibs)
232 +
    return symbol_server, symbol_extends
233 +
end
234 +
205 235
function _precompile_()
206 236
    ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
207 237
    Base.precompile(Tuple{Type{SymbolServer.DataTypeStore},SymbolServer.FakeTypeName,SymbolServer.FakeTypeName,Array{Any,1},Array{Any,1},Array{Symbol,1},Array{Any,1},String,Bool})

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src -1.01% 70.16%
Project Totals (5 files) 70.16%
Loading