ElixirSublime
ElixirSublime copied to clipboard
Code completion not working
Hello,
Is there anything else i should do to make this work? I have elixir installed, i have my env settings like:
"env": {
"PATH": "/usr/lib/elixir/bin"
},
And i also Elixir, and ElixirSublime packages installed. But code completion is not working like showed on gif in your readme. Any ideas how to make it work?
I've same issue.
The same for me.
What is your Elixir version? See #18
Elixir 1.1.1
+1
Elixir (1.1.1)
➜ sublime_completion iex -S mix
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
Compiled lib/sublime_completion.ex
Generated sublime_completion app
=INFO REPORT==== 27-Nov-2015::13:03:59 ===
application: logger
exited: stopped
type: temporary
** (Mix) Could not start application sublime_completion: exited in: SublimeCompletion.start(:normal, [])
** (EXIT) an exception was raised:
** (ArgumentError) argument error
:erlang.binary_to_integer(nil)
(sublime_completion) lib/sublime_completion.ex:11: SublimeCompletion.start/2
(kernel) application_master.erl:273: :application_master.start_it_old/4
+1
Elixir 1.1.1
There is a solution to this in #18 where you have to add a line to the config.exs in the sublime_completion folder that fixed this for me in elixir 1.1.1
Hi guys,
This is still not working for me, I tried the solutions provided in #18 but with no success. Does anyone know how to make it work with Elixir 1.1.1? I've been recently digging into programming and development in Elixir but have found it quite difficult because most of the time I found myself searching the online documentation for things that this package already does.
Any help would be highly appreciated!
_Andrés Alejandro García_
@Angarsk8 I used fix 18 for Elixir 1.1.1
This is my full config.exs
use Mix.Config
config :iex,
autocomplete_server: IEx.Server
I didn't need :iex in under applications in mix.exs
I did need to add my path to my env user preferences
"env":
{
"PATH": "/usr/local/Cellar/elixir/1.1.1/bin/"
},
Hope that helps
Craig
Still nothing! :( I've tried every possible solution, but nothing works! I get this stack trace in the Sublime Text console:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 359, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "/Users/Angarsk8/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 270, in on_query_completions
if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)):
File "/Users/Angarsk8/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 189, in send
self.socket.send(str.encode(cmd))
AttributeError: 'NoneType' object has no attribute 'send'
_Andrés Alejandro García_
+1 Same issue. Nothing working for me.
edit: Just to add a little more context, I'm getting the same error as Andres exactly. Socket is being set to 'None' and basically staying that way. I don't know enough about python to really know what I'm talking about but it feels like a possible setup issue (perhaps env/path) but I can't figure it out.
I tried to investigate this issue a bit - seems like there is some inconsistency when SublimeText loads this plugin - we are trying to assign environment variable ELIXIR_SUBLIME_PORT
in this method https://github.com/vishnevskiy/ElixirSublime/blob/master/elixir_sublime.py#L17 before socket creation happens here https://github.com/vishnevskiy/ElixirSublime/blob/master/elixir_sublime.py#L24. Perhaps I am missing something as I am not Python or Sublime Text plugins expert. I just tried to repeat process of setting this variable manually - and now it works for me.
Update#1: Try to move this line https://github.com/vishnevskiy/ElixirSublime/blob/master/elixir_sublime.py#L17 to the end of the method - e.g. line 29.
Update#2: Added PR: #25
Problem solved! Thank you very much! @YurkoHoshko
That doesn't work for me! :( @YurkoHoshko
Me neither, sadly. Same issue.
@Angarsk8 @seanpowell You guys should check @YurkoHoshko 's repo https://github.com/YurkoHoshko/ElixirSublime
I downloaded it and replace all the files in my ElixirSublime folder, then it works
Indeed! It works now! thanks @YurkoHoshko!!
Hmm. Did you all do anything different than simply overwrite the package with the updated repo? I'm still getting the same error.
@seanpowell Could you add my fork as repository for your Sublime Text Package Manager and then try to reinstall this plugin. As far as I remember I had some issues with original plugin from Package Manager repo, because it does not contain latest changes from GitHub repo.
Hey all - I didn't have "Fix Mac Path" installed on Sublime Text. Installing it seemed to do the trick (along with @YurkoHoshko's fork). Thanks @YurkoHoshko and @PotterDai.
I tried pretty much every combination of what people suggested in here.
In the end using @YurkoHoshko's fork in its entirety was the solution, no path fix, env setting, etc. was necessary.
Anyone have it working on windows? Installed from @YurkoHoshko's fork but still the same error. Wondering if path is formatted correctly; don't know what else it could be..
@YurkoHoshko's fork and Fix Mac Path worked great
I'm using @YurkoHoshko's fork and Fix Mac Path, but I'm still seeing these errors:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "/Users/user/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 281, in on_query_completions
session = ElixirSession.ensure(os.path.dirname(view.file_name()))
File "/Users/user/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 164, in ensure
session.connect()
File "/Users/user/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 183, in connect
self.socket, _ = _socket.accept()
File "./socket.py", line 135, in accept
socket.timeout: timed out
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "/Users/user/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 283, in on_query_completions
if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)):
File "/Users/user/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 193, in send
self.socket.send(str.encode(cmd))
AttributeError: 'NoneType' object has no attribute 'send'
Sublime Text 3 and Elixir 1.2.2 installed via Homebrew.
worker(Task, [SublimeCompletion, :connect, [3000]]) System.get_env(...port) would be lost in windows. so change this list to [3000] default, will easily fix this error, but it's not good to solve this problem.
The error I had was apparently related to an outdated Hex version (see #28).
Having trouble here. Trying to type IO.puts
but not seeing completion.
However the linter is working.
SublimeLinter: elixirlinter activated: /usr/local/bin/elixirc It would be helpful if any errors were logged to the Sublime console.
Sublime Text Dev Channel Build 3102 OS X 10.11.3 El Capitan with Elixir 1.2.2 and Erlang/OTP 18 [erts-7.2.1]. Installed via Homebrew as suggested in the documentation.
I tried running the command @developerworks did https://github.com/vishnevskiy/ElixirSublime/issues/22#issuecomment-160044489 and I see the same error. Not sure if that means anything?
Not seeing any difference with @YurkoHoshko's patch #25.
I did add the @YurkoHoshko's repo to my sublime
Package Control: Add Repository
I removed the package and then I installed it again with the new added repo
It works! Thanks a lot :D
@setzer777 Thanks, that worked for me, too :+1:
@YurkoHoshko PR has been merged but still not working for me, using Elixir v1.2.3
Ok, got it working, first install the deps:
cd "~/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/sublime_completion"
mix deps.get
- Choose Y to install.
- Add this repository (master) to Package Control.
- Remove ElixirSublime and install it again.
I also installed "Fix Mac Path" plugin and added the { "env" { "PATH": /usr/local/bin } }
but I'm not sure that's needed.
Same problem here with El Capitan and Elixir 1.2.4.
Fixed it with all the above (mix.deps, fix mac path, setting env) AND adding autocomplete_server to the confix.exs as described in #18 (without the trailing ,).
@YurkoHoshko's repo also worked for me. So strange... Does this repo need to be republished into the Sublime repo?
@divmgl My PR was merged. Seems like repo was not updated in Package Manager repository, so yes - most probably it needs to be republished.
@vishnevskiy Could you update this repo in Package Manager repositories - because it seems to be quite outdated there. Thanks.
I tried installing directly from this repo.. Didn't work, though the fork from @YurkoHoshko works.
If @vishnevskiy could add @YurkoHoshko as a collaborator that would be great
Actually there is no more need to use my fork now - my PR was merged as well as a couple of other nice fixes - so instead of adding my repository for your Sublime Text Package Manager you can just add this one.
I tried adding this repository to sublime and installing that way, but it gives me the same error others have been getting. The @YurkoHoshko repo is the only way I have gotten it to work.
It works for me now :rocket:
Changes made regarding this plugin:
In Sublime Text 3, Preferences -> Package Settings -> SublimeLinter -> Settings-User
"env": {
"PATH": "/usr/local/bin/elixir"
}
(I use ubuntu 14.04 and the "PATH" above is from running which elixir
in terminal)
Go to sublime_completion using cd ~/.config/sublime-text-3/Packages/ElixirSublime/sublime_completion
(which is a mix project)
In mix.exs
file, add iex
as an application
def application do
[
applications: [:iex, :logger, :poison],
mod: {SublimeCompletion, []}
]
end
In config.exs
file, add the configuration for iex
use Mix.Config
config :iex,
autocomplete_server: IEx.Server
Restart the Sublime Text 3
Note: My elixir version is 1.2.3
and I am not sure whether these changes(under sublime_completion
) will persist if the package gets updated by Package Control. But for time being, it works :+1:
@radik909 's way works for me, even without setting env path
Have been unsuccessful after trying out @radik909 's and @YurkoHoshko 's patches. :(
This is the output of my sublime console.
SublimeLinter: elixirlinter: httpster.ex ['/Users/ananth/.asdf/shims/elixirc', '--warnings-as-errors', '--ignore-module-conflict', '-o', '/var/folders/bp/2k7q4kjd2d957yd2yh6q6syc0000gn/T/SublimeLinter3', '-pa', '/Users/ananth/development/httpster/_build/dev/lib/httpster/ebin'] Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 333, in on_activated_async callback.on_activated_async(v) File "/Users/ananth/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 268, in on_activated_async self.on_load_async(view) File "/Users/ananth/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 273, in on_load_async ElixirSession.ensure(os.path.dirname(filename)) File "/Users/ananth/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 164, in ensure session.connect() File "/Users/ananth/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 183, in connect self.socket, _ = _socket.accept() File "./python3.3/socket.py", line 135, in accept socket.timeout: timed out
@ananth99
- I got the same error few days back.
- I removed the plugin(using Package Control - remove package) and reinstalled it.
- Then https://github.com/vishnevskiy/ElixirSublime/issues/22#issuecomment-213393356
Give it a try. Might work :+1:
After running into performance issues with Atom I gave Sublime + SublimeElixir a test, but after running into complications, trying the advice above I still am not getting it to work; console gives me the following:
Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions res = callback.on_query_completions(v, prefix, locations) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 283, in on_query_completions if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)): File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 193, in send self.socket.send(str.encode(cmd)) AttributeError: 'NoneType' object has no attribute 'send' Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 333, in on_activated_async callback.on_activated_async(v) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 268, in on_activated_async self.on_load_async(view) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 273, in on_load_async ElixirSession.ensure(os.path.dirname(filename)) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 164, in ensure session.connect() File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 183, in connect self.socket, _ = _socket.accept() File "./python3.3/socket.py", line 135, in accept socket.timeout: timed out Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions res = callback.on_query_completions(v, prefix, locations) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 283, in on_query_completions if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)): File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 193, in send self.socket.send(str.encode(cmd)) AttributeError: 'NoneType' object has no attribute 'send' Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions res = callback.on_query_completions(v, prefix, locations) File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 283, in on_query_completions if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)): File "/Users/simondelacourt/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 193, in send self.socket.send(str.encode(cmd)) AttributeError: 'NoneType' object has no attribute 'send'
Not working for me even after following the steps by @radik909, including removing/re-adding the package.
I get this error in the Sublime 3 console whenever I open any .exs file:
Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 258, in on_load_async callback.on_load_async(v) File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 273, in on_load_async ElixirSession.ensure(os.path.dirname(filename)) File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 164, in ensure session.connect() File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 181, in connect self.process = run_mix_task('run --no-halt') File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 69, in run_mix_task startupinfo=startupinfo) 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' Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 333, in on_activated_async callback.on_activated_async(v) File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 268, in on_activated_async self.on_load_async(view) File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 273, in on_load_async ElixirSession.ensure(os.path.dirname(filename)) File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 164, in ensure session.connect() File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 181, in connect self.process = run_mix_task('run --no-halt') File "/Users/egeersoz/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 69, in run_mix_task startupinfo=startupinfo) 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'
I can't make it work, too. (I'm new to Elixir) I'm using a Mac and the latest Elixir (1.3.4). I tried @radik909's advice, but that didn't help.
Is there anybody with a working version on Mac? :)
Still an issue for me. Here's my console if it helps.
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 530, in on_activated_async
callback.on_activated_async(v)
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 255, in on_activated_async
self.on_load_async(view)
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 260, in on_load_async
ElixirSession.ensure(os.path.dirname(filename))
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 160, in ensure
session.connect()
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 179, in connect
self.socket, _ = _socket.accept()
File "./python3.3/socket.py", line 135, in accept
socket.timeout: timed out
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 270, in on_query_completions
if not session.send('COMPLETE', expand_selection(view, locations[0], aliases=aliases)):
File "/Users/dave/Library/Application Support/Sublime Text 3/Packages/ElixirSublime/elixir_sublime.py", line 189, in send
self.socket.send(str.encode(cmd))
AttributeError: 'NoneType' object has no attribute 'send'
I don't know jack about sublime plugins or python, but that socket timeout seems suspicious.
Also, I have my env pointing to my elixir binary folder.
On a Mac here running Elixir version 1.4.2, I uninstalled everything Elixir, and reinstalled Elixir, then this, then linter (not sure if order matters) and it's working for me now
I got it working on a Mac running elixir version 1.4.2. I uninstalled the plugin and reinstalled and then followed https://github.com/vishnevskiy/ElixirSublime/issues/22#issuecomment-213393356
I can't make the code completion to work on Ubuntu, sublime text 3, with elixir 1.4.2 I followed the instructions given in this comment #22 I have installed ElixirSublime, SublimeLinter, and Elixir-tmbundle
Not sure why, but it only works for me if I install the package control version, not the one from this repository.