Go to content

Christian Koch - Have you got the ExFactor? Writing a refactor helper

If you’ve ever used IntelliJ, you may appreciate how nice the “refactor function” command can be. Is it possible to write an elixir library that can help with refactoring all the function calls in a given app? The answer is yes (mostly). We will discuss techniques for turning written elixir code into the parsed representation and how we can use that to find all the references to our function. We will investigate using the Abstract Syntax Trees (AST) representation to move the code and the shortcomings of this technique. Abstract Syntax Trees are an intermediate transformation of elixir code on the way to Beam byte code. The AST representation is a useful tool for structuring arbitrary elixir code. Can it be helpful in manipulating the underlying (*.ex) files? This talk will describe the challenges of implementing this library and explain the challenges of working with ASTs. https://hexdocs.pm/ex_factor/readme.html

August 30, 2022