First pass on fixes
This commit is contained in:
parent
5826d89b97
commit
2f3be75fc7
269 changed files with 1593 additions and 2574 deletions
|
@ -39,11 +39,10 @@ impl SlashCommand for ContextServerSlashCommand {
|
|||
|
||||
fn label(&self, cx: &App) -> language::CodeLabel {
|
||||
let mut parts = vec![self.prompt.name.as_str()];
|
||||
if let Some(args) = &self.prompt.arguments {
|
||||
if let Some(arg) = args.first() {
|
||||
if let Some(args) = &self.prompt.arguments
|
||||
&& let Some(arg) = args.first() {
|
||||
parts.push(arg.name.as_str());
|
||||
}
|
||||
}
|
||||
create_label_for_command(parts[0], &parts[1..], cx)
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,7 @@ impl SlashCommand for DeltaSlashCommand {
|
|||
.metadata
|
||||
.as_ref()
|
||||
.and_then(|value| serde_json::from_value::<FileCommandMetadata>(value.clone()).ok())
|
||||
{
|
||||
if paths.insert(metadata.path.clone()) {
|
||||
&& paths.insert(metadata.path.clone()) {
|
||||
file_command_old_outputs.push(
|
||||
context_buffer
|
||||
.as_rope()
|
||||
|
@ -83,7 +82,6 @@ impl SlashCommand for DeltaSlashCommand {
|
|||
cx,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cx.background_spawn(async move {
|
||||
|
@ -95,10 +93,9 @@ impl SlashCommand for DeltaSlashCommand {
|
|||
.into_iter()
|
||||
.zip(file_command_new_outputs)
|
||||
{
|
||||
if let Ok(new_output) = new_output {
|
||||
if let Ok(new_output) = SlashCommandOutput::from_event_stream(new_output).await
|
||||
{
|
||||
if let Some(file_command_range) = new_output.sections.first() {
|
||||
if let Ok(new_output) = new_output
|
||||
&& let Ok(new_output) = SlashCommandOutput::from_event_stream(new_output).await
|
||||
&& let Some(file_command_range) = new_output.sections.first() {
|
||||
let new_text = &new_output.text[file_command_range.range.clone()];
|
||||
if old_text.chars().ne(new_text.chars()) {
|
||||
changes_detected = true;
|
||||
|
@ -114,8 +111,6 @@ impl SlashCommand for DeltaSlashCommand {
|
|||
output.text.push_str(&new_output.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anyhow::ensure!(changes_detected, "no new changes detected");
|
||||
|
|
|
@ -280,11 +280,10 @@ fn collect_diagnostics(
|
|||
|
||||
let mut project_summary = DiagnosticSummary::default();
|
||||
for (project_path, path, summary) in diagnostic_summaries {
|
||||
if let Some(path_matcher) = &options.path_matcher {
|
||||
if !path_matcher.is_match(&path) {
|
||||
if let Some(path_matcher) = &options.path_matcher
|
||||
&& !path_matcher.is_match(&path) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
project_summary.error_count += summary.error_count;
|
||||
if options.include_warnings {
|
||||
|
|
|
@ -195,17 +195,14 @@ fn tab_items_for_queries(
|
|||
}
|
||||
|
||||
for editor in workspace.items_of_type::<Editor>(cx) {
|
||||
if let Some(buffer) = editor.read(cx).buffer().read(cx).as_singleton() {
|
||||
if let Some(timestamp) =
|
||||
if let Some(buffer) = editor.read(cx).buffer().read(cx).as_singleton()
|
||||
&& let Some(timestamp) =
|
||||
timestamps_by_entity_id.get(&editor.entity_id())
|
||||
{
|
||||
if visited_buffers.insert(buffer.read(cx).remote_id()) {
|
||||
&& visited_buffers.insert(buffer.read(cx).remote_id()) {
|
||||
let snapshot = buffer.read(cx).snapshot();
|
||||
let full_path = snapshot.resolve_file_path(cx, true);
|
||||
open_buffers.push((full_path, snapshot, *timestamp));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(open_buffers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue