Skip to content

LanguageServer.jl crashes when requesting textDocument/typeDefinition from native neovim lsp implementation #736

@kdheepak

Description

@kdheepak

This is the log when textDocument/implementation is requested:

[ WARN ] 2020-06-01T15:28:14-0600 ] lua/vim/lsp.lua:493 ]	"server doesn't support textDocument/implementation"

This is the log when textDocument/typeDefiniton is requested:

[ ERROR ] 2020-06-01T15:24:24-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"[ Info: Received new data from Julia Symbol Server.\n"
[ ERROR ] 2020-06-01T15:25:19-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"ERROR: "
[ ERROR ] 2020-06-01T15:25:20-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	'MethodError: no method matching parse_params(::Type{Val{Symbol("textDocument/typeDefinition")}}, ::Dict{String,Any})\nClosest candidates are:\n  parse_params(!Matched::Type{Val{:initialize}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:123\n  parse_params(!Matched::Type{Val{:initialized}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:155\n  parse_params(!Matched::Type{Val{:shutdown}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:180\n  ...'
[ ERROR ] 2020-06-01T15:25:20-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"\nStacktrace:"
[ ERROR ] 2020-06-01T15:25:20-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"\n"
[ ERROR ] 2020-06-01T15:25:20-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" [1] "
[ ERROR ] 2020-06-01T15:25:20-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"parse"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"("
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"::"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"Type"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"{"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"LanguageServer.JSONRPC"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	".Request"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"}, ::Dict{String"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	","
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"Any}"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	")"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" at "
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"/Users/USER/.julia/packages/LanguageServer/mpNvN/src/jsonrpc.jl:46"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"\n"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" [2] "
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"run"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"(::"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"LanguageServerInstance"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	")"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" at "
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"/Users/USER/.julia/packages/LanguageServer/mpNvN/src/languageserverinstance.jl:246"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"\n"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" [3] "
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"top-level scope"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	" at "
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"none:6"
[ ERROR ] 2020-06-01T15:25:21-0600 ] vim/lsp/rpc.lua:317 ]	"rpc"	"julia"	"stderr"	"\n"

Here is the cleaned log file error output:

[ Info: Received new data from Julia Symbol Server.
ERROR: MethodError: no method matching parse_params(::Type{Val{Symbol("textDocument/typeDefinition")}}, ::Dict{String,Any})
Closest candidates are:
  parse_params(!Matched::Type{Val{:initialize}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:123
  parse_params(!Matched::Type{Val{:initialized}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:155
  parse_params(!Matched::Type{Val{:shutdown}}, ::Any) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/requests/init.jl:180
  ...
Stacktrace:
 [1] parse(::Type{LanguageServer.JSONRPC.Request}, ::Dict{String,Any}) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/jsonrpc.jl:46
 [2] run(::LanguageServerInstance) at /Users/USER/.julia/packages/LanguageServer/mpNvN/src/languageserverinstance.jl:246
 [3] top-level scope at none:6

Is there a way to make this behave the same way textDocument/implementation behaves?

Also, once this error is thrown, neovim does not restart the language server again. And on the user there there's no feedback as to what is going on. Suggestions for what to do here would be welcome. This is currently what I'm using to start LanguageServer.jl.

julia --startup-file=no --history-file=no -e
    using LanguageServer; using SymbolServer;
    using Pkg;
    env_path = dirname(Pkg.Types.Context().env.project_file)
    server = LanguageServer.LanguageServerInstance(stdin, stdout, env_path);
    server.runlinter = true;
    run(server);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions