TerminalFi / LSP-copilot

GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim.
625 stars 25 forks source link

failed to register session LSP-copilot to listener ViewListener(31) #90

Closed tofuninja closed 1 year ago

tofuninja commented 1 year ago

I tried to use the following key bind and disabled the setting auto_ask_completions

     {
         "keys": [
             "ctrl+shift+space"
         ],
         "command": "copilot_ask_completions",
         "context": [
             {
                 "key": "copilot.is_authorized",
             }
         ]
     }

But nothing happened, then I was getting tons of errors from sublime debug console

failed to register session LSP-copilot to listener ViewListener(31)
Traceback (most recent call last):
  File "C:\Users\Tofu Ninja\Desktop\dev_7_23_22\dev\sublime\Data\Installed Packages\LSP.sublime-package\plugin/core/windows.py", line 183, in _publish_sessions_to_listener_async
    listener.on_session_initialized_async(session)
  File "C:\Users\Tofu Ninja\Desktop\dev_7_23_22\dev\sublime\Data\Installed Packages\LSP.sublime-package\plugin/documents.py", line 210, in on_session_initialized_async
    self._session_views[session.config.name] = SessionView(self, session, self._uri)
  File "C:\Users\Tofu Ninja\Desktop\dev_7_23_22\dev\sublime\Data\Installed Packages\LSP.sublime-package\plugin/session_view.py", line 63, in __init__
    self._clear_auto_complete_triggers(settings)
  File "C:\Users\Tofu Ninja\Desktop\dev_7_23_22\dev\sublime\Data\Installed Packages\LSP.sublime-package\plugin/session_view.py", line 152, in _clear_auto_complete_triggers
    triggers = [t for t in triggers if self.session.config.name != t.get("server", "")]
  File "C:\Users\Tofu Ninja\Desktop\dev_7_23_22\dev\sublime\Data\Installed Packages\LSP.sublime-package\plugin/session_view.py", line 152, in <listcomp>
    triggers = [t for t in triggers if self.session.config.name != t.get("server", "")]
AttributeError: 'str' object has no attribute 'get'

I couldn't get the plugin working again after that, had to reinstall it not sure what broke. It was working before I tried to set the binding, tried revering my settings but just kept getting that error. After reinstalling it was working again so I just gave up setting the keybind.

tofuninja commented 1 year ago

Actually I am still getting those errors im not sure if it has anything to do with the keybinding stuff. Keeps happening randomly. The copilot suggestions work for a bit then stop, sometimes wont work at all, some files it won't work on.

jfcherng commented 1 year ago

I would suggest file this issue to LSP as I dont think this is relevant to LSP-copilot. Nothing I can do here.

My only question is that did you restart ST. It may be due to LSP-copilot update or LSP update.

tofuninja commented 1 year ago

I gave up and just uninstalled both LSP and LSP-copilot. Kept breaking randomly, not worth the hassle.

rchl commented 1 year ago

From the error stack, it looks like you might be using invalid value for the ST option auto_complete_triggers. It should be an array of objects but it appears to be an array of strings in your case. That would cause LSP to break for any server.