Show inline completions inside the completion menu if both are available (#22093)
Screenshot:  Demo: https://github.com/user-attachments/assets/70197042-4785-4e45-80fd-29d12e68333f (Note for Joseph/Peter: this supersedes https://github.com/zed-industries/zed/pull/22069) Release Notes: - Changed inline completions to show up inside the normal completions in case LSP and inline-completions are available. In that case, the inline completion will be the first entry in the menu and can be selected with `<tab>`. --------- Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Danilo <danilo@zed.dev>
This commit is contained in:
parent
cc56ed7a88
commit
95334cb0ad
11 changed files with 661 additions and 429 deletions
|
@ -19,6 +19,7 @@ pub struct InlineCompletion {
|
|||
|
||||
pub trait InlineCompletionProvider: 'static + Sized {
|
||||
fn name() -> &'static str;
|
||||
fn display_name() -> &'static str;
|
||||
fn is_enabled(
|
||||
&self,
|
||||
buffer: &Model<Buffer>,
|
||||
|
@ -51,6 +52,7 @@ pub trait InlineCompletionProvider: 'static + Sized {
|
|||
|
||||
pub trait InlineCompletionProviderHandle {
|
||||
fn name(&self) -> &'static str;
|
||||
fn display_name(&self) -> &'static str;
|
||||
fn is_enabled(
|
||||
&self,
|
||||
buffer: &Model<Buffer>,
|
||||
|
@ -89,6 +91,10 @@ where
|
|||
T::name()
|
||||
}
|
||||
|
||||
fn display_name(&self) -> &'static str {
|
||||
T::display_name()
|
||||
}
|
||||
|
||||
fn is_enabled(
|
||||
&self,
|
||||
buffer: &Model<Buffer>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue