add support for disabling automatic builds though a config
closes #341
Adds a config check before starting a build in trigger_build.
I was hesitant to add it to build_enabled since it also seems to be used by dialyzer_enabled
I tried to follow what was outlined in this comment
First PR on a language server, so any feedback is very welcome.
Hmm, I don't think this approach will work very well since the code would never get rebuilt which means that your auto completions and go to implementation, etc. will be out of date. And if you wanted to build you'd have to go in your settings to enable autoBuild, trigger a build, and then go back to settings to disable it.
Here's some potential approaches:
- Add a custom command to build (will have to add support to all clients)
- When this setting is enabled then use the projects
_buildinstead of.elixir_ls/build
- Additionally we'll have to add support to load updated code from
mix compile, possibly with a file watcher, or possibly do a manually check when we would have triggered a build (although there would likely be race conditions)
- Add some other method to build only when the user wants to build
@lukaszsamson any other ideas or thoughts on implementing this feature?
My understanding was that the config would start (My understanding was that people wanted to disable builds entirely). You bring up some good points with the above, I will see if I can tackle them, I am still new to the code base, so feel free to add any pointers.
@axelson I think you covered all of the aspects in your comment.
Add a custom command to build (will have to add support to all clients)
I like that idea
When this setting is enabled then use the projects _build instead of .elixir_ls/build
It would be risky IMO. Every elixir release changes something in the build system. IIRC There were issues with race conditions/locks between mix and elixirLS in the past.
Add some other method to build only when the user wants to build
File watcher on mix.exs?. Besides that I can't think of anything that doesn't involve client code changes or using external tools.
@Hanspagh Thank you for this PR. Even though it wasn't merged, I'm using your branch to make my editor setup take way less CPU. ❤️
Disables a couple of features but super worth it in my opinion.
I think we can merge it and add rebuild command later. @Hanspagh can you resolve merge conflict?
@Hanspagh Hello, thank you for your PR, do you think it would be possible to update the branch, so it can be merged?
should we merge?
The merge conflicts is solved now atleast, then you can decide what wanna do with this :)