Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter not working #166

Open
kottkrig opened this issue Dec 5, 2018 · 14 comments
Open

Formatter not working #166

kottkrig opened this issue Dec 5, 2018 · 14 comments

Comments

@kottkrig
Copy link

kottkrig commented Dec 5, 2018

I'm using Sublime Text 3.1 and I cannot get my formatter to work.

I've enabled format_on_save in my package settings but whenever I save i get the following message in the ST console:

no such context .nest_curly_and_self in Packages/Elixir/Syntaxes/Elixir.tmLanguage
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1072, in run_
    return self.run(edit)
  File "/Users/johan/Library/Application Support/Sublime Text 3/Installed Packages/Elixir.sublime-package/mix_format_file.py", line 49, in run
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'mix'

Do I need to configure anything in particular in order to get the formatter to work?

@josevalim
Copy link
Contributor

Hi @kottkrig, have you just installed it?

@josevalim
Copy link
Contributor

Actually, I have a better question, if you do git show in the directory you installed it, what commit SHA does it return?

Furthermore, if you do git checkout f59c98ea68bca8e1116d23a8d7b276a4ff784da4, does it fix the issue?

Thanks!

@kottkrig
Copy link
Author

kottkrig commented Dec 5, 2018

I've installed and re-installed it a number of times during the week and the latest install was just before I posted this issue. 😃

I removed the version I had installed through the ST Package Manager and added it manually through git. git show yields 16f2bc71509117dbad23e7206ddf4f7f750ed04a but the issue remains:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1072, in run_
    return self.run(edit)
  File "/Users/johan/Library/Application Support/Sublime Text 3/Packages/Elixir/mix_format_file.py", line 49, in run
    cwd=cwd
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'mix'

@josevalim
Copy link
Contributor

josevalim commented Dec 5, 2018 via email

@kottkrig
Copy link
Author

kottkrig commented Dec 5, 2018

Still the same issue after checking out f59c98ea68bca8e1116d23a8d7b276a4ff784da4.

@josevalim
Copy link
Contributor

josevalim commented Dec 5, 2018 via email

@kottkrig
Copy link
Author

kottkrig commented Dec 5, 2018

Yes. I cannot get it to work in any of my projects. Even brand new ones created with mix new foo.

mix is available in my path.

@josevalim
Copy link
Contributor

josevalim commented Dec 5, 2018 via email

@themondays
Copy link

check elixir version then

@kottkrig
Copy link
Author

I'm using Elixir 1.7.3:

~ $ elixir -v
Erlang/OTP 21 [erts-10.0.8] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.7.3 (compiled with Erlang/OTP 21)

@JohnKacz
Copy link

JohnKacz commented Dec 19, 2018

I had the same issue. Looks like ST3 is not using the correct PATH on OSX. (source) It's actually an OSX issue not a ST3 issue (and certainly not a elixir-tmbundle issue)

There seem to be a few ways to handle this (e.g. always launching sublime from the terminal) but you can also follow this solution to fix the issue.

Hope this helps.

@danilokleber
Copy link

I'm getting this error on ST4.

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1494, in run_
    return self.run(edit)
  File "/Users/bytes/Library/Application Support/Sublime Text 3/Installed Packages/Elixir.sublime-package/mix_format_file.py", line 51, in run
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'mix'

Already have checked for the correct PATH. It worked fine on ST3.

@danilokleber
Copy link

danilokleber commented Jun 9, 2021

Any updates on this?

EDIT: I'm not sure if the build Elixir - mix format $file comes from this package but that command is working fine with Sublime Text 4.

@josevalim
Copy link
Contributor

I don't have Sublime Text 4 yet, so it is up to someone who has it to debug it and hopefully provide a fix. Thanks!

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

No branches or pull requests

5 participants