Don't suggest assistant code actions if it's disabled (#19553)
Closes #19155 Release Notes: - Fixed code action for "Fix with assistant" appearing when assistant was disabled.
This commit is contained in:
parent
edda149d75
commit
ce11ca9d49
1 changed files with 4 additions and 0 deletions
|
@ -3277,6 +3277,10 @@ impl CodeActionProvider for AssistantCodeActionProvider {
|
||||||
range: Range<text::Anchor>,
|
range: Range<text::Anchor>,
|
||||||
cx: &mut WindowContext,
|
cx: &mut WindowContext,
|
||||||
) -> Task<Result<Vec<CodeAction>>> {
|
) -> Task<Result<Vec<CodeAction>>> {
|
||||||
|
if !AssistantSettings::get_global(cx).enabled {
|
||||||
|
return Task::ready(Ok(Vec::new()));
|
||||||
|
}
|
||||||
|
|
||||||
let snapshot = buffer.read(cx).snapshot();
|
let snapshot = buffer.read(cx).snapshot();
|
||||||
let mut range = range.to_point(&snapshot);
|
let mut range = range.to_point(&snapshot);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue