JakeBecker / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the JSON-based "Language Server Protocol" standard and provides debugger support via VS Code's debugger protocol.
Apache License 2.0
846 stars 52 forks source link

Using regular atoms as module names kills outline query #187

Closed nietaki closed 4 years ago

nietaki commented 5 years ago

Environment

Reproduction steps

18:35:27.933 [error] Process #PID<0.157.0> raised an exception
** (MatchError) no match of right hand side value: {:defmodule, [line: 1069, column: 1], [:raxx, [do: {:__block__, [], [{:@, [line: 1070, column: 3], [{:moduledoc, [line: 1070, column: 4], [false]}]}, {:for, [line: 1073, column: 3], [{:<-, [line: 1073, column: 21], [{{:name, [line: 1073, column: 8], nil}, {:arity, [line: 1073, column: 14], nil}}, {{:., [line: 1073, column: 28], [{:__aliases__, [line: 1073, column: 24], [:Raxx]}, :__info__]}, [line: 1073, column: 28], [:functions]}]}, [do: {:__block__, [], [{:=, [line: 1074, column: 10], [{:args, [line: 1074, column: 5], nil}, {:for, [line: 1074, column: 12], [{:<-, [line: 1074, column: 18], [{:i, [line: 1074, column: 16], nil}, {:.., [line: 1074, column: 22], [0, {:arity, [line: 1074, column: 24], nil}]}]}, {:>, [line: 1074, column: 33], [{:i, [line: 1074, column: 31], nil}, 0]}, [do: {{:., [line: 1074, column: 47], [{:__aliases__, [line: 1074, column: 42], [:Macro]}, :var]}, [line: 1074, column: 47], [{{:., [line: 1074, column: 52], [:erlang, :binary_to_atom]}, [line: 1074, column: 52], [{:<<>>, [line: 1074, column: 52], [{:::, [line: 1074], [{{...}, ...}, {...}]}]}, :utf8]}, nil]}]]}]}, {:defdelegate, [line: 1075, column: 5], [{{:unquote, [line: 1075, column: 17], [{:name, [line: 1075, column: 25], nil}]}, [line: 1075, column: 17], [{:unquote_splicing, [line: 1075, column: 31], [{:args, [line: 1075, column: 48], nil}]}]}, [to: {:__aliases__, [line: 1075, column: 60], [:Raxx]}]]}]}]]}]}]]}
    (language_server) lib/language_server/providers/document_symbols.ex:51: ElixirLS.LanguageServer.Providers.DocumentSymbols.extract_module/1
    (language_server) lib/language_server/providers/document_symbols.ex:43: anonymous fn/2 in ElixirLS.LanguageServer.Providers.DocumentSymbols.list_symbols/1
    (elixir) lib/macro.ex:282: anonymous fn/4 in Macro.do_traverse_args/4
    (elixir) lib/enum.ex:1418: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (elixir) lib/enum.ex:1418: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (elixir) lib/macro.ex:248: Macro.do_traverse/4
    (language_server) lib/language_server/providers/document_symbols.ex:42: ElixirLS.LanguageServer.Providers.DocumentSymbols.list_symbols/1
    (language_server) lib/language_server/providers/document_symbols.ex:35: ElixirLS.LanguageServer.Providers.DocumentSymbols.symbols/2

The offending line seems to be

defmodule :raxx do

If it's changed to defmodule Baxx do seems to make it all work.

I might have a look later if I can attempt a fix, just wanted to report for now.

JakeBecker commented 4 years ago

This project has moved!

It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

To avoid inundating the new maintainers with issues, please verify that your issue persists with the latest version of the extension (which is published from the new repo) before re-filing your issue there.

Thanks for using ElixirLS!