chrisjowen

chrisjowen

VS code auto indent and add aliases

Hey guys and gals, so I have for better or worse (probably worse) had to move away from elixir and over to kotlin for the last few months.

Recently I’m back on personal projects using elixir and the one thing I forgot was how much better the idea support was for typed languages.

I love elixir-ls but some things I’m really missing are things like the ability to auto add imports and some basic refactoring.

Does anyone know if any of the vs plugins support any of

  • auto indent code
  • auto import for alias/using/require declarations
  • auto create module with name based on folder path
  • extract method

I understand that but been typed, and with the macro system this wouldn’t be perfect but I feel like this might be possible 80% of the time.

If nothing exists like this where would you recommend trying to add this? A new plugin or try to add to elixir-ls?

Most Liked

RudManusachi

RudManusachi

  • auto indent code

In VC Code with elixir-ls you can set setting

"[elixir]": {
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "JakeBecker.elixir-ls"
}

and on save it will not only fix indentation, but also format all the code in the file with standard mix format.

lukaszsamson

lukaszsamson

ElixirLS Core Team

While it’s not possible to have the kind of IDE support that static typed languages have but a lot can be done. The language server protocol has support for code actions and some could be added. Of course ElixirLS team would be happy to accept contributions.

Where Next?

Popular in Discussions Top

laiboonh
Hi all, I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
sashaafm
Piggy backing a bit on @dvcrn topic BEAM optimization for functions with static return type?, I’ve been trying to understand in a deeper ...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18146 126
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New

We're in Beta

About us Mission Statement