Sublime Forum

Auto completion socket error

#1

UPDATE:

I resolved this issue. I had to add “HEX_UNSAFE_HTTPS=1” as an Environment Variable and then run “mix deps.get” in my “sublime_completion” folder. It was an issue with my corporate proxy and CA certificate.

EDIT: Including information from below as main question now:

The first time a type a letter after starting Sublime I get:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "C:\Users\myName\AppData\Roaming\Sublime Text 3\Packages\ElixirSublime\elixir_sublime.py", line 268, in on_query_completions
    session = ElixirSession.ensure(os.path.dirname(view.file_name()))
  File "C:\Users\myName\AppData\Roaming\Sublime Text 3\Packages\ElixirSublime\elixir_sublime.py", line 160, in ensure
    session.connect()
  File "C:\Users\myName\AppData\Roaming\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

And then I get this every letter I type thereafter:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "C:\Users\myName\AppData\Roaming\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 "C:\Users\myName\AppData\Roaming\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'

ORIGINAL question:

I am having trouble adding my elixir bin path to sublime text 3 for the ElixirSublime package.

I have added this to my user settings:

"env":
{
    "PATH": "C:/Program Files (x86)/Elixir/bin"
},

I am not getting any auto completion for the standard library.

On my macOS machine I was having the same issue with auto completion, but adding “/usr/local/bin” to “PATH” like above fixed the issue.

Any ideas?

0 Likes

#2

I’m not familiar with the package and so this is just a guess, but if you’re setting the path as it appears above (C:\Program Files (x86)\Elixir\bin) you might be having a problem with the fact that sublime-build files are JSON, and JSON uses the \ character for quoting special characters, so your path may be interpreted incorrectly.

If that is indeed the case, doubling them up (C:\\Program Files (x86)\\Elixir\\bin) or swapping them for the Unix style forward slash (C:/Program Files (x86)/Elixir/bin) may resolve the issue for you.

0 Likes

#3

Strange… I had "double " in my post but it formatted to “”. I have tried both " double " and “/” with no luck.

0 Likes

#4

It may have done that because it fell outside of the code block.

Something else to consider may be the space in the file name potentially messing it up, although that seems doubtful.

Does the Sublime Console (Ctrl+`) display any error messages or warnings from the plugin?

0 Likes

#5

It does. The first time a type a letter after starting Sublime I get:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "C:\Users\myName\AppData\Roaming\Sublime Text 3\Packages\ElixirSublime\elixir_sublime.py", line 268, in on_query_completions
    session = ElixirSession.ensure(os.path.dirname(view.file_name()))
  File "C:\Users\myName\AppData\Roaming\Sublime Text 3\Packages\ElixirSublime\elixir_sublime.py", line 160, in ensure
    session.connect()
  File "C:\Users\myName\AppData\Roaming\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

And then I get this every letter thereafter:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "C:\Users\myName\AppData\Roaming\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 "C:\Users\myName\AppData\Roaming\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'
0 Likes