sublimelsp / LSP-volar

Vue support for Sublime's LSP plugin
MIT License
84 stars 8 forks source link

fix error when disabling package #117

Closed predragnikolic closed 2 years ago

predragnikolic commented 2 years ago

This should fix the error when popup up when Package Control: Disable Package is run and LSP-volar is selected.

TODO: But the enable package command still doesn't enable all 3 servers. It starts only one server. After restarting ST, all 3 servers are started. Ideally all 3 servers should start when the package is enabled.

closes #116

predragnikolic commented 2 years ago

It is probably because of this code in LSP, but I haven't investigated this too much.

def _register_plugin_impl(plugin: Type[AbstractPlugin], notify_listener: bool) -> None:
    global _plugins
    name = plugin.name()
    if name in _plugins: 
        return  
    ...
predragnikolic commented 2 years ago

I am still getting an silent error when disabling the server. so the Package Control: Disable Package looks like it working, but there is an error in the ST console afterwards.

cls.package_name None
Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 400, in load_module
    m.plugin_loaded()
  File "/home/predragnikolic/.config/sublime-text/Installed Packages/LSP-volar.sublime-package/plugin.py", line 11, in plugin_loaded
    LspVolarPlugin.setup()
  File "/home/predragnikolic/.config/sublime-text/Packages/lsp_utils/st3/lsp_utils/generic_client_handler.py", line 40, in setup
    raise Exception('ERROR: [lsp_utils] package_name is required to instantiate an instance of {}'.format(cls))
Exception: ERROR: [lsp_utils] package_name is required to instantiate an instance of <class 'LSP-volar.plugin.LspVolarPlugin'>
reloading settings Packages/User/Preferences.sublime-settings
predragnikolic commented 2 years ago

Nah, I do not want to spend time thinking on how to fix this. I removed the multi server support from master for now. Will think about it maybe sometime in the future.