expert icon indicating copy to clipboard operation
expert copied to clipboard

Expert crashes when working on Elixir itself

Open doorgan opened this issue 8 months ago • 3 comments

Steps to reproduce:

  1. Clone https://github.com/elixir-lang/elixir and open lib/elixir/lib/code/formatter.ex
  2. Wait for lexical to report the compilation completed
  3. On your terminal, run tail -f .lexical/lexical.log
  4. Go back to your editor and try to trigger a completion like Enum|
  5. Check the logs, there is an error report:
17:24:01.897 [warning] ** (ArgumentError) could not call Module.get_attribute/2 because the module Code.Formatter is already compiled. Use the Module.__info__/1 callback or Code.fetch_docs/1 instead
    (elixir 1.17.2) lib/module.ex:2350: Module.assert_not_compiled!/3
    (elixir 1.17.2) lib/module.ex:1954: Module.get_attribute/7
    (elixir 1.17.2) lib/kernel.ex:3727: Kernel.do_at/5
    (elixir 1.17.2) expanding macro: Kernel.@/1
    (elixir 1.17.2) nofile:2315: Code.Formatter.binary_operator?/1
    (elixir 1.17.2) expanding macro: Kernel.in/2
    (elixir 1.17.2) nofile:2315: Code.Formatter.binary_operator?/1

doorgan avatar Apr 11 '25 20:04 doorgan

I'm running into this as well at work. I haven't dug into it yet, but may do so soon – if anyone has any theories, I'd love to hear them!

zachallaun avatar Jun 26 '25 20:06 zachallaun

I'm not able to reproduce this error using nightly based on https://github.com/elixir-lang/expert/commit/c5cd0fc6d1ab6e85ac3f6943e490ed15171dc682:

Successful completions for Elixir

jswanner avatar Aug 30 '25 15:08 jswanner

I think this is more of an editor issue right now. Depending on if the editor supports workspace folders or how it determines the root folder.

mhanberg avatar Aug 30 '25 19:08 mhanberg

I'm no longer able to reproduce this with the latest main. The logs in the original issue also turned out to be a red herring and not what was crashing expert back then, so I'm closing this.

Image

doorgan avatar Oct 16 '25 02:10 doorgan