mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
only render retrieve context button if semantic index is enabled
This commit is contained in:
parent
166ca2a227
commit
ed894cc06f
2 changed files with 16 additions and 13 deletions
|
@ -2750,18 +2750,22 @@ impl View for InlineAssistant {
|
|||
.element()
|
||||
.aligned(),
|
||||
)
|
||||
.with_child(
|
||||
Button::action(ToggleRetrieveContext)
|
||||
.with_tooltip("Retrieve Context", theme.tooltip.clone())
|
||||
.with_id(self.id)
|
||||
.with_contents(theme::components::svg::Svg::new(
|
||||
"icons/magnifying_glass.svg",
|
||||
))
|
||||
.toggleable(self.retrieve_context)
|
||||
.with_style(theme.assistant.inline.retrieve_context.clone())
|
||||
.element()
|
||||
.aligned(),
|
||||
)
|
||||
.with_children(if SemanticIndex::enabled(cx) {
|
||||
Some(
|
||||
Button::action(ToggleRetrieveContext)
|
||||
.with_tooltip("Retrieve Context", theme.tooltip.clone())
|
||||
.with_id(self.id)
|
||||
.with_contents(theme::components::svg::Svg::new(
|
||||
"icons/magnifying_glass.svg",
|
||||
))
|
||||
.toggleable(self.retrieve_context)
|
||||
.with_style(theme.assistant.inline.retrieve_context.clone())
|
||||
.element()
|
||||
.aligned(),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
})
|
||||
.with_children(if let Some(error) = self.codegen.read(cx).error() {
|
||||
Some(
|
||||
Svg::new("icons/error.svg")
|
||||
|
|
|
@ -2,7 +2,6 @@ use crate::codegen::CodegenKind;
|
|||
use language::{BufferSnapshot, OffsetRangeExt, ToOffset};
|
||||
use std::cmp::{self, Reverse};
|
||||
use std::fmt::Write;
|
||||
use std::iter;
|
||||
use std::ops::Range;
|
||||
use tiktoken_rs::ChatCompletionRequestMessage;
|
||||
|
||||
|
|
Loading…
Reference in a new issue