Skip to content

Added MIX_ENV to avoid compilation in dev environment#2501

Open
Gigitsu wants to merge 1 commit into
neomake:masterfrom
Gigitsu:feature/mix_env_test
Open

Added MIX_ENV to avoid compilation in dev environment#2501
Gigitsu wants to merge 1 commit into
neomake:masterfrom
Gigitsu:feature/mix_env_test

Conversation

@Gigitsu
Copy link
Copy Markdown

@Gigitsu Gigitsu commented Aug 26, 2020

Using the default env dev when calling mix compile, prevents phoenix live reload to detect changes and recompile code on the fly.

The same happen if you change code while running iex -S mix, if you try to do recompile in iex shell the output is alwasy :noop

This is resolved in elixir_ls by using test as MIX_ENV.

function! neomake#makers#ft#elixir#mix() abort
return {
\ 'exe' : 'mix',
\ 'exe' : 'MIX_ENV=test mix',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this won't work on Windows at least.

Environment variables can be set for jobs for newer Vim/Neovim (

let s:can_use_env_in_job_opts = has('patch-8.0.0902') && has('patch-8.0.1832')
).
Does mix have an option for this maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants