Hey folks, new to VSCode and am trying to get it set up for Elixir. I’m having partial success, but can’t seem to get autocomplete working in dependencies.
I’ve been trying to navigate the wierd world of Elixir VSCode extensions. Seems like Elixir-LS Fork is the way to go, so I’ve installed that. Next I open one of my Ecto models, but here’s what doesn’t work:
- Erasing part of an import/alias/use and trying to tab-complete it. This inserts spaces, not any submodules of the initial module.
- Entering my schema, typing
fieland pressing tab.
Here’s what does:
- Typing part of something from the Elixir standard library–“Pat”, for instance, then pressing Tab. This autocompletes to
- When I type
fielabove and press Tab,
file_changeset(arg1, arg2)is suggested.
file_changesetis a function in my current module, and it does indeed accept two arguments, so this suggests that the server is in fact working and providing more than just word-based completion without context.
My expectation was that the language server would provide completions of symbols in my entire project. Is this inaccurate? Is there more work I need to do to enable this?
Also, FWIW, my project is a monorepo with the Elixir project in a subdirectory. I’m trying to organize it as a workspace, separating out the Java/Kotlin bits into their own workspace. I’m not sure how that affects anything, but theoretically Elixir is in its own isolated workspace. There are also no errors in the Elixir language server output, though the
mix compile happens in some small number of MS, which should be much larger if I’m getting access to all my project’s symbols.
Am I misunderstanding how language servers work? Are they not intended to work project-wide? Any help greatly appreciated.