Uncomment Editor::report_editor_event
This commit is contained in:
parent
0dfa3c60b7
commit
97d1d9bd9b
3 changed files with 38 additions and 38 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2657,6 +2657,7 @@ dependencies = [
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
"serde_json",
|
||||||
"settings2",
|
"settings2",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"smol",
|
"smol",
|
||||||
|
|
|
@ -62,6 +62,7 @@ postage.workspace = true
|
||||||
rand.workspace = true
|
rand.workspace = true
|
||||||
schemars.workspace = true
|
schemars.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
serde_derive.workspace = true
|
serde_derive.workspace = true
|
||||||
smallvec.workspace = true
|
smallvec.workspace = true
|
||||||
smol.workspace = true
|
smol.workspace = true
|
||||||
|
|
|
@ -8981,45 +8981,43 @@ impl Editor {
|
||||||
file_extension: Option<String>,
|
file_extension: Option<String>,
|
||||||
cx: &AppContext,
|
cx: &AppContext,
|
||||||
) {
|
) {
|
||||||
todo!("old version below");
|
let Some(project) = &self.project else { return };
|
||||||
|
|
||||||
|
// If None, we are in a file without an extension
|
||||||
|
let file = self
|
||||||
|
.buffer
|
||||||
|
.read(cx)
|
||||||
|
.as_singleton()
|
||||||
|
.and_then(|b| b.read(cx).file());
|
||||||
|
let file_extension = file_extension.or(file
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|file| Path::new(file.file_name(cx)).extension())
|
||||||
|
.and_then(|e| e.to_str())
|
||||||
|
.map(|a| a.to_string()));
|
||||||
|
|
||||||
|
let vim_mode = cx
|
||||||
|
.global::<SettingsStore>()
|
||||||
|
.raw_user_settings()
|
||||||
|
.get("vim_mode")
|
||||||
|
== Some(&serde_json::Value::Bool(true));
|
||||||
|
let telemetry_settings = *TelemetrySettings::get_global(cx);
|
||||||
|
let copilot_enabled = all_language_settings(file, cx).copilot_enabled(None, None);
|
||||||
|
let copilot_enabled_for_language = self
|
||||||
|
.buffer
|
||||||
|
.read(cx)
|
||||||
|
.settings_at(0, cx)
|
||||||
|
.show_copilot_suggestions;
|
||||||
|
|
||||||
|
let telemetry = project.read(cx).client().telemetry().clone();
|
||||||
|
let event = ClickhouseEvent::Editor {
|
||||||
|
file_extension,
|
||||||
|
vim_mode,
|
||||||
|
operation,
|
||||||
|
copilot_enabled,
|
||||||
|
copilot_enabled_for_language,
|
||||||
|
};
|
||||||
|
telemetry.report_clickhouse_event(event, telemetry_settings)
|
||||||
}
|
}
|
||||||
// let Some(project) = &self.project else { return };
|
|
||||||
|
|
||||||
// // If None, we are in a file without an extension
|
|
||||||
// let file = self
|
|
||||||
// .buffer
|
|
||||||
// .read(cx)
|
|
||||||
// .as_singleton()
|
|
||||||
// .and_then(|b| b.read(cx).file());
|
|
||||||
// let file_extension = file_extension.or(file
|
|
||||||
// .as_ref()
|
|
||||||
// .and_then(|file| Path::new(file.file_name(cx)).extension())
|
|
||||||
// .and_then(|e| e.to_str())
|
|
||||||
// .map(|a| a.to_string()));
|
|
||||||
|
|
||||||
// let vim_mode = cx
|
|
||||||
// .global::<SettingsStore>()
|
|
||||||
// .raw_user_settings()
|
|
||||||
// .get("vim_mode")
|
|
||||||
// == Some(&serde_json::Value::Bool(true));
|
|
||||||
// let telemetry_settings = *settings::get::<TelemetrySettings>(cx);
|
|
||||||
// let copilot_enabled = all_language_settings(file, cx).copilot_enabled(None, None);
|
|
||||||
// let copilot_enabled_for_language = self
|
|
||||||
// .buffer
|
|
||||||
// .read(cx)
|
|
||||||
// .settings_at(0, cx)
|
|
||||||
// .show_copilot_suggestions;
|
|
||||||
|
|
||||||
// let telemetry = project.read(cx).client().telemetry().clone();
|
|
||||||
// let event = ClickhouseEvent::Editor {
|
|
||||||
// file_extension,
|
|
||||||
// vim_mode,
|
|
||||||
// operation,
|
|
||||||
// copilot_enabled,
|
|
||||||
// copilot_enabled_for_language,
|
|
||||||
// };
|
|
||||||
// telemetry.report_clickhouse_event(event, telemetry_settings)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// /// Copy the highlighted chunks to the clipboard as JSON. The format is an array of lines,
|
// /// Copy the highlighted chunks to the clipboard as JSON. The format is an array of lines,
|
||||||
// /// with each line being an array of {text, highlight} objects.
|
// /// with each line being an array of {text, highlight} objects.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue