vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

how to run elixir

Open Hack-yao opened this issue 6 years ago • 8 comments

想要运行Elixir 代码怎么配置呢?

Hack-yao avatar Apr 06 '18 16:04 Hack-yao

elixir is already supported. What issue do you meet with?

formulahendry avatar Apr 15 '18 10:04 formulahendry

I have installed elixir on my computer. 运行elixir代码出现如下提示: "Code language not supported or defined."

What configuration should I do to avoid that?

Hack-yao avatar Apr 23 '18 11:04 Hack-yao

What's the file extension of you elixir file? Is it .ex or .exs?

formulahendry avatar Apr 24 '18 14:04 formulahendry

The extension is .ex doesn't work, but the .exs works fine. Also I noticed when I just create a temporary without saving it and change the language mode to Elixir, it will not run the code. But it works fine under the python language mode.

Hack-yao avatar May 02 '18 09:05 Hack-yao

The way I worked around it was to use mix to run the script and use the script in my root directory (same directory as your mix files).

I just added this into the user settings

	"code-runner.executorMap": {
		"elixir": "mix run"
	}

angelo-moreira avatar Aug 07 '18 14:08 angelo-moreira

I second this - Elixir is not supported by default. ctrl+alt+J does not show "elixir" as a language option.

MisterSpicy avatar Jan 03 '19 02:01 MisterSpicy

mix run only runs .exs, you need to me explicit if you want to run another extension.

{
   "code-runner.executorMapByFileExtension": {
        ".ex": "mix run --no-mix-exs",
        ".exs": "mix run"
    }
}

wronfim avatar May 08 '19 18:05 wronfim

mix run only runs .exs, you need to me explicit if you want to run another extension.

{
   "code-runner.executorMapByFileExtension": {
        ".ex": "mix run --no-mix-exs",
        ".exs": "mix run"
    }
}

thank you so much for sharing this! you just made my day!

sc-yan avatar Mar 15 '22 05:03 sc-yan