Giter Club home page Giter Club logo

symbolserver.jl's Introduction

SymbolServer

Dev Project Status: Active – The project has reached a stable, usable state and is being actively developed. codecov.io

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.

Installation and Usage

using Pkg
Pkg.add("SymbolServer")
using SymbolServer

Documentation: Dev

Documentation for working with Julia environments is available here.

API

SymbolServerInstance(path_to_depot, path_to_store)

Creates a new symbol server instance that works on a given Julia depot. This symbol server instance can be long lived, i.e. one can re-use it for different environments etc. If path_to_store is specified, cache files will be stored there, otherwise a standard location will be used.

getstore(ssi::SymbolServerInstance, environment_path::AbstractString)

Loads the symbols for the environment in environment_path. Returns a tuple, where the first element is a return status and the second element a payload. The status can be :success (in which case the second element is the new store), :canceled if another call to getstore was initiated before a previous one finished (with nothing as the payload), or :failure with the payload being the content of the error stream of the client process.

This function is long running and should typically be called in an @async block.

Development of the VSCode extension

See https://github.com/julia-vscode/julia-vscode/wiki for information on how to test this package with the VSCode extension

symbolserver.jl's People

Contributors

aminya avatar ashymad avatar aviatesk avatar benph avatar brychcy avatar cnliao avatar davidanthoff avatar fredrikekre avatar github-actions[bot] avatar ianbutterworth avatar liozou avatar miguelraz avatar mind6 avatar mkitti avatar non-jedi avatar pfitzseb avatar quinnj avatar simeonschaub avatar timholy avatar tpgillam avatar tribut avatar ulysses4ever avatar zacln avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

symbolserver.jl's Issues

Extension crashes due to R_HOME environment variable

This issue is encountered with 0.13.0-rc4 and Julia 1.3 (0.12.3 also has the same issue). The language server gives this error:

ERROR: LoadError: EOFError: read end of file

stderr from client process:

R_HOME must be set in the environment or Registry

However R_HOME is correctly set in the environment. Not sure why the extension cannot see it, or if there's something else causing the error.

Full language server output:

[ Info: Started symbol server
[ Info: loading dependency Dates
[ Info: loading dependency Printf
[ Info: loading dependency Unicode
[ Info: loading dependency FilePathsBase
[ Info: loading dependency LinearAlgebra
[ Info: loading dependency Libdl
[ Info: loading dependency Test
[ Info: loading dependency InteractiveUtils
[ Info: loading dependency Markdown
[ Info: loading dependency Base64
[ Info: loading dependency Random
[ Info: loading dependency Serialization
[ Info: loading dependency Logging
[ Info: loading dependency Distributed
[ Info: loading dependency Sockets
[ Info: loading dependency UUIDs
[ Info: loading dependency SHA
[ Info: loading dependency Tables
[ Info: loading dependency DataAPI
[ Info: loading dependency IteratorInterfaceExtensions
[ Info: loading dependency DataValueInterfaces
[ Info: loading dependency TableTraits
[ Info: loading dependency WeakRefStrings
[ Info: loading dependency DataFrames
[ Info: loading dependency Statistics
[ Info: loading dependency SparseArrays
[ Info: loading dependency SortingAlgorithms
[ Info: loading dependency DataStructures
[ Info: loading dependency OrderedCollections
[ Info: loading dependency PooledArrays
[ Info: loading dependency REPL
[ Info: loading dependency InvertedIndices
[ Info: loading dependency Missings
[ Info: loading dependency Compat
[ Info: loading dependency Pkg
[ Info: loading dependency LibGit2
[ Info: loading dependency Mmap
[ Info: loading dependency DelimitedFiles
[ Info: loading dependency SharedArrays
[ Info: loading dependency CategoricalArrays
[ Info: loading dependency JSON
[ Info: loading dependency Future
[ Info: loading dependency Reexport
[ Info: loading dependency Parsers
[ Info: loading dependency Unitful
[ Info: loading dependency ConstructionBase
[ Info: loading dependency Roots
[ Info: loading dependency Measurements
[ Info: loading dependency RecipesBase
[ Info: loading dependency Calculus
[ Info: loading dependency Requires
[ Info: loading dependency LoweredCodeUtils
[ Info: loading dependency JuliaInterpreter
[ Info: loading dependency CodeTracking
[ Info: loading dependency FileWatching
[ Info: loading dependency Juno
[ Info: loading dependency Profile
[ Info: loading dependency Media
[ Info: loading dependency MacroTools
[ Info: loading dependency CSTParser
[ Info: loading dependency Tokenize
[ Info: loading dependency HTTP
[ Info: loading dependency IniFile
[ Info: loading dependency MbedTLS
[ Info: loading dependency BinaryProvider
[ Info: loading dependency Hiccup
[ Info: loading dependency Lazy
[ Info: loading dependency TreeViews
[ Info: loading dependency Traceur
[ Info: loading dependency Cassette
[ Info: loading dependency DocSeeker
[ Info: loading dependency StringDistances
[ Info: loading dependency Distances
[ Info: loading dependency URIParser
[ Info: loading dependency LNR
[ Info: loading dependency CodeTools
[ Info: loading dependency JuliaFormatter
[ Info: loading dependency WebSockets
[ Info: loading dependency WebIO
[ Info: loading dependency Observables
[ Info: loading dependency AssetRegistry
[ Info: loading dependency Pidfile
[ Info: loading dependency Widgets
[ Info: loading dependency Colors
[ Info: loading dependency ColorTypes
[ Info: loading dependency FixedPointNumbers
[ Info: loading dependency FunctionalCollections
[ Info: loading dependency Conda
[ Info: loading dependency VersionParsing
[ Info: loading dependency SoftGlobalScope
[ Info: loading dependency ZMQ
[ Info: RCall not stored on disc
[ Info: Language Server crashed with
[ Info: ErrorException("EOFError: read end of file\n\nstderr from client process:\n\nR_HOME must be set in the environment or Registry\n")
ERROR: LoadError: EOFError: read end of file

stderr from client process:

R_HOME must be set in the environment or Registry

Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] request(::SymbolServerProcess, ::Symbol, ::Array{String,1}) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:68
 [3] cache_package(::SymbolServerProcess, ::Array{Base.UUID,1}) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:235
 [4] cache_package at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:229 [inlined]
 [5] load_package_cache(::SymbolServerProcess, ::Base.UUID) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:173
 [6] load_project_packages(::SymbolServerProcess) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:95
 [7] getstore at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:101 [inlined]
 [8] init_symserver(::LanguageServerInstance) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl:81
 [9] run(::LanguageServerInstance) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl:92
 [10] top-level scope at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\main.jl:24
 [11] include at .\boot.jl:328 [inlined]
 [12] include_relative(::Module, ::String) at .\loading.jl:1105
 [13] include(::Module, ::String) at .\Base.jl:31
 [14] exec_options(::Base.JLOptions) at .\client.jl:287
 [15] _start() at .\client.jl:460
in expression starting at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\main.jl:7
caused by [exception 1]
EOFError: read end of file
Stacktrace:
 [1] read(::Base.PipeEndpoint, ::Type{UInt8}) at .\stream.jl:868
 [2] read(::Base.Process, ::Type{UInt8}) at .\io.jl:314
 [3] deserialize at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Serialization\src\Serialization.jl:722 [inlined]
 [4] deserialize(::Base.Process) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Serialization\src\Serialization.jl:709
 [5] request(::SymbolServerProcess, ::Symbol, ::Array{String,1}) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:60
 [6] cache_package(::SymbolServerProcess, ::Array{Base.UUID,1}) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:235
 [7] cache_package at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:229 [inlined]
 [8] load_package_cache(::SymbolServerProcess, ::Base.UUID) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:173
 [9] load_project_packages(::SymbolServerProcess) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:95
 [10] getstore at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:101 [inlined]
 [11] init_symserver(::LanguageServerInstance) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl:81
 [12] run(::LanguageServerInstance) at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl:92
 [13] top-level scope at c:\Users\invis\.vscode\extensions\julialang.language-julia-0.13.0-rc.4\scripts\languageserver\main.jl:24
 [14] include at .\boot.jl:328 [inlined]
 [15] include_relative(::Module, ::String) at .\loading.jl:1105
 [16] include(::Module, ::String) at .\Base.jl:31
 [17] exec_options(::Base.JLOptions) at .\client.jl:287
 [18] _start() at .\client.jl:460
[Info  - 下午10:13:47] Connection to server got closed. Server will restart.

Versioninfo:

julia> versioninfo()
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)       
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  WORD_SIZE: 64    
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = "C:\Program Files\Microsoft VS Code\Code.exe"

Why are we activating environments from inside the symbol server process?

Like here? I thought the idea is that we start the symbol server with the right project active from the get go, and then can extract everything without needing to change the active project from inside the symbol server? I think changing the active project like this introduces all sorts of problems: 1) we might already have a package loaded, in the new env it might ask for a different version, 2) we'll lose all package version specifications from the original env etc. I think in general changing active projects after any package is already loaded is a pretty unsafe operation because one ends up in a pretty weird state in terms of package versions.

LoadError: type UnionAll has no field name

From insider crash reporting, new since the large changes from a couple of days ago.

Msg: LoadError: type UnionAll has no field name

Stack trace:

[ Info: Now caching package Sockets (6462fe0b-24de-5631-8697-dd941f90decc)
ERROR: LoadError: type UnionAll has no field name
Stacktrace:
 [1] getproperty(::Type, ::Symbol) at ./Base.jl:15
 [2] getkws(::Method) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:140
 [3] cache_methods(::Type, ::Module, ::Bool) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:122
 [4] cache_methods(::Type, ::Module) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:94
 [5] (::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore})(::Type) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:203
 [6] apply_to_everything(::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore}, ::Module, ::Base.IdSet{Module}) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:154
 [7] apply_to_everything(::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore}, ::Nothing, ::Base.IdSet{Module}) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:161
 [8] apply_to_everything at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:149 [inlined]
 [9] cache_module(::Module, ::Main.SymbolServer.VarRef, ::Array{Symbol,1}, ::Bool) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:192
 [10] cache_module at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:168 [inlined]
 [11] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::Base.PipeEndpoint) at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/symbols.jl:310
 [12] top-level scope at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/server.jl:100
 [13] include at ./boot.jl:328 [inlined]
 [14] include_relative(::Module, ::String) at ./loading.jl:1105
 [15] include(::Module, ::String) at ./Base.jl:31
 [16] exec_options(::Base.JLOptions) at ./client.jl:287
 [17] _start() at ./client.jl:460
in expression starting at /Users/XXX/.vscode/extensions/julialang.language-julia-insider-0.15.21/scripts/languageserver/packages/SymbolServer/src/server.jl:70
 

Language server crashes (ERROR: LoadError: Invalid response:)

I am running into the issue below. Any ideas how I can fix this? (or further investigate this).
The server crashes all the time (when I use VS Code)

[ Info: Started symbol server
[ Info: Executing .juliarc.jl...
[ Info: Language Server crashed with
[ Info: ErrorException("Invalid response:\ntrue")
[ Info: done.
ERROR: LoadError: Invalid response:
true
Stacktrace:
 [1] error(::String, ::Bool) at .\error.jl:42
 [2] request(::SymbolServerProcess, ::Symbol, ::Nothing) at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:40
 [3] get_installed_packages_in_env(::SymbolServerProcess) at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:108
 [4] getstore(::SymbolServerProcess) at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl:67
 [5] run(::LanguageServerInstance) at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl:34
 [6] top-level scope at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\main.jl:26 [inlined]
 [7] top-level scope at .\none:0
 [8] include at .\boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at .\loading.jl:1044
 [10] include(::Module, ::String) at .\sysimg.jl:29
 [11] exec_options(::Base.JLOptions) at .\client.jl:266
 [12] _start() at .\client.jl:425
in expression starting at c:\Users\myusername\.vscode\extensions\julialang.language-julia-0.11.6\scripts\languageserver\main.jl:5
[Info  - 11:30:53] Connection to server got closed. Server will restart.
[ Info: Started symbol server
[ Info: Executing .juliarc.jl...
[ Info: Language Server crashed with
[ Info: ErrorException("Invalid response:\ntrue")
[ Info: done.
ERROR: LoadError: Invalid response:
true

SymbolServer.getstore waiting

julia> using LanguageServer
julia> serve=LanguageServerInstance(stdin,stdout,true,"C:\\Users\\zh\\.julia\\environments\\v1.1","",Dict())
Root: Set(String[])

julia> run(serve)
[ Info: Started symbol server

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x43a2ffc11 -- jl_excstack_state at /home/Administrator/buildbot/worker/package_win64/build/src\rtutils.c:287
in expression starting at C:\Users\zh\.julia\packages\SymbolServer\brsKC\src\clientprocess\clientprocess_main.jl:12
ERROR: InterruptException:
Stacktrace:
 [1] process_events at .\libuv.jl:98 [inlined]
 [2] wait() at .\event.jl:246
 [3] wait(::Condition) at .\event.jl:46
 [4] wait_readnb(::Base.PipeEndpoint, ::Int64) at .\stream.jl:368
 [5] read(::Base.PipeEndpoint, ::Type{UInt8}) at .\stream.jl:822
 [6] read(::Base.Process, ::Type{UInt8}) at .\io.jl:229
 [7] deserialize at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:731 [inlined]
 [8] deserialize(::Base.Process) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Serialization\src\Serialization.jl:718
 [9] request(::SymbolServerProcess, ::Symbol, ::Pair{String,Base.UUID}) at C:\Users\zh\.julia\packages\SymbolServer\brsKC\src\SymbolServer.jl:39
 [10] load_package(::SymbolServerProcess, ::Pair{String,Base.UUID}) at C:\Users\zh\.julia\packages\SymbolServer\brsKC\src\SymbolServer.jl:126
 [11] getstore(::SymbolServerProcess) at C:\Users\zh\.julia\packages\SymbolServer\brsKC\src\SymbolServer.jl:74
 [12] run(::LanguageServerInstance) at C:\Users\zh\.julia\packages\LanguageServer\GNDpW\src\languageserverinstance.jl:34
 [13] top-level scope at none:0

image

version Julia 1.1.0
Windows 10 [10.0.17763.379]

(v1.1) pkg> status
  [2b0e0bc5] LanguageServer v0.5.1
  [b3cc710f] StaticLint v0.1.1
  [cf896787] SymbolServer v0.1.2

Warning: XYZ not stored on disc

The linter is underlying every function/type in my package and so I started looking for errors in the log. From the Julia Language Server window in the Output tab, I found the following:

[ Info: Starting the Julia Language Server
┌ Warning: MacroTools not stored on disc
└ @ SymbolServer ~/.vscode-server/extensions/julialang.language-julia-0.15.18/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:164
┌ Warning: MacroTools not stored on disc
└ @ SymbolServer ~/.vscode-server/extensions/julialang.language-julia-0.15.18/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:164
[ Info: Received new data from Julia Symbol Server.

From another project, I found the following:

[ Info: Starting the Julia Language Server
┌ Warning: EzXML not stored on disc
│   cache_path = "/home/tkwong/.vscode-server/extensions/julialang.language-julia-0.15.18/scripts/languageserver/packages/SymbolServer/store/Julia-1.4.0-x86_64--normal-0fa3b52a04a4e210aeb1626def9c90df3ae65268.jstore"
└ @ SymbolServer ~/.vscode-server/extensions/julialang.language-julia-0.15.18/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:164
[ Info: Received new data from Julia Symbol Server.

Note that I monkey-patched the @warn statement with cache_path so I can see what it's looking for although I don't know how to make sense out of it.

The funny thing is that the linter seems to be problematic for some files but not all of them. It's like half of the symbols are lost.

My versions:

Version: 1.43.2 (user setup)
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:38:38.248Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.17134

Julia version:

julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) Gold 6144 CPU @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_HOME = /home/tkwong/Apps/julia-1.4.0
  JULIA_EDITOR = "/home/tkwong/.vscode-server/bin/0ba0ca52957102ca3527cf479571617f0de6ed50/node"
  JULIA_NUM_THREADS = 1

"SymbolServer not defined" error when called within different module

When SymbolServer is used within a module that imports SymbolServer, by a different module that does not import SymbolServer, SymbolServer is stuck on an infinite loop, re-caching packages. If we rethrow the exception on SymbolServer.jl, we can see that it always throws UndefVarError: SymbolServer not defined, unless we import SymbolServer into the calling module. This can be reproduced with the following code:

module Foo

using SymbolServer

function bar()
    sserver = SymbolServerProcess()
    SymbolServer.getstore(sserver)
end

end

Foo.bar()

If we add using SymbolServer outside the Foo module, we get the expected behavior, and all packages are succesfully cached and loaded:

using SymbolServer

module Foo

using SymbolServer

function bar()
    sserver = SymbolServerProcess()
    SymbolServer.getstore(sserver)
end

end

Foo.bar()

Cache `Base` and `Core`

I don't think they are being cached right now, I think they are being regenerated each time... Not entirely sure, though.

ErrorException

error(::String, ::Symbol)

ErrorException:
   at error(::String, ::Symbol) (error.jl42)
   at request(::SymbolServerProcess, ::Symbol, ::Nothing) (.\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl42)
   at get_context(::SymbolServerProcess) (.\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl47)
   at (::getfield(SymbolServer, Symbol("##SymbolServerProcess#3#4")))(::String, ::String, ::Type) (.\scripts\languageserver\packages\SymbolServer\src\SymbolServer.jl34)
   at Type (none)
   at run(::LanguageServerInstance) (.\scripts\languageserver\packages\LanguageServer\src\languageserverinstance.jl32)
   at top-level scope (.\scripts\languageserver\main.jl22)
   at top-level scope (none)
   at include (boot.jl317)
   at include_relative(::Module, ::String) (loading.jl1044)
   at include(::Module, ::String) (sysimg.jl29)
   at exec_options(::Base.JLOptions) (client.jl266)
   at _start() (client.jl425)

MOI makes LanguageServer crash

When I open VS Code in a Julia environment that included MathOptInterface, the language server crashes with this error:

[ Info: ErrorException("EOFError: read end of file\n\nstderr from client process:\n\nERROR: LoadError: MethodError: no method matching namemap(::Type{MathOptInterface.ActivationCondition})\nThe applicable method may be too new: running in world age 26094, while current world is 26102.\nClosest candidates are:\n  namemap(::Type{MathOptInterface.ActivationCondition}) at Enums.jl:189 (method too new to be called from this world context.)\n  namemap(!Matched::Type{Base.MPFR.MPFRRoundingMode}) at Enums.jl:189\n  namemap(!Matched::Type{LibGit2.Consts.OBJECT}) at Enums.jl:189\n  ...\nStacktrace:\n [1] Symbol(::MathOptInterface.ActivationCondition) at ./Enums.jl:26\n [2] show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::MathOptInterface.ActivationCondition) at ./Enums.jl:31\n [3] show_datatype(::Base.GenericIOBuffer{Array{UInt8,1}}, ::DataType) at ./show.jl:547\n [4] show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type) at ./show.jl:428\n [5] show_datatype(::Base.GenericIOBuffer{Array{UInt8,1}}, ::DataType) at ./show.jl:547\n [6] show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type) at ./show.jl:428\n [7] print(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type) at ./strings/io.jl:37\n [8] print_to_string(::Type) at ./strings/io.jl:129\n [9] string(::Type) at ./strings/io.jl:168\n [10] _broadcast_getindex_evalf at ./broadcast.jl:625 [inlined]\n [11] _broadcast_getindex at ./broadcast.jl:598 [inlined]\n [12] getindex at ./broadcast.jl:558 [inlined]\n [13] copyto_nonleaf!(::Array{String,1}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(string),Tuple{Base.Broadcast.Extruded{Array{Any,1},Tuple{Bool},Tuple{Int64}}}}, ::Base.OneTo{Int64}, ::Int64, ::Int64) at ./broadcast.jl:982\n [14] copy at ./broadcast.jl:836 [inlined]\n [15] materialize at ./broadcast.jl:798 [inlined]\n [16] get_module_names(::Module, ::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Main.SymbolServer.ModuleStore, ::Pkg.Types.Context) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:159\n [17] get_module_names(::Module, ::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Main.SymbolServer.ModuleStore, ::Pkg.Types.Context) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:170 (repeats 2 times)\n [18] import_package_names(::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Pkg.Types.Context, ::Module) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:129\n [19] get_module_names(::Module, ::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Main.SymbolServer.ModuleStore, ::Pkg.Types.Context) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:183\n [20] import_package_names(::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Pkg.Types.Context, ::Nothing) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:129\n [21] import_package_names(::Main.SymbolServer.PackageID, ::Dict{String,Any}, ::Pkg.Types.Context) at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/from_static_lint.jl:107\n [22] top-level scope at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/clientprocess_main.jl:34\n [23] include at ./boot.jl:328 [inlined]\n [24] include_relative(::Module, ::String) at ./loading.jl:1094\n [25] include(::Module, ::String) at ./Base.jl:31\n [26] exec_options(::Base.JLOptions) at ./client.jl:295\n [27] _start() at ./client.jl:464\nin expression starting at /Users/jdlara/.vscode/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/clientprocess/clientprocess_main.jl:18\n")
ERROR: LoadError: EOFError: read end of file

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

LoadError: MethodError: no method matching parentmodule(::Nothing)

From crash reporting.

Error message:

[ Info: Package CSV (336ed68f-0bac-5ca0-87d4-7b16caf5d00b) is cached.
[ Info: Now caching package TextAnalysis (a2db99b7-8b79-58f8-94bf-bbc811eef33d)
ERROR: LoadError: MethodError: no method matching parentmodule(::Nothing)
Closest candidates are:
  parentmodule(::Any, !Matched::Any) at reflection.jl:1183
  parentmodule(!Matched::Module) at reflection.jl:32
  parentmodule(!Matched::DataType) at reflection.jl:232
  ...
Stacktrace:
 [1] get_module(::Module, ::Set{String}) at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.13/scripts/languageserver/packages/SymbolServer/src/symbols.jl:244
 [2] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.13/scripts/languageserver/packages/SymbolServer/src/symbols.jl:275
 [3] top-level scope at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.13/scripts/languageserver/packages/SymbolServer/src/server.jl:73
 [4] include at ./boot.jl:328 [inlined]
 [5] include_relative(::Module, ::String) at ./loading.jl:1105
 [6] include(::Module, ::String) at ./Base.jl:31
 [7] exec_options(::Base.JLOptions) at ./client.jl:287
 [8] _start() at ./client.jl:460
in expression starting at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.13/scripts/languageserver/packages/SymbolServer/src/server.jl:44 

TypeError in get_fieldtypes causes language server to crash

Ran into the following issue with julia-vscode:

ERROR: LoadError: TypeError: in TypeVar, in upper bound, expected Type, got Vararg
Stacktrace:
 [1] _broadcast_getindex_evalf at ./broadcast.jl:630 [inlined]
 [2] _broadcast_getindex at ./broadcast.jl:603 [inlined]
 [3] getindex at ./broadcast.jl:563 [inlined]
 [4] copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},Type{Main.SymbolServer.TypeRef},Tuple{Array{Any,1}}}) at ./broadcast.jl:853
 [5] materialize at ./broadcast.jl:819 [inlined]
 [6] get_fieldtypes(::DataType) at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/utils.jl:227
 [7] get_module(::Module, ::Set{String}) at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/symbols.jl:224
 [8] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/symbols.jl:278
 [9] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/symbols.jl:284 (repeats 2 times)
 [10] top-level scope at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/server.jl:64
 [11] include at ./boot.jl:328 [inlined]
 [12] include_relative(::Module, ::String) at ./loading.jl:1105
 [13] include(::Module, ::String) at ./Base.jl:31
 [14] exec_options(::Base.JLOptions) at ./client.jl:287
 [15] _start() at ./client.jl:460
in expression starting at /home/colinxs/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/server.jl:44

I was concerned this may be from an error in my code so tracked it down. Here's a minimal reproduction:

struct PackageRef{N}
    name::NTuple{N,String}
end

struct TypeRef{N}
    name::String
    mod::PackageRef{N}
end

function get_fieldtypes(t::DataType)
    !isempty(Base.datatype_fieldtypes(t)) ? TypeRef.(collect(Base.datatype_fieldtypes(t))) : TypeRef[]
end
function collect_params(t, params = [])
    if t isa UnionAll
        push!(params, t.var)
        return collect_params(t.body, params)
    else
        return t, params
    end
end

function get_module(m::Module)
    allnames = names(m, all = true, imported = true)
    for n in allnames
        !isdefined(m, n) && continue
        startswith(string(n), "#") && continue
        if Base.isdeprecated(m, n)
        else
            x = getfield(m, n)
            t, p = collect_params(x)
            if t isa DataType
                get_fieldtypes(t)
            end
        end
    end
end

module Foo
    const Many{T} = Tuple{Vararg{T}}
end

get_module(Foo)

EOFError

EOFError:
   at read (iobuffer.jl207)
   at read(::Base.PipeEndpoint, ::Type{UInt8}) (stream.jl825)
   at read(::Base.Process, ::Type{UInt8}) (io.jl229)
   at deserialize (Serialization.jl731)
   at deserialize(::Base.Process) (Serialization.jl718)
   at request(::SymbolServerProcess, ::Symbol, ::Tuple{String,String}) (./scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl41)
   at load_package(::SymbolServerProcess, ::SymbolServer.PackageID) (./scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl138)
   at safe_load_store(::SymbolServer.PackageID, ::SymbolServerProcess, ::Bool) (./scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl92)
   at safe_load_store (./scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl73)
   at getstore(::SymbolServerProcess) (./scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl119)
   at run(::LanguageServerInstance) (./scripts/languageserver/packages/LanguageServer/src/languageserverinstance.jl35)
   at top-level scope (./scripts/languageserver/main.jl22)
   at include (boot.jl326)
   at include_relative(::Module, ::String) (loading.jl1038)
   at include(::Module, ::String) (sysimg.jl29)
   at exec_options(::Base.JLOptions) (client.jl267)
   at _start() (client.jl436)

Only load packages that are really needed

Right now symbol server loads every package that is in the environment and caches that. I think we should instead move to a model where StaticLint.jl tells SymbolServer.jl for which packages it actually needs symbol info, and then only those would be loaded/cached by SymbolServer.jl in a given session.

Very slow startup when packages aren't yet cached

As an example, I'm still waiting for the symbol server store to be set with https://github.com/non-Jedi/ChemicalEngineeringToolbox.jl/blob/master/Project.toml after something like 15 minutes. I'm assuming that generating the ".jstore" files is just a very slow process? It doesn't seem to be jit startup time because I'm getting every couple minutes a new [ Info: Interpolations not stored on disc, so it must be that the operation is just slow no matter what.

Don't cache by UUID

To work properly with environments, we need to store a distinct cache for different versions of the same package. I would suggest that we use git-tree-sha1 instead, that should be unique for each package version.

Not sure what to do about deved packages in an env. We can't get the git-tree-sha1 from the manifest, I think, so maybe we have to just compute it ourselves from the folder on disc? Or maybe we don't cache deved packages at all? In general we'll have to be clever about those, we probably should also add file system watcher on these folders to detect updates in them that trigger a new symbol extraction run. But I'd say we can do that later.

I would also suggest that we include the Julia version and arch in the cached file name, so that folks that switch between different Julia versions get separated caches.

How to handle the test folder

Maybe more an issue for LS actually, but I think in general we need to come up with a plan what we do about the test folder.

I think fundamentally we should think of the code in the test folder as running in a different environment than the rest of the code, namely in a synthetic environment that is the union of the normal + test environment. Maybe the way to handle this is in the LS have two symbol stores, one for the "normal" code, one for the "test" folder. Then also have two instances of symbol server, And have them just return a symbol store for both.

The env for the test folder doesn't really exist on disc, so we'll have to create that from a merge from the default and test stuff. I think we might be able to reuse the code from the test runner in Pkg.jl for that.

I'd say we can solve this whole problem once we have the load times under control, i.e. next version :)

Infinite "Tried to load PackageNames from disc, re-caching" loop

After caches were finally created for the packages in #56, SymbolServer entered an infinite loop of [ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching. with a bunch of different packages. Logs before I Ctrl-ced it:

julia> using LanguageServer

julia> server = LanguageServer.LanguageServerInstance(stdin, stdout, false, "/home/adam/repos/ChemicalEngineeringToolbox.jl/", "", Dict())
Root: Set(String[])

julia> run(server)
[ Info: Started symbol server
[ Info: Unitful not stored on disc
[ Info: StaticArrays not stored on disc
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: UnitfulUS not stored on disc
[ Info: DelimitedFiles not stored on disc
[ Info: ModelingToolkit not stored on disc
[ Info: Interpolations not stored on disc
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load InteractiveUtils but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load Markdown but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Distributed but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Base64 but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load InteractiveUtils but failed to load from disc, re-caching.
[ Info: Tried to load DelimitedFiles but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load Markdown but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Distributed but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Mmap but failed to load from disc, re-caching.
[ Info: Tried to load Base64 but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load MuladdMacro but failed to load from disc, re-caching.
[ Info: Tried to load NaNMath but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load DelimitedFiles but failed to load from disc, re-caching.
[ Info: Tried to load DataStructures but failed to load from disc, re-caching.
[ Info: Tried to load BinDeps but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Compat but failed to load from disc, re-caching.
[ Info: Tried to load URIParser but failed to load from disc, re-caching.
[ Info: Tried to load CanonicalTraits but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqBase but failed to load from disc, re-caching.
[ Info: Tried to load ArrayInterface but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Pkg but failed to load from disc, re-caching.
[ Info: Tried to load Printf but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqDiffTools but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load TableTraits but failed to load from disc, re-caching.
[ Info: Tried to load IteratorInterfaceExtensions but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Dates but failed to load from disc, re-caching.
[ Info: Tried to load Tokenize but failed to load from disc, re-caching.
[ Info: Tried to load MacroTools but failed to load from disc, re-caching.
[ Info: Tried to load Parameters but failed to load from disc, re-caching.
[ Info: Tried to load LibGit2 but failed to load from disc, re-caching.
[ Info: Tried to load Roots but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load DocStringExtensions but failed to load from disc, re-caching.
[ Info: Tried to load Mmap but failed to load from disc, re-caching.
[ Info: Tried to load TreeViews but failed to load from disc, re-caching.
[ Info: Tried to load JuliaVariables but failed to load from disc, re-caching.
[ Info: Tried to load RecipesBase but failed to load from disc, re-caching.
[ Info: Tried to load SuiteSparse but failed to load from disc, re-caching.
[ Info: Tried to load DiffRules but failed to load from disc, re-caching.
[ Info: Tried to load ModelingToolkit but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load SharedArrays but failed to load from disc, re-caching.
[ Info: Tried to load SpecialFunctions but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveArrayTools but failed to load from disc, re-caching.
[ Info: Tried to load REPL but failed to load from disc, re-caching.
[ Info: Tried to load IterativeSolvers but failed to load from disc, re-caching.
[ Info: Tried to load Unicode but failed to load from disc, re-caching.
[ Info: Tried to load OrderedCollections but failed to load from disc, re-caching.
[ Info: Tried to load MLStyle but failed to load from disc, re-caching.
[ Info: Tried to load Requires but failed to load from disc, re-caching.
[ Info: Tried to load CSTParser but failed to load from disc, re-caching.
[ Info: Tried to load SHA but failed to load from disc, re-caching.
[ Info: Tried to load InteractiveUtils but failed to load from disc, re-caching.
[ Info: Tried to load Markdown but failed to load from disc, re-caching.
[ Info: Tried to load GeneralizedGenerated but failed to load from disc, re-caching.
[ Info: Tried to load Distributed but failed to load from disc, re-caching.
[ Info: Tried to load FunctionWrappers but failed to load from disc, re-caching.
[ Info: Tried to load UUIDs but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load NameResolution but failed to load from disc, re-caching.
[ Info: Tried to load LegibleLambdas but failed to load from disc, re-caching.
[ Info: Tried to load BinaryProvider but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Base64 but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveFactorization but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load MuladdMacro but failed to load from disc, re-caching.
[ Info: Tried to load NaNMath but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load DelimitedFiles but failed to load from disc, re-caching.
[ Info: Tried to load DataStructures but failed to load from disc, re-caching.
[ Info: Tried to load OffsetArrays but failed to load from disc, re-caching.
[ Info: Tried to load Interpolations but failed to load from disc, re-caching.
[ Info: Tried to load BinDeps but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Compat but failed to load from disc, re-caching.
[ Info: Tried to load URIParser but failed to load from disc, re-caching.
[ Info: Tried to load CanonicalTraits but failed to load from disc, re-caching.
[ Info: Tried to load AxisAlgorithms but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqBase but failed to load from disc, re-caching.
[ Info: Tried to load ArrayInterface but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Pkg but failed to load from disc, re-caching.
[ Info: Tried to load Printf but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqDiffTools but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load TableTraits but failed to load from disc, re-caching.
[ Info: Tried to load IteratorInterfaceExtensions but failed to load from disc, re-caching.
[ Info: Tried to load Ratios but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Dates but failed to load from disc, re-caching.
[ Info: Tried to load Tokenize but failed to load from disc, re-caching.
[ Info: Tried to load MacroTools but failed to load from disc, re-caching.
[ Info: Tried to load Parameters but failed to load from disc, re-caching.
[ Info: Tried to load LibGit2 but failed to load from disc, re-caching.
[ Info: Tried to load Roots but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load DocStringExtensions but failed to load from disc, re-caching.
[ Info: Tried to load WoodburyMatrices but failed to load from disc, re-caching.
[ Info: Tried to load Mmap but failed to load from disc, re-caching.
[ Info: Tried to load TreeViews but failed to load from disc, re-caching.
[ Info: Tried to load JuliaVariables but failed to load from disc, re-caching.
[ Info: Tried to load RecipesBase but failed to load from disc, re-caching.
[ Info: Tried to load SuiteSparse but failed to load from disc, re-caching.
[ Info: Tried to load DiffRules but failed to load from disc, re-caching.
[ Info: Tried to load ModelingToolkit but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load SharedArrays but failed to load from disc, re-caching.
[ Info: Tried to load SpecialFunctions but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveArrayTools but failed to load from disc, re-caching.
[ Info: Tried to load REPL but failed to load from disc, re-caching.
[ Info: Tried to load IterativeSolvers but failed to load from disc, re-caching.
[ Info: Tried to load Unicode but failed to load from disc, re-caching.
[ Info: Tried to load OrderedCollections but failed to load from disc, re-caching.
[ Info: Tried to load MLStyle but failed to load from disc, re-caching.
[ Info: Tried to load Requires but failed to load from disc, re-caching.
[ Info: Tried to load CSTParser but failed to load from disc, re-caching.
[ Info: Tried to load SHA but failed to load from disc, re-caching.
[ Info: Tried to load InteractiveUtils but failed to load from disc, re-caching.
[ Info: Tried to load Markdown but failed to load from disc, re-caching.
[ Info: Tried to load GeneralizedGenerated but failed to load from disc, re-caching.
[ Info: Tried to load Distributed but failed to load from disc, re-caching.
[ Info: Tried to load FunctionWrappers but failed to load from disc, re-caching.
[ Info: Tried to load UUIDs but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load NameResolution but failed to load from disc, re-caching.
[ Info: Tried to load LegibleLambdas but failed to load from disc, re-caching.
[ Info: Tried to load BinaryProvider but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Base64 but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveFactorization but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load MuladdMacro but failed to load from disc, re-caching.
[ Info: Tried to load NaNMath but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load DelimitedFiles but failed to load from disc, re-caching.
[ Info: Tried to load DataStructures but failed to load from disc, re-caching.
[ Info: Tried to load OffsetArrays but failed to load from disc, re-caching.
[ Info: Tried to load Interpolations but failed to load from disc, re-caching.
[ Info: Tried to load BinDeps but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Compat but failed to load from disc, re-caching.
[ Info: Tried to load URIParser but failed to load from disc, re-caching.
[ Info: Tried to load CanonicalTraits but failed to load from disc, re-caching.
[ Info: Tried to load AxisAlgorithms but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqBase but failed to load from disc, re-caching.
[ Info: Tried to load ArrayInterface but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Pkg but failed to load from disc, re-caching.
[ Info: Tried to load Printf but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqDiffTools but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load TableTraits but failed to load from disc, re-caching.
[ Info: Tried to load IteratorInterfaceExtensions but failed to load from disc, re-caching.
[ Info: Tried to load Ratios but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Dates but failed to load from disc, re-caching.
[ Info: Tried to load Tokenize but failed to load from disc, re-caching.
[ Info: Tried to load MacroTools but failed to load from disc, re-caching.
[ Info: Tried to load Parameters but failed to load from disc, re-caching.
[ Info: Tried to load LibGit2 but failed to load from disc, re-caching.
[ Info: Tried to load Roots but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load DocStringExtensions but failed to load from disc, re-caching.
[ Info: Tried to load WoodburyMatrices but failed to load from disc, re-caching.
[ Info: Tried to load Mmap but failed to load from disc, re-caching.
[ Info: Tried to load TreeViews but failed to load from disc, re-caching.
[ Info: Tried to load JuliaVariables but failed to load from disc, re-caching.
[ Info: Tried to load RecipesBase but failed to load from disc, re-caching.
[ Info: Tried to load SuiteSparse but failed to load from disc, re-caching.
[ Info: Tried to load DiffRules but failed to load from disc, re-caching.
[ Info: Tried to load ModelingToolkit but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load SharedArrays but failed to load from disc, re-caching.
[ Info: Tried to load SpecialFunctions but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveArrayTools but failed to load from disc, re-caching.
[ Info: Tried to load REPL but failed to load from disc, re-caching.
[ Info: Tried to load IterativeSolvers but failed to load from disc, re-caching.
[ Info: Tried to load Unicode but failed to load from disc, re-caching.
[ Info: Tried to load OrderedCollections but failed to load from disc, re-caching.
[ Info: Tried to load MLStyle but failed to load from disc, re-caching.
[ Info: Tried to load Requires but failed to load from disc, re-caching.
[ Info: Tried to load CSTParser but failed to load from disc, re-caching.
[ Info: Tried to load SHA but failed to load from disc, re-caching.
[ Info: Tried to load InteractiveUtils but failed to load from disc, re-caching.
[ Info: Tried to load Markdown but failed to load from disc, re-caching.
[ Info: Tried to load GeneralizedGenerated but failed to load from disc, re-caching.
[ Info: Tried to load Distributed but failed to load from disc, re-caching.
[ Info: Tried to load FunctionWrappers but failed to load from disc, re-caching.
[ Info: Tried to load UUIDs but failed to load from disc, re-caching.
[ Info: Tried to load Serialization but failed to load from disc, re-caching.
[ Info: Tried to load NameResolution but failed to load from disc, re-caching.
[ Info: Tried to load LegibleLambdas but failed to load from disc, re-caching.
[ Info: Tried to load BinaryProvider but failed to load from disc, re-caching.
[ Info: Tried to load Statistics but failed to load from disc, re-caching.
[ Info: Tried to load Base64 but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveFactorization but failed to load from disc, re-caching.
[ Info: Tried to load Logging but failed to load from disc, re-caching.
[ Info: Tried to load SparseArrays but failed to load from disc, re-caching.
[ Info: Tried to load MuladdMacro but failed to load from disc, re-caching.
[ Info: Tried to load NaNMath but failed to load from disc, re-caching.
[ Info: Tried to load Random but failed to load from disc, re-caching.
[ Info: Tried to load DelimitedFiles but failed to load from disc, re-caching.
[ Info: Tried to load DataStructures but failed to load from disc, re-caching.
[ Info: Tried to load OffsetArrays but failed to load from disc, re-caching.
[ Info: Tried to load Interpolations but failed to load from disc, re-caching.
[ Info: Tried to load BinDeps but failed to load from disc, re-caching.
[ Info: Tried to load Unitful but failed to load from disc, re-caching.
[ Info: Tried to load Compat but failed to load from disc, re-caching.
[ Info: Tried to load URIParser but failed to load from disc, re-caching.
[ Info: Tried to load CanonicalTraits but failed to load from disc, re-caching.
[ Info: Tried to load AxisAlgorithms but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqBase but failed to load from disc, re-caching.
[ Info: Tried to load ArrayInterface but failed to load from disc, re-caching.
[ Info: Tried to load LinearAlgebra but failed to load from disc, re-caching.
[ Info: Tried to load Pkg but failed to load from disc, re-caching.
[ Info: Tried to load Printf but failed to load from disc, re-caching.
[ Info: Tried to load DiffEqDiffTools but failed to load from disc, re-caching.
[ Info: Tried to load UnitfulUS but failed to load from disc, re-caching.
[ Info: Tried to load TableTraits but failed to load from disc, re-caching.
[ Info: Tried to load IteratorInterfaceExtensions but failed to load from disc, re-caching.
[ Info: Tried to load Ratios but failed to load from disc, re-caching.
[ Info: Tried to load Sockets but failed to load from disc, re-caching.
[ Info: Tried to load Dates but failed to load from disc, re-caching.
[ Info: Tried to load Tokenize but failed to load from disc, re-caching.
[ Info: Tried to load MacroTools but failed to load from disc, re-caching.
[ Info: Tried to load Parameters but failed to load from disc, re-caching.
[ Info: Tried to load LibGit2 but failed to load from disc, re-caching.
[ Info: Tried to load Roots but failed to load from disc, re-caching.
[ Info: Tried to load Test but failed to load from disc, re-caching.
[ Info: Tried to load StaticArrays but failed to load from disc, re-caching.
[ Info: Tried to load DocStringExtensions but failed to load from disc, re-caching.
[ Info: Tried to load WoodburyMatrices but failed to load from disc, re-caching.
[ Info: Tried to load Mmap but failed to load from disc, re-caching.
[ Info: Tried to load TreeViews but failed to load from disc, re-caching.
[ Info: Tried to load JuliaVariables but failed to load from disc, re-caching.
[ Info: Tried to load RecipesBase but failed to load from disc, re-caching.
[ Info: Tried to load SuiteSparse but failed to load from disc, re-caching.
[ Info: Tried to load DiffRules but failed to load from disc, re-caching.
[ Info: Tried to load ModelingToolkit but failed to load from disc, re-caching.
[ Info: Tried to load Libdl but failed to load from disc, re-caching.
[ Info: Tried to load SharedArrays but failed to load from disc, re-caching.
[ Info: Tried to load SpecialFunctions but failed to load from disc, re-caching.
[ Info: Tried to load RecursiveArrayTools but failed to load from disc, re-caching.
[ Info: Tried to load REPL but failed to load from disc, re-caching.

Versions:

(eglot-jl) pkg> st -m
    Status `~/.emacs.d/straight/repos/eglot-jl/Manifest.toml`
  [00ebfdb7] ~ CSTParser v1.0.0  v1.0.0 ⚲
  [ffa9a821]   DocumentFormat v1.0.1
  [682c06a0]   JSON v0.21.0
  [2b0e0bc5]  LanguageServer v0.6.1-DEV #f31248d (https://github.com/julia-vscode/LanguageServer.jl.git) ⚲ ⇒ v1.0.1-DEV #d9772fb (https://github.com/julia-vscode/LanguageServer.jl.git)
  [69de0a69]  Parsers v0.3.8  v0.3.10
  [b3cc710f]   StaticLint v1.0.2
  [cf896787]   SymbolServer v1.0.1
  [0796e94c]  Tokenize v0.5.6  v0.5.7
  [30578b45]   URIParser v0.4.0
  [2a0f44e3]   Base64 
  [ade2ca70]   Dates 
  [8ba89e20]   Distributed 
  [b77e0a4c]   InteractiveUtils 
  [76f85450]   LibGit2 
  [56ddb016]   Logging 
  [d6f4376e]   Markdown 
  [a63ad114]   Mmap 
  [44cfe95a]   Pkg 
  [de0858da]   Printf 
  [3fa0cd96]   REPL 
  [9a3f8284]   Random 
  [ea8e919c]   SHA 
  [9e88b42a]   Serialization 
  [6462fe0b]   Sockets 
  [8dfed614]   Test 
  [cf7118a7]   UUIDs 
  [4ec0a83e]   Unicode 

julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, broadwell)

Fails if the file has module

Hi,

EDIT: Please note that I can only reproduce this intermittently.

I get a crash whenever a file contains a module.

The error log is as follows:

[ Info: Started symbol server
[ Info: StaticLint store set
ERROR: MethodError: no method matching get_sig(::CSTParser.EXPR{CSTParser.ModuleH})
Closest candidates are:
get_sig(!Matched::CSTParser.BinarySyntaxOpCall) at /home/akaberto/.julia/packages/CSTParser/54NBr/src/interface.jl:268
get_sig(!Matched::CSTParser.EXPR{CSTParser.Macro}) at /home/akaberto/.julia/packages/CSTParser/54NBr/src/interface.jl:266
get_sig(!Matched::CSTParser.EXPR{CSTParser.FunctionDef}) at /home/akaberto/.julia/packages/CSTParser/54NBr/src/interface.jl:265
...
Stacktrace:
[1] process(::LanguageServer.JSONRPC.Request{Val{Symbol("textDocument/hover")},LanguageServer.TextDocumentPositionParams}, ::LanguageServerInstance) at /home/akaberto/.julia/packages/LanguageServer/2C2HB/src/requests/features.jl:513
[2] run(::LanguageServerInstance) at /home/akaberto/.julia/packages/LanguageServer/2C2HB/src/languageserverinstance.jl:46
[3] top-level scope at none:0

Process julia-ls stderr finished

This is on the master

Methods of a single function are missing or scattered across modules

Issue demonstration

In preparing to revise #160 a bit, I was trying to understand the logic a bit more. I created a fresh package depot with these "package" definitions:

A.jl:

module A

foo(x) = 1

end # module

B.jl:

module B

import A

struct Foo end
A.foo(::Foo) = 2

end # module

Each has its own Project.toml file and the standard package directory structure, with B's project file listing A in its [deps] section. Then if I cache symbols, I get this:

julia> env[:A][:foo].methods
1-element Array{SymbolServer.MethodStore,1}:
 SymbolServer.MethodStore(:foo, :A, "/tmp/pkgs/dev/A/src/A.jl", 3, Pair{Any,Any}[:x => SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :Core), :Any), Any[])], Symbol[], SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :Core), :Any), Any[]))

You'll notice there is only one method listed in the MethodStore, despite the fact that

julia> methods(A.foo)
# 2 methods for generic function "foo":
[1] foo(::B.Foo) in B at /tmp/pkgs/dev/B/src/B.jl:6
[2] foo(x) in A at /tmp/pkgs/dev/A/src/A.jl:3

Is it stored in B? To make sure I don't miss it (in case there's name-mangling to encode A.foo), let's look for "foo" anywhere in the name:

julia> ks = String.(keys(env[:B].vals));

julia> filter(s->occursin("foo", s), ks)
0-element Array{String,1}

Doesn't seem to be there.

If I change the definition of B.jl to

module B

import A: foo

struct Foo end
foo(::Foo) = 2

end # module

and start a fresh session and build the cache again, I get

julia> env[:A][:foo].methods
1-element Array{SymbolServer.MethodStore,1}:
 SymbolServer.MethodStore(:foo, :A, "/tmp/pkgs/dev/A/src/A.jl", 3, Pair{Any,Any}[:x => SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :Core), :Any), Any[])], Symbol[], SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :Core), :Any), Any[]))

julia> env[:B][:foo].methods
1-element Array{SymbolServer.MethodStore,1}:
 SymbolServer.MethodStore(:foo, :B, "/tmp/pkgs/dev/B/src/B.jl", 6, Pair{Any,Any}[Symbol("#unused#") => SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :B), :Foo), Any[])], Symbol[], SymbolServer.FakeTypeName(SymbolServer.VarRef(SymbolServer.VarRef(nothing, :Core), :Any), Any[]))

That's better---it got both methods---but if you see a foo(3) in B then

julia> B.foo(3)
1

which demonstrates that it called the method defined in A, not the one defined in B. Meaning that all methods are available from any module that can access it. Might this cause a problem? To find out, I added

function bar()
    return foo(convert(Int, 3.0))
end

to B. Then I positioned my cursor somewhere in foo and hit F12, which takes me to foo(::Foo) rather than foo(::Any), and it doesn't give me a choice in a popup dialog. In contrast, positioning my cursor inside convert and hitting F12 takes me to a definition (the wrong one, but that's a separate issue) but gives me a dialog allowing me to manually choose other methods.

Proposed fix

Fixing this seems to require a bit of an architecture change. To me it seems that the most consistent representation would be to lump all methods for A.foo together in a single FunctionStore placed in A, rather than parcel them out to the modules in which they are defined. This is consistent with how Julia does it:

julia> B.foo === A.foo
true

julia> ft = typeof(A.foo)
typeof(A.foo)

julia> ftn = ft.name
typeof(A.foo)

julia> ftn.module     # A "owns" foo...
A

julia> m = methods(A.foo).ms[1]
foo(::B.Foo) in B at /tmp/pkgs/dev/B/src/B.jl:6

julia> m.module    # ...even though there are methods for it in B
B

When foo requires module-scoping for use in B (my first definition of B.jl), then I'd propose that foo should not be a recorded symbol in env[:B]. (Ideally, hitting F12 in a call A.foo(x) would grok the explicit module-scoping and find it in A.) In the second definition of B.jl, where B imported A.foo, I'd propose that env[:B][:foo] should return just VarRef(VarRef(A), :foo), and that all methods of A.foo be looked up in env[:A].

Crash in indexing

From crash reporting here:

Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)

The symbol server failed with 
DA REMOVED SOME STUFF HERE
[ Info: Now caching package LyceumBase (db31fed1-ca1e-4084-8a49-12fae1996a55)
ERROR: LoadError: TypeError: in TypeVar, in upper bound, expected Type, got Vararg
Stacktrace:
 [1] _broadcast_getindex_evalf at ./broadcast.jl:630 [inlined]
 [2] _broadcast_getindex at ./broadcast.jl:603 [inlined]
 [3] getindex at ./broadcast.jl:563 [inlined]
 [4] copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},Type{Main.SymbolServer.TypeRef},Tuple{Array{Any,1}}}) at ./broadcast.jl:853
 [5] materialize at ./broadcast.jl:819 [inlined]
 [6] get_fieldtypes(::DataType) at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/utils.jl:227
 [7] get_module(::Module, ::Set{String}) at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/symbols.jl:224
 [8] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/symbols.jl:278
 [9] top-level scope at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/server.jl:64
 [10] include at ./boot.jl:328 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1105
 [12] include(::Module, ::String) at ./Base.jl:31
 [13] exec_options(::Base.JLOptions) at ./client.jl:287
 [14] _start() at ./client.jl:460
in expression starting at /home/XXX/.vscode/extensions/julialang.language-julia-0.14.0-beta.3/scripts/languageserver/packages/SymbolServer/src/server.jl:44

Plans to move caching into the cloud

@davidanthoff I saw you mention in #160 and #161 that you plan to move caching into the cloud. Could you expand a little bit on the proposed architecture for doing so? Culturally I think that several of the downstream clients for LanguageServer.jl other than vscode will tend to be more uncomfortable with such a change. Specifically I'd like to know if the thought is that:

  • Caching of symbols on user's machines continues to be the default for LanguageServer.jl, but vscode will provide a mechanism to download caches
  • Caching of symbols on user's machines continues to be the default for LanguageServer.jl, but an option can be passed to LanguageServerInstance to download caches.
  • LanguageServer.jl will default to downloading caches
  • Something else I haven't considered

Could we index in the cloud?

Here is another idea for our indexing woes: could we create the cache files in the cloud for every known tagged package version in the registry, and then the extension would just download these precomputed files? Maybe this could even be integrated with the new package server stuff that is coming in some way.

This would require that the file format doesn’t use serialization so that it becomes Julia version independent. But that would in general be useful if we were to pursue the compiled LS idea.

Also, there seem two use cases:

  • user opens a file that is part of a package (say via goto definition) and we want to provide some level of code navigation, hover etc in that file. I think we should try to use LSIF for this scenario in some way.
  • user has a using Foo Statement in a file, and we need symbols, docs etc from Foo to provide features in the currently open file. I don’t think LSIF helps in that scenario, so we would probably need our own symbol file format for that.

In my ideal world these files maybe would even be just downloaded with the package itself via the package manager, so that the our extension can just rely on them being there. But that is probably something for a future iteration.

SymbolServer/store/Base.jstore no such file or directory

in expression starting at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/main.jl:7
caused by [exception 2]
EOFError: read end of file
Stacktrace:
[1] read(::Base.PipeEndpoint, ::Type{UInt8}) at ./stream.jl:868
[2] read(::Base.Process, ::Type{UInt8}) at ./io.jl:314
[3] deserialize at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Serialization/src/Serialization.jl:722 [inlined]
[4] deserialize(::Base.Process) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Serialization/src/Serialization.jl:709
[5] request(::SymbolServerProcess, ::Symbol, ::Nothing) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:45
[6] load_core(::SymbolServerProcess) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:148
[7] getstore(::SymbolServerProcess) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:128
[8] run(::LanguageServerInstance) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/LanguageServer/src/languageserverinstance.jl:35
[9] top-level scope at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/main.jl:24
[10] include at ./boot.jl:328 [inlined]
[11] include_relative(::Module, ::String) at ./loading.jl:1105
[12] include(::Module, ::String) at ./Base.jl:31
[13] exec_options(::Base.JLOptions) at ./client.jl:287
[14] _start() at ./client.jl:460
caused by [exception 1]
SystemError: opening file "/opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/store/Base.jstore": No such file or directory
Stacktrace:
[1] #systemerror#44(::Nothing, ::typeof(systemerror), ::String, ::Bool) at ./error.jl:134
[2] systemerror at ./error.jl:134 [inlined]
[3] #open#512(::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::typeof(open), ::String) at ./iostream.jl:254
[4] open at ./iostream.jl:246 [inlined]
[5] load_store_from_disc(::String) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:76
[6] getstore(::SymbolServerProcess) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/SymbolServer/src/SymbolServer.jl:125
[7] run(::LanguageServerInstance) at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/packages/LanguageServer/src/languageserverinstance.jl:35
[8] top-level scope at /opt/JuliaIDE/data/extensions/julialang.language-julia-0.12.3/scripts/languageserver/main.jl:24
[9] include at ./boot.jl:328 [inlined]
[10] include_relative(::Module, ::String) at ./loading.jl:1105
[11] include(::Module, ::String) at ./Base.jl:31
[12] exec_options(::Base.JLOptions) at ./client.jl:287
[13] _start() at ./client.jl:460
[Error - 12:10:38 PM] Connection to server got closed. Server will not be restarted.

SymbolServer does not create the store

I tried to run the following, but nothing is stored in the hard disk (there is no store folder).

x = getstore(SymbolServerInstance("./test"), "./test")

Don't load stuff that is in the current workspace

I believe right now we are loading everything that is in the Julia environment that we pass to the SymServer. So if we have an env and the current working folder in VS Code is deved into that env, then SymServer will load the content of the package that we are currently editing.

It seems to me that in general we don't want to load anything that is somewhere in the folder hierarchy under any of the root folders of the workspace at all, after all the content of those files will be obtained from parsing etc., right? I.e. the philosophy should be that SymServer only loads stuff that is outside of the workspace that is currently edited in VS Code.

@ZacLN, does that sound right to you?

ERROR: LoadError: TypeVar in Vararg length must have bounds Union{} and Any

From crash reporting.

Error message: ERROR: LoadError: TypeVar in Vararg length must have bounds Union{} and Any

Stack trace:

 [1] _methods at ./reflection.jl:831 [inlined]
 [2] cache_methods(::Type, ::Module, ::Bool) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:101
 [3] cache_methods(::Type, ::Module) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:94
 [4] (::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore})(::Type) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:205
 [5] apply_to_everything(::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore}, ::Module, ::Base.IdSet{Module}) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:156
 [6] apply_to_everything(::Main.SymbolServer.var"#7#8"{Module,Main.SymbolServer.ModuleStore}, ::Nothing, ::Base.IdSet{Module}) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:163
 [7] apply_to_everything at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:151 [inlined]
 [8] cache_module(::Module, ::Main.SymbolServer.VarRef, ::Array{Symbol,1}, ::Bool) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:194
 [9] cache_module at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:170 [inlined]
 [10] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::Base.PipeEndpoint) at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/symbols.jl:312
 [11] top-level scope at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/server.jl:100
in expression starting at /home/XXX/.vscode-server/extensions/julialang.language-julia-0.15.23/scripts/languageserver/packages/SymbolServer/src/server.jl:70
 

Incorrect deprecation warnings

When I run the following code, I get a lot of deprecation warnings which seem to be incorrect:

using SymbolServer
env = SymbolServer.getenvtree()
WARNING: Compat.Random is deprecated, use Random instead.

WARNING: Compat.LibGit2 is deprecated, use LibGit2 instead.

...

ERROR: LoadError: type UnionAll has no field name

From crash reporting.

Stack trace:

 [1] getproperty at ./sysimg.jl:15 [inlined]
 [2] #FakeTypeName#1 at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/faketypes.jl:20 [inlined]
 [3] Type at ./none:0 [inlined]
 [4] _parameter(::Type{Any}) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/faketypes.jl:63
 [5] _broadcast_getindex_evalf(::typeof(Main.SymbolServer._parameter), ::Type) at ./broadcast.jl:578
 [6] _broadcast_getindex(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Main.SymbolServer._parameter),Tuple{Base.Broadcast.Extruded{Array{Any,1},Tuple{Bool},Tuple{Int64}}}}, ::Int64) at ./broadcast.jl:551
 [7] getindex(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Main.SymbolServer._parameter),Tuple{Base.Broadcast.Extruded{Array{Any,1},Tuple{Bool},Tuple{Int64}}}}, ::Int64) at ./broadcast.jl:511
 [8] copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},typeof(Main.SymbolServer._parameter),Tuple{Array{Any,1}}}) at ./broadcast.jl:787
 [9] materialize at ./broadcast.jl:753 [inlined]
 [10] #FakeTypeName#1(::Bool, ::Type, ::Type) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/faketypes.jl:22
 [11] Main.SymbolServer.FakeTypeName(::Type) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/faketypes.jl:18
 [12] cache_methods(::Function, ::Module, ::Bool) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:128
 [13] Main.SymbolServer.FunctionStore(::Function, ::Module, ::Bool) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:74
 [14] cache_module(::Module, ::Main.SymbolServer.VarRef, ::Array{Symbol,1}, ::Bool) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:197
 [15] cache_module(::Module, ::Main.SymbolServer.VarRef, ::Array{Symbol,1}, ::Bool) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:190
 [16] cache_module at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:178 [inlined]
 [17] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::Base.PipeEndpoint) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:331
 [18] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::Base.PipeEndpoint) at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/symbols.jl:337 (repeats 2 times)
 [19] top-level scope at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/server.jl:103
 [20] include at ./boot.jl:326 [inlined]
 [21] include_relative(::Module, ::String) at ./loading.jl:1038
 [22] include(::Module, ::String) at ./sysimg.jl:29
 [23] exec_options(::Base.JLOptions) at ./client.jl:267
 [24] _start() at ./client.jl:436
in expression starting at /home/XXX/.vscode-server-insiders/extensions/julialang.language-julia-0.15.29/scripts/languageserver/packages/SymbolServer/src/server.jl:73

Warnings about Mutex and other stuff

Just loading SymbolServer produces a large number of warnings. Not clear to me where they are coming from, but I think it has something to do with the recent changes:

ulia> using SymbolServer
[ Info: Precompiling SymbolServer [cf896787-08d5-524d-9de7-132aaa0cb996]
WARNING: Threads.Mutex is deprecated, use ReentrantLock instead.
  likely near C:\Users\david\.julia\dev\SymbolServer\src\SymbolServer.jl:177
WARNING: Threads.RecursiveSpinLock is deprecated, use ReentrantLock instead.
  likely near C:\Users\david\.julia\dev\SymbolServer\src\SymbolServer.jl:177
WARNING: Threads.Mutex is deprecated, use ReentrantLock instead.
  likely near C:\Users\david\.julia\dev\SymbolServer\src\SymbolServer.jl:177
WARNING: Threads.RecursiveSpinLock is deprecated, use ReentrantLock instead.
  likely near C:\Users\david\.julia\dev\SymbolServer\src\SymbolServer.jl:177

Bug with caching package

There seems to be a bug when loading a package not in cache? Seems like the server still assumes Pkg.Types.is_stdlib is still available when it doesn't seem to be in Julia 1.1.

MacOS 10.14.6
Julia v1.1
with lsp-mode and lsp-julia on emacs.

[ Info: Started symbol server
[ Info: Test not stored on disc
ERROR: EOFError: read end of file

stderr from client process:

ERROR: LoadError: UndefVarError: is_stdlib not defined
Stacktrace:
 [1] getproperty at ./sysimg.jl:13 [inlined]
 [2] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::String) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/symbols.jl:209
 [3] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/symbols.jl:184
 [4] (::getfield(Main.SymbolServer, Symbol("##16#20")){String})() at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/server.jl:37
 [5] redirect_stdout(::getfield(Main.SymbolServer, Symbol("##16#20")){String}, ::IOStream) at ./stream.jl:1055
 [6] #15 at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/server.jl:36 [inlined]
 [7] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(Main.SymbolServer, Symbol("##15#19")){String}, ::String, ::Vararg{String,N} where N) at ./iostream.jl:369
 [8] open(::Function, ::String, ::String) at ./iostream.jl:367
 [9] top-level scope at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/server.jl:35
 [10] include_relative(::Module, ::String) at /Applications/Julia-1.1.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 [11] include(::Module, ::String) at ./sysimg.jl:29
 [12] exec_options(::Base.JLOptions) at ./client.jl:267
 [13] _start() at ./client.jl:436
in expression starting at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/server.jl:29

Stacktrace:
 [1] error(::String) at /Applications/Julia-1.1.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 [2] request(::SymbolServerProcess, ::Symbol, ::Array{String,1}) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:68
 [3] cache_package(::SymbolServerProcess, ::Array{Base.UUID,1}) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:235
 [4] cache_package at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:229 [inlined]
 [5] load_package_cache(::SymbolServerProcess, ::Base.UUID) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:173
 [6] load_project_packages(::SymbolServerProcess) at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:95
 [7] getstore at /Users/Matt/.julia/packages/SymbolServer/ls3Wt/src/SymbolServer.jl:101 [inlined]
 [8] run(::LanguageServerInstance) at /Users/Matt/.julia/packages/LanguageServer/qGsFw/src/languageserverinstance.jl:35
 [9] top-level scope at none:0

LanguageServer crashing

I think the problem lies here, if I'm reading the error message correctly. This is from emacs with lsp-mode, if that matters in any way.

Seems to have started in the last couple of days, so maybe related to the most recent commits?
[EDIT] maybe not, I don't seem to be on the latest tagged version. Let me investigate further before you dig in...

[ Info: Started symbol server
[ Info: CSV not stored on disc
ERROR: EOFError: read end of file

stderr from client process:

ERROR: LoadError: MethodError: no method matching is_stdlib(::Pkg.Types.Context, ::Base.UUID)
Stacktrace:
 [1] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}, ::String) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/symbols.jl:215
 [2] cache_package(::Pkg.Types.Context, ::Base.UUID, ::Dict{Any,Any}) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/symbols.jl:190
 [3] top-level scope at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/server.jl:39
 [4] include(::Module, ::String) at ./Base.jl:377
 [5] exec_options(::Base.JLOptions) at ./client.jl:288
 [6] _start() at ./client.jl:484
in expression starting at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/server.jl:33

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] request(::SymbolServerProcess, ::Symbol, ::Array{String,1}) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:68
 [3] cache_package(::SymbolServerProcess, ::Array{Base.UUID,1}) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:235
 [4] cache_package at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:229 [inlined]
 [5] load_package_cache(::SymbolServerProcess, ::Base.UUID) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:173
 [6] load_project_packages(::SymbolServerProcess) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:95
 [7] getstore at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:101 [inlined]
 [8] run(::LanguageServerInstance) at /Users/rrock/.julia/packages/LanguageServer/XXTJb/src/languageserverinstance.jl:36
 [9] top-level scope at none:1
caused by [exception 1]
EOFError: read end of file
Stacktrace:
 [1] read(::Base.PipeEndpoint, ::Type{UInt8}) at ./stream.jl:868
 [2] read(::Base.Process, ::Type{UInt8}) at ./io.jl:314
 [3] deserialize at /Users/rrock/Documents/Code/julia/usr/share/julia/stdlib/v1.4/Serialization/src/Serialization.jl:735 [inlined]
 [4] deserialize(::Base.Process) at /Users/rrock/Documents/Code/julia/usr/share/julia/stdlib/v1.4/Serialization/src/Serialization.jl:722
 [5] request(::SymbolServerProcess, ::Symbol, ::Array{String,1}) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:60
 [6] cache_package(::SymbolServerProcess, ::Array{Base.UUID,1}) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:235
 [7] cache_package at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:229 [inlined]
 [8] load_package_cache(::SymbolServerProcess, ::Base.UUID) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:173
 [9] load_project_packages(::SymbolServerProcess) at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:95
 [10] getstore at /Users/rrock/.julia/packages/SymbolServer/KebKX/src/SymbolServer.jl:101 [inlined]
 [11] run(::LanguageServerInstance) at /Users/rrock/.julia/packages/LanguageServer/XXTJb/src/languageserverinstance.jl:36
 [12] top-level scope at none:1

Process julia-ls stderr finished

Pkg changes in Julia 1.4

Issues with src/symbols.jl in Julia 1.4:

EDIT: I think the following patch resolves this issue:

modified   src/symbols.jl
@@ -207,13 +207,20 @@ function cache_package(c::Pkg.Types.Context, uuid::UUID, depot::Dict, env_path =
         end
     end
 
+    pkgpath = try
+        LoadingBay.eval(:(import $(Symbol(pe_name))))
+        LoadingBay.eval(:(joinpath(dirname(pathof($(Symbol(pe_name)))), "..")))
+    catch err
+        return nothing
+    end
+
     # Dependencies
     for pkg in deps(pe)
         if path(pe) isa String
             env_path = path(pe)
             Pkg.API.activate(env_path)
-        elseif !is_stdlib(uuid) && ((Pkg.API.dir(pe_name) isa String) && !isempty(Pkg.API.dir(pe_name)))
-            env_path = Pkg.API.dir(pe_name)
+        elseif !is_stdlib(uuid) && (pkgpath isa String) && !isempty(pkgpath)
+            env_path = pkgpath
             Pkg.API.activate(env_path)
         end
         cache_package(c, packageuuid(pkg), depot, env_path)

Julia 1.1 breaks things

I think the core reason is that the new Pkg stuff uses the type UUID throughout to represent uuids, whereas the old version used String. And our internal data structures now are all mixed up.

I don't know what the best way out here is. One option would be to move our internal data structures all over to UUID, but I don't know whether that would work on julia 1.0. Or we keep using String, then we need to make sure we convert properly...

I do think we should keep supporting julia 1.0, given that it is the long term stable release.

@ZacLN any ideas?

type FakeUnionAll has no field name

From crash reporting.

Error message: type FakeUnionAll has no field name

Stack trace:

ErrorException:
   at getproperty(::Any, ::Symbol) (sysimg.jl18)
   at _lookup(::SymbolServer.FakeUnionAll, ::Dict{Symbol,SymbolServer.ModuleStore}, ::Bool) (./scripts/languageserver/packages/SymbolServer/src/utils.jl228)
   at _lookup(::SymbolServer.FakeUnionAll, ::Dict{Symbol,SymbolServer.ModuleStore}) (./scripts/languageserver/packages/SymbolServer/src/utils.jl228)
   at resolve_getindex(::CSTParser.EXPR, ::SymbolServer.DataTypeStore, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/references.jl229)
   at resolve_getindex(::CSTParser.EXPR, ::StaticLint.Binding, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/references.jl177)
   at resolve_getindex(::CSTParser.EXPR, ::StaticLint.Scope, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/references.jl162)
   at resolve_ref(::CSTParser.EXPR, ::StaticLint.Scope, ::StaticLint.State{LanguageServer.Document}, ::Array{Any,1}) (./scripts/languageserver/packages/StaticLint/src/references.jl57)
   at _resolve_ref(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/references.jl23)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl65)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at followinclude(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl158)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl66)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at followinclude(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl158)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl66)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at traverse(::CSTParser.EXPR, ::StaticLint.State{LanguageServer.Document}) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl108)
   at (::StaticLint.State{LanguageServer.Document})(::CSTParser.EXPR) (./scripts/languageserver/packages/StaticLint/src/StaticLint.jl68)
   at scopepass(::LanguageServer.Document, ::LanguageServer.Document) (./scripts/languageserver/packages/StaticLint/src/server.jl45)
   at run(::LanguageServerInstance) (./scripts/languageserver/packages/LanguageServer/src/languageserverinstance.jl252)
   at top-level scope (./scripts/languageserver/main.jl28)
   at include (boot.jl326)
   at include_relative(::Module, ::String) (loading.jl1038)
   at include(::Module, ::String) (sysimg.jl29)
   at exec_options(::Base.JLOptions) (client.jl267)
   at _start() (client.jl436)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.