lexical-lsp / lexical

Lexical is a next-generation elixir language server
781 stars 77 forks source link

Crash in document symbols when opening `detection_case.ex` #675

Closed scohen closed 3 months ago

scohen commented 3 months ago

10:36:41.135 [warn] Could not resolve hover request, got: :error 10:36:43.813 [error] ** (ErlangError) Erlang error: {:exception, %Protocol.UndefinedError{protocol: String.Chars, value: {:test_name, [line: 133, column: 20], nil}, description: ""}, [{String.Chars, :impl_for!, 1, [file: 'lib/string/chars.ex', line: 3]}, {String.Chars, :to_string, 1, [file: 'lib/string/chars.ex', line: 22]}, {LXical.RemoteControl.Search.Indexer.Extractors.ExUnit, :extract, 2, [file: 'lib/lexical/remote_control/search/indexer/extractors/ex_unit.ex', line: 39]}, {LXical.RemoteControl.Search.Indexer.Source.Reducer, :"-apply_extractors/2-fun-0-", 2, [file: 'lib/lexical/remote_control/search/indexer/source/reducer.ex', line: 97]}, {Enum, :"-reduce/3-lists^foldl/2-0-", 3, [file: 'lib/enum.ex', line: 2468]}, {LXical.RemoteControl.Search.Indexer.Quoted, :"-index/2-fun-0-", 2, [file: 'lib/lexical/remote_control/search/indexer/quoted.ex', line: 19]}, {Macro, :do_traverse, 4, [file: 'lib/macro.ex', line: 614]}, {:lists, :mapfoldl_1, 3, [file: 'lists.erl', line: 1462]}]} (kernel 8.5.4.2) erpc.erl:702: :erpc.call/5 (lx_server 0.5.0) lib/lexical/server/provider/handlers/document_symbols.ex:16: LXical.Server.Provider.Handlers.DocumentSymbols.handle/2 (lx_server 0.5.0) lib/lexical/server/provider/queue.ex:99: anonymous fn/2 in LXical.Server.Provider.Queue.State.as_task/2 (elixir 1.14.5) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2 (elixir 1.14.5) lib/task/supervised.ex:34: Task.Supervised.reply/4 (stdlib 4.3.1.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

Terbium-135 commented 3 months ago

I got slightly different ones - but always regarding a hover request:

[Error - 11:29:19] Request textDocument/hover failed.
  Message: ** (ErlangError) Erlang error: {:exception, {:badmatch, nil}, [{LXical.RemoteControl.CodeIntelligence.Entity, :arity_at_position, 2, [file: ~c"lib/lexical/remote_control/code_intelligence/entity.ex", line: 274]}, {LXical.RemoteControl.CodeIntelligence.Entity, :resolve, 4, [file: ~c"lib/lexical/remote_control/code_intelligence/entity.ex", line: 113]}, {LXical.RemoteControl.CodeIntelligence.Entity, :resolve, 2, [file: ~c"lib/lexical/remote_control/code_intelligence/entity.ex", line: 33]}]}
    (kernel 9.2.1) erpc.erl:702: :erpc.call/5
    (lx_server 0.5.0) lib/lexical/server/provider/handlers/hover.ex:21: LXical.Server.Provider.Handlers.Hover.handle/2
    (lx_server 0.5.0) lib/lexical/server/provider/queue.ex:99: anonymous fn/2 in LXical.Server.Provider.Queue.State.as_task/2
    (elixir 1.16.2) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
    (elixir 1.16.2) lib/task/supervised.ex:36: Task.Supervised.reply/4
scohen commented 3 months ago

That's different, @Terbium-135

@Terbium-135 when reporting a bug, please indicate what code lexical was operating on, and include the line and column of the cursor as well.