sublimelsp / lsp_utils

Module with LSP-related utilities for Sublime Text
https://sublimelsp.github.io/lsp_utils/
MIT License
13 stars 6 forks source link

fix: package control can be an optional dependency #123

Closed gerardroche closed 1 month ago

gerardroche commented 1 month ago

This change refactors the package control dependency to be optional by catching the import error if package control is not available and making it an no-op operation.

Previously the import error at the top prevented LSP utils from working properly when package control was not available.

predragnikolic commented 1 month ago

In order for lsp_utils to be installed, PC must exist. Because PC manages dependencies.

In what scenario will the user not have PC installed?

gerardroche commented 1 month ago

I have the dependencies manually installed.

predragnikolic commented 1 month ago

Just to conclude, you don't want to be dependent on package control?

gerardroche commented 1 month ago

Yes. Maybe. I thought it was going to be too difficult to install things without package control. I'm surprised how easy it is. The Sublime Text packages system out of the box is very smart.

Some language servers like phpactor worked straight away (they don't depend on lsp_utils), others wouldn't because the exception is raised at load time. Otherwise everything seems to be working.

As far as I can tell this is the only reference to package control.

Plugins that depend on pc typically wrap related code in a try except block, but feel free to rework the pr.