Run single test directly from editor, show types

Hi, one of the cool things when writing Rust in VSCode is that I can run individual tests directly from there. Is something like that doable in Elixir, please? Also the inferred (untyped) type annotations are really helpful - that might be possible too, if you @spec your functions properly?

For the run part you can call mix test test/path/to/file.exs:123 to run a test specified by line number. I don’t know how, but if you know how to configure a launch script in vscode to call that command with current file/line and bind that to a keyboard shortcut it should be doable easily.

yeah I know about that one. I was just wondering if we’re able to inject the nice “run” button in our code directly in vscode? or maybe in other IDE like IntelliJ?

Well off-topic but if you know how to I’m interested ! :smiley:

There is the option on VSCode with ElixirLS is called Enable Test Lenses, it can run a describe block or a single test

3 Likes

In IntelliJ, if you have the Elixir plugin installed, you can just right click into a test and then select “Run” from the dropdown.

1 Like

I use the shortcuts of Elixir Test - Visual Studio Marketplace