Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: package control can be an optional dependency #123

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

gerardroche
Copy link
Contributor

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.

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
Copy link
Member

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
Copy link
Contributor Author

I have the dependencies manually installed.

@predragnikolic
Copy link
Member

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

@gerardroche
Copy link
Contributor Author

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.

@rchl rchl merged commit e0f4692 into sublimelsp:main Aug 15, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants