LanguageServer.jl
LanguageServer.jl copied to clipboard
recognize `Core.Compiler` module
Currently LS can't recognize the module context of Core.Compiler.
This might be because Core.Compiler is defined in a way that is really not standard (using eval),
https://github.com/JuliaLang/julia/blob/4c3829d413a12c2b4a87952e0f6d1ecbbff63239/base/compiler/compiler.jl#L3:
getfield(Core, :eval)(Core, :(baremodule Compiler
, and also its include calls don't follow usual relative path assumption
https://github.com/JuliaLang/julia/blob/4c3829d413a12c2b4a87952e0f6d1ecbbff63239/base/compiler/compiler.jl#L118-L140
include("compiler/cicache.jl")
include("compiler/types.jl")
include("compiler/utilities.jl")
include("compiler/validation.jl")
include("compiler/methodtable.jl")
include("compiler/inferenceresult.jl")
include("compiler/inferencestate.jl")
include("compiler/typeutils.jl")
include("compiler/typelimits.jl")
include("compiler/typelattice.jl")
include("compiler/tfuncs.jl")
include("compiler/stmtinfo.jl")
include("compiler/abstractinterpretation.jl")
include("compiler/typeinfer.jl")
include("compiler/optimize.jl") # TODO: break this up further + extract utilities
include("compiler/bootstrap.jl")
ccall(:jl_set_typeinf_func, Cvoid, (Any,), typeinf_ext_toplevel)
include("compiler/parsing.jl")
In Juno, we handle it by special casing it like:
https://github.com/JunoLab/Atom.jl/blob/b86272409d8902ce6ff32d31db3f1b886efc1e1b/src/modules.jl#L295
if occursin(basepath("compiler"), path)