zeta: Only send outline and diagnostics when data collection is enabled (#35896)

This data is not currently used by edit predictions - it is only useful
when `can_collect_data == true`.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-08-08 16:16:13 -06:00 committed by GitHub
parent a4f7747c73
commit a1bc6ee75e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 16 deletions

View file

@ -1211,7 +1211,7 @@ pub fn gather_context(
let local_lsp_store =
project.and_then(|project| project.read(cx).lsp_store().read(cx).as_local());
let diagnostic_groups: Vec<(String, serde_json::Value)> =
if let Some(local_lsp_store) = local_lsp_store {
if can_collect_data && let Some(local_lsp_store) = local_lsp_store {
snapshot
.diagnostic_groups(None)
.into_iter()
@ -1245,7 +1245,11 @@ pub fn gather_context(
MAX_CONTEXT_TOKENS,
);
let input_events = make_events_prompt();
let input_outline = prompt_for_outline(&snapshot);
let input_outline = if can_collect_data {
prompt_for_outline(&snapshot)
} else {
String::new()
};
let editable_range = input_excerpt.editable_range.to_offset(&snapshot);
let body = PredictEditsBody {