A lot of times while coding I"m making stupid mistakes. An missing parenthesis here, a missing end there, an unused variable, an unused function, etc…
Elixir’s compiler is very good about surfacing these errors and warnings in a clear an concise way (most of the time) but right now it’s not real time. Some editors have plugins which have recreated some of this functionality but it’s a very inconsistent experience between editors. Intellisense/Autocomplete is another feature that’s extremely inconsistent between editors right now.
These issues have had me pondering the feasibility of creating a language server that editors and IDEs can hook into to utilize the existing Elixir compiler and modules to provide all this functionality across the board in real time. You could also then relatively easily hook into @doc/@moduledoc tags to provide more context for what people are trying to access or look at.
The biggest issue in my (uneducated) min is that there would need to be some way to tell the compiler to not look at an ex/exs file on disk, but instead use the content passed in by the language server (for warnings/errors without explicitly saving). You would also then need to signal that the in memory version should then be ignored and use the copy on disk (when user closes a file without saving).
Presumably there should be the possibility to get details of compile issues, hopefully without parsing the same strings that get printed to stdout.
I also wonder how much of the code this would need to call is considered “private” internal Elixir code that has a big potential to to break in non-backward compatible ways in normal bug fixing and refactoring efforts.
Anyone more knowledgeable have any thoughts on the feasibility of this type of project?