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

Compilation error in VSCode when when using ElixirLS #51

Closed
martinthenth opened this issue Oct 1, 2022 · 1 comment
Closed

Compilation error in VSCode when when using ElixirLS #51

martinthenth opened this issue Oct 1, 2022 · 1 comment

Comments

@martinthenth
Copy link

Hi! I'm encountering an error in VSCode that breaks the internal compilation in ElixirLS. I tested this problem with Elixir version 1.13.4 and 1.14. I use VSCode version 1.71.2 and ElixirLS version v0.11.0 (both are the most recent versions). It happens for both non-umbrella and umbrella.

Steps to reproduce:

  1. Have a working project
  2. Set up boundary
  3. Cause an error in the code (e.g. use a non-existing variable, or misspell a function)
  4. See an error in mix.exs file (error is below)
  5. See error detection in VSCode break (i.e. VSCode stops displaying where errors and unused functions are)

This is the error:

** (KeyError) key :app not found in: [aliases: [], build_embedded: false, build_per_environment: true, build_scm: Mix.SCM.Path, config_path: "config/config.exs", consolidate_protocols: true, default_task: "run", deps: [], deps_path: "deps", elixirc_paths: ["lib"], erlc_paths: ["src"], erlc_include_path: "include", erlc_options: [], lockfile: "mix.lock", preferred_cli_env: [], start_permanent: false]
    (elixir 1.13.4) lib/keyword.ex:559: Keyword.fetch!/2
    (boundary 0.9.3) lib/boundary/mix/xref.ex:123: Boundary.Mix.Xref.seen_table/0
    (boundary 0.9.3) lib/boundary/mix/xref.ex:34: Boundary.Mix.Xref.initialize_module/1
    (boundary 0.9.3) lib/boundary/mix/tasks/compile/boundary.ex:128: Mix.Tasks.Compile.Boundary.record/5
    (elixir 1.13.4) src/elixir_env.erl:32: :elixir_env."-trace/2-lc$^0/1-0-"/3
    (elixir 1.13.4) src/elixir_env.erl:32: :elixir_env.trace/2
    (elixir 1.13.4) src/elixir_dispatch.erl:163: :elixir_dispatch.do_expand_import/7
    (elixir 1.13.4) src/elixir_dispatch.erl:92: :elixir_dispatch.dispatch_import/6
ElixirLS

I think the error is related to this change: 704b26b, because it adds the config lookup for app_name

@sasa1977
Copy link
Owner

sasa1977 commented Oct 2, 2022

This should be fixed with next ElixirLS release. See elixir-lsp/elixir-ls#717.

@sasa1977 sasa1977 closed this as completed Oct 2, 2022
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