Make completions an opt-in LSP feature#17921
Merged
charliermarsh merged 1 commit intomainfrom May 7, 2025
Merged
Conversation
MichaReiser
approved these changes
May 7, 2025
| crate::version(), | ||
| )?; | ||
|
|
||
| crate::message::init_messenger(connection.make_sender()); |
Member
There was a problem hiding this comment.
I think it's important that init_logging (line 53) happens after init_messenger
Member
There was a problem hiding this comment.
Yeah, I think so too. The messenger needs to be initialized first because it's being used when serializing the initialization options. If there are invalid initialization options, it requires the messenger to provide a notification to the user.
dhruvmanila
approved these changes
May 7, 2025
|
|
||
| impl Experimental { | ||
| /// Returns `true` if completions are enabled in the settings. | ||
| pub(crate) fn enable_completions(&self) -> bool { |
05fbcbc to
ba70a97
Compare
Contributor
|
dcreager
added a commit
that referenced
this pull request
May 7, 2025
…lass * origin/main: [`pylint`] add fix safety section (`PLC2801`) (#17825) Add instructions on how to upgrade to a newer Rust version (#17928) [parser] Flag single unparenthesized generator expr with trailing comma in arguments. (#17893) [ty] Ensure that `T` is disjoint from `~T` even when `T` is a TypeVar (#17922) [ty] Sort collected diagnostics before snapshotting them in mdtest (#17926) [ty] Add basic file watching to server (#17912) Make completions an opt-in LSP feature (#17921) Add link to `ty` issue tracker (#17924) [ty] Add support for `__all__` (#17856) [ty] fix assigning a typevar to a union with itself (#17910) [ty] Improve UX for `[duplicate-base]` diagnostics (#17914) Clean up some Ruff references in the ty server (#17920)
BurntSushi
added a commit
that referenced
this pull request
Jun 12, 2025
Specifically, this PR reverts "Make completions an opt-in LSP feature (#17921)", corresponding to commit 51e2eff. In practice, this means you don't need to opt into completions working by enabling experimental features. i.e., I was able to remove this from my LSP configuration: ``` "experimental": { "completions": { "enable": true } }, ``` There's still a lot of work left to do to make completions awesome, but I think it's in a state where it would be useful to get real user feedback. It's also meaningfully using ty to provide completions that use type information. Ref astral-sh/ty#86
BurntSushi
added a commit
that referenced
this pull request
Jun 16, 2025
Specifically, this PR reverts "Make completions an opt-in LSP feature (#17921)", corresponding to commit 51e2eff. In practice, this means you don't need to opt into completions working by enabling experimental features. i.e., I was able to remove this from my LSP configuration: ``` "experimental": { "completions": { "enable": true } }, ``` There's still a lot of work left to do to make completions awesome, but I think it's in a state where it would be useful to get real user feedback. It's also meaningfully using ty to provide completions that use type information. Ref astral-sh/ty#86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
We now expect the client to send initialization options to opt-in to experimental (but LSP-standardized) features, like completion support. Specifically, the client should set
"experimental.completions.enable": true.Closes astral-sh/ty#74.