Blog Entries tagged "vscode"

Add a Little Safety to your Elixir Structs with TypedStruct

<p>I’m working on an Elixir app at the moment and really enjoying it, but some of my recent dabbling in the type-safe worlds of <a href="https://elm-lang.org">Elm</a> and <a href="https://crystal-lang.org">Crystal</a> have left me desiring a bit more structure in my code. The app I’m building involves a multi-step data transformation and so I have a data structure to properly represent this process. But since Elixir is a dynamically typed language, you can’t, for example, have a non-nillable field in a struct. The Elixir/Erlang ecosystem does, however, have a type-checking syntax called <a href="https://hexdocs.pm/elixir/typespecs.html">Type Specs</a>, along with a tool, <a href="http://erlang.org/doc/man/dialyzer.html">Dialyzer</a>,...</p>

Read More...

Running Elixir tests in VSCode

<p>In Vim-land, I use the <a href="https://www.github.com/janko-m/vim-test">vim-test plugin</a> for quickly executing tests from a command line shortcut<sup id="fnref1"><a href="#fn1">1</a></sup>. I wanted to reproduce this behavior in <a href="https://code.visualstudio.com">Visual Studio Code</a>, but I couldn’t find an extension that worked in multiple languages (namely, Ruby, Elixir, Javascript, and Elm). I’m mostly just using VSCode for Elixir, but I still liked the idea of finding a more general purpose solution.</p> <p>So instead I used VSCode’s support for <a href="https://code.visualstudio.com/docs/editor/tasks">Tasks</a> to build the functionality myself. So in my project’s <code>tasks.json</code> file, I have the following 3 tasks for running all tests, a single...</p>

Read More...

VSCode + ElixirLS = 👍👍

<p>I’ve played around with <a href="https://code.visualstudio.com">VSCode</a> here and there, but as a fairly picky Vim user who doesn’t do TypeScript, I never quite understood the hype.</p> <p>Today I started up a new Elixir / Phoenix project (more on that to come) and tried out the <a href="https://github.com/JakeBecker/vscode-elixir-ls">Elixir Language Server Extension</a> and the integration is <strong>very</strong> impression. Code completion, debugger support, automatic inference of Dialyzer <a href="https://hexdocs.pm/elixir/typespecs.html">Typespecs</a>, documentation on hover, and more….</p> <p>I don’t expect to be using VSCode as my standard editor (again, picky Vim user<sup id="fnref1"><a href="#fn1">1</a></sup>), but I think I’ll stick with it on Elixir projects.</p> <div class="footnotes"> <hr> <ol> </ol> </div>

Read More...