Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in ElixirLS.LanguageServer.SourceFile #184

Closed
axelson opened this issue Apr 5, 2020 · 3 comments
Closed

Exception in ElixirLS.LanguageServer.SourceFile #184

axelson opened this issue Apr 5, 2020 · 3 comments

Comments

@axelson
Copy link
Member

axelson commented Apr 5, 2020

I'm seeing an exception in ElixirLS.LanguageServer.SourceFile:

07:45:53.404 [error] Task #PID<0.516.0> started from #PID<0.509.0> terminating
** (CaseClauseError) no case clause matching: {1, nil}
    (language_server) lib/language_server/source_file.ex:118: ElixirLS.LanguageServer.SourceFile.module_line/1
    (language_server) lib/language_server/providers/workspace_symbols.ex:371: anonymous fn/2 in ElixirLS.LanguageServer.Providers.WorkspaceSymbols.index/1
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (language_server) lib/language_server/providers/workspace_symbols.ex:370: anonymous fn/1 in ElixirLS.LanguageServer.Providers.WorkspaceSymbols.index/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: #Function<32.46682346/0 in ElixirLS.LanguageServer.Providers.WorkspaceSymbols.do_process_chunked/2>
    Args: []

The exception is coming from the get_docs line:

  def module_line(module) do
    # TODO: Don't call into here directly
    case ElixirSense.Core.Normalized.Code.get_docs(module, :moduledoc) do
      nil ->
        nil

      {line, _} ->
        line
    end
  end

Most likely related to the elixir_sense update in #180
cc: @lukaszsamson

@lukaszsamson
Copy link
Collaborator

That's strange as elixir_sense master@f89444dd713520acb5d97a98b6d24386c04b9ae8 returns 3-element tuple and the updated code in module_line/1 in #180 matches on that 3-element tuple.
Could it be that older version of ElixirSense.Core.Normalized.Code or the whole elixir-LS is being loaded instead? I had a similar issue related to elixir-lsp/vscode-elixir-ls#63 (I haven't tested the fix yet, but 0.3.2 tag with 045875a applied works fine on my machine)

@axelson
Copy link
Member Author

axelson commented Apr 5, 2020 via email

@axelson
Copy link
Member Author

axelson commented Apr 6, 2020

Yeah you were correct. I need to remember that when you're working on ElixirLS locally all the files that you are editing are replacing the modules in the version of ElixirLS that you're running as well.

@axelson axelson closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants