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

Don't compile automatically #120

Closed
crbelaus opened this issue Sep 11, 2018 · 7 comments · Fixed by elixir-lsp/vscode-elixir-ls#308
Closed

Don't compile automatically #120

crbelaus opened this issue Sep 11, 2018 · 7 comments · Fixed by elixir-lsp/vscode-elixir-ls#308

Comments

@crbelaus
Copy link

Environment

  • Elixir & Erlang versions (elixir --version): 1.7.1
  • Operating system: Mac OS
  • Client (editor or IDE): Visual Studio Code

Currently, when I save a file ElixirLS automatically compiles in the environment specified by the elixirLS.mixEnv setting (by default test). I am working in a project that has many files and modifying some of them triggers lots of additional recompilations. Having ElixirLS automatically recompile them with every change usually puts a high load on my CPU.

I've tried to change the elixirLS.mixEnv setting to dev with the hope of having ElixirLS and my local Phoenix server to use the same build and avoiding each one of them to perform a separated compilation. Turns out that this does not work as expected because Phoenix builds are stored in _build while ElixirLS builds are stored in .elixir_ls/build.

My question is, is there any way to avoid ElixirLS trigger automatic recompilations and instead use the builds generated in the _build directory? Something along the lines of what the extensions vscode-elixir and atom-elixir do which use the _build directory files for inference and autocompletion.

@OvermindDL1
Copy link

Except that 'feature' in vscode/atom causes so many bugs and miscompiled beam files that I had to change them to use test exclusively so there wouldn't be any concurrent recompilation breakages like zero-sized beam files. What elixir-ls currently does is far superior.

@JakeBecker
Copy link
Owner

This is something I've thought about making configurable, and it should be a fairly small change. I'll add it to my mental TODO list. (Happy to accept a PR for it, too.)

@crbelaus
Copy link
Author

Yes @OvermindDL1 I've found the same problems when two sources try to save the build artifacts to the same path. What I meant was to make the extension use the build artifacts stored in _build but don't compile anything itself.

This way I could control when the application is compiled by running mix compile manually or using the Phoenix autoreload feature. The extension would limit itself to read those compilation artifacts.

Thank you @JakeBecker ! I will try to build a PR 🔬

@seanwash
Copy link

@JakeBecker @crbelaus I'd love to help with this however I can, however I think I'd need some direction before I could get started.

@crbelaus
Copy link
Author

crbelaus commented Jan 7, 2019

Hi @seanwash I am in the same position as you. I tried to build a PR for this, but I couldn't find where to start working. If anyone can provide a small direction of where to start looking I think that we can build a PR and contribute the changes.

@toranb
Copy link

toranb commented Apr 11, 2019

I would also love this config option but a gentle nudge in the right direction might help land a PR sooner ;) rather than later

edit: I would guess this might be an easy escape valve to check for configuration before doing the re-compile

https://github.com/JakeBecker/elixir-ls/blob/master/apps/language_server/lib/language_server/server.ex#L298

@JakeBecker
Copy link
Owner

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!

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

Successfully merging a pull request may close this issue.

5 participants