edelvalle / SuperElixir

This is a sublime plug-in that provide IDE like capabilities to sublime when working with the Elixir language.
GNU Lesser General Public License v3.0
31 stars 4 forks source link

exceptions in sublime console #3

Closed voger closed 7 years ago

voger commented 7 years ago
% elixir -v                                                                ⏎
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.4.5
% uname -a
Linux toshiba 4.11.8-1-MANJARO #1 SMP PREEMPT Fri Jun 30 06:55:31 UTC 2017 x86_64 GNU/Linux

I keep getting these errors in sublime console

RuntimeError: Can't find the socket to talk to elixir_sense
Cleaning up Elixir
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "super_elixir.autocomplete in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package", line 17, in on_query_completions
  File "super_elixir.sense_client in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package", line 58, in get_elixir_sense
  File "super_elixir.sense_client in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package", line 67, in __init__
  File "super_elixir.sense_client in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package", line 83, in _start_process
RuntimeError: Can't find the socket to talk to elixir_sense
Cleaning up Elixir

None of the features doesn't work and the typing feels laggy because of the exceptions. If I disable the package completely the typing becomes again normal and pleasant. I tried once uninstalling and reinstalling the package. The exceptions had gone but still the features didn't work.

That is until I restarted Sublime. Then the exceptions came back.

What other info should I provide?

edelvalle commented 7 years ago

Thanks a lot, I use the same operating system so I can debug this one easily... It seems that it can't start elixir_sense this is a lib that does all the heavy lifting... try this out:

go to ~/.config/sublime-text-3/Packages/SuperElixir/super_elixir/sense_client.py this file has the module that talks to the elixir sense and is failing to start the sub process.

Could you insert a debug print after line 80:

Before:

        # connect socket
        first_line = self._proc.stdout.readline()
        match = SOCKET_RE.match(first_line)
        if not match:
            raise RuntimeError("Can't find the socket to talk to elixir_sense")

After:

        # connect socket
        first_line = self._proc.stdout.readline()
        print(first_line)
        match = SOCKET_RE.match(first_line)
        if not match:
            raise RuntimeError("Can't find the socket to talk to elixir_sense")

Restart sublime and open an elixir file... the Sublime terminal should print something like:

ok:localhost:/tmp/elixir-sense-1500236981865531973.sock\n

This is the address of the socket to talk to elixir sense... do you see this? what do you see?

voger commented 7 years ago

This is strange but I don't seem to have a folder SuperElixir under Packages. The only relevant thing I found is .config/sublime-text-3/Installed Packages/SuperElixir.sublime-package

I deleted this file and reinstalled SuperElixir. Still no SuperElixir under Packages.

Here is the output from console when I try to install SuperElixir

ignored packages updated to: ["A File Icon", "AppleScript", "ASP", "ElixirSublime", "JsValidate", "SublimeLinter", "Vintage"]
reloading plugin SuperElixir.__init__
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
zipimport.ZipImportError: bad local file header in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package
reloading settings Packages/SuperElixir/super_elixir.sublime-settings
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
voger commented 7 years ago

I also removed from ignored packages "SublimeLinter" and "ElixirSublime". But I noticed this line

zipimport.ZipImportError: bad local file header in /home/voger/.config/sublime-text-3/Installed Packages/SuperElixir.sublime-package

But still SuperElixir is reported as installed.

edelvalle commented 7 years ago

I know what's going on...

The package manager is installing the package in a compressed in a zip, and that can't be, because then it doesn't work. Tomorrow I will check how to tell Package Control how to do it properly and then I will release an update. Wait for it, I will tell you when is ready, should ready in less than 24h.

Thanks a lot.

voger commented 7 years ago

Thank you for your time with this. Glad to see such a quick response :D

edelvalle commented 7 years ago

hey @voger I submitted an update, let's wait until Package Control refreshes it cache.

edelvalle commented 7 years ago

Package control already refreshed the cache, try now...

voger commented 7 years ago

Hi. I just did that. It installed flawlessly. Thank you for your time.