Conversation
c8f89be to
f1b0dee
Compare
|
Actually just dumped some old code that I had in stash. |
This comment was marked as resolved.
This comment was marked as resolved.
f806ca0 to
90081a4
Compare
| selector: str, | ||
| priority_selector: str | None = None, | ||
| schemes: list[str] | None = None, | ||
| command: list[str] | None = None, |
There was a problem hiding this comment.
I've been thinking about case that tends to come up often - people want to use non-managed server binary.
Overriding command is one way to do it and it would work for simple cases but in more complex cases like LSP-clangd where there is a lot of arguments and some are even programmatically adjusted during start, it wouldn't work.
So my thought is that, given we use a variable like $server_binary, user should be able to override just the variables from the config file. It would need to override variables added through the additional_variables API.
Just a little concerned that it's not the simplest to explain to the user. Or at least will require a bunch of extra doc in every package but that's the best I can think of.
|
@predragnikolic Do you maybe see anything else for the I think it looks mostly good from my side now, but we should try to get it "perfect" now, so that we don't need any breaking changes or awkward additions later. |
|
I will have some free time at the begging of next week. (Mon, Tue) I'll try to find time to go through the changes and try to migrate some plugins to try out the new API (I will do it only locally). Maybe I will return with some feedback. |
|
I'm toying with the idea of making Feel free to chime in with opinions or better ideas. |
|
I think I should also add a method for extending |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Currently some LSP-* plugins rely on lsp_utils and LSP, Resasons:
This might meant that we move code from lsp_utils in LSP, but not sure how other LSP maintainers would feel about it. (but as said it would ease maintenance of lsp_utils, with the cost of moving it into LSP and shipping unusued code if people did not use some of those plugins) |
|
If we add file pattern support in the future For example, instead of currently only supporting and |
There was a problem hiding this comment.
There are some fine improvements in this PR.
This is just a first look at the PR, will try to take a look once more, tonight and tomorrow.
I did leave some wishes that I would like to see in the next version of LspPlugin.
Left some ideas just so you can consider them. Feel free to steal them if you like some of them, else feel free to discard them.
This is just an initial first review from my side.
Moving api decorators to LSP is a step in that direction. Also I guess a bit better and easier to use API through But I think it would be hard to convince everyone (maybe even myself) that things like NodeRuntime or UvVenvManager should be in LSP.
I guess the only relevant method is |
This comment was marked as resolved.
This comment was marked as resolved.
| | `name()` | Removed - derived automatically from the package name and exposed as a `name` property | | ||
| | `configuration()` | Removed - settings file located automatically | |
There was a problem hiding this comment.
Let say that we want to override project settings for a LSP-rust-analyzer
Currently we need to specify
{
// folders: [
// ...
// ]
"settings": {
"LSP": {
"rust-analyzer": {
"settings": {
//Setting-here
}
}
}
}
}
In the old API the key in project overrides, I think, Was the config name.
With the new API in this PR,
the key value that we need to specify in project overrides is still the name property? (Not the PackageName) Is that right?
There was a problem hiding this comment.
With the new plugin API it would the package-name so it's a breaking change. It was discussed in #2739 (comment) but kinda left without final conclusion.
|
We might want to consider (re)adding
|
"Introduce new plugin API" is a little over the top. I just wanted to jump-start it with one new method to allow for progressive enhancement and get early feedback.The new
handle_update_or_installation_asyncmethod combinesneeds_update_or_installationandinstall_or_update. Those were split because the code setsinstalling...status text ifneeds_update_or_installationreturns true but that meant that various if checks had to be duplicated across those two and generally made the logic harder to read. With this one method, there is now a callable function passed that can be used to start the progress (perhaps unnecessary since user could useconfiguration.set_view_statusbut then that would likely lead to inconsistent status messages across packages).The new method takes a dict with params. This is to allow adding new params without breaking API compatibility.
Most class methods are passed
PluginContextnow withconfigurationinstance now to allow packages to get resolved configuration. Some packages currently read settings withsublime.load_settingsbut that has the problem of not considering project overrides.Resolves #2039
Resolves #2491