zeta: Improve UX for simultaneous LSP and prediction completions (#24024)
Release Notes: - N/A --------- Co-authored-by: Michael Sloan <michael@zed.dev> Co-authored-by: Danilo <danilo@zed.dev> Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
co-authored by
Michael Sloan
Danilo
Richard
parent
b6e680ea3d
commit
4c29e1ff07
@@ -26,7 +26,7 @@ use fs::MTime;
|
||||
use futures::channel::oneshot;
|
||||
use gpui::{
|
||||
AnyElement, App, AppContext as _, Context, Entity, EventEmitter, HighlightStyle, Pixels,
|
||||
SharedString, Task, TaskLabel, Window,
|
||||
SharedString, StyledText, Task, TaskLabel, TextStyle, Window,
|
||||
};
|
||||
use lsp::LanguageServerId;
|
||||
use parking_lot::Mutex;
|
||||
@@ -617,6 +617,11 @@ impl HighlightedText {
|
||||
);
|
||||
highlighted_text.build()
|
||||
}
|
||||
|
||||
pub fn to_styled_text(&self, default_style: &TextStyle) -> StyledText {
|
||||
gpui::StyledText::new(self.text.clone())
|
||||
.with_highlights(default_style, self.highlights.iter().cloned())
|
||||
}
|
||||
}
|
||||
|
||||
impl HighlightedTextBuilder {
|
||||
|
||||
Reference in New Issue
Block a user