Skip to content

Commit 69d88f8

Browse files
committed
Adds Git command palette mode tracking
1 parent 1fe4e3c commit 69d88f8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/system/command.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ export function registerCommand(command: string, callback: CommandCallback, this
2222
return commands.registerCommand(
2323
command,
2424
function (this: any, ...args) {
25-
Container.instance.telemetry.sendEvent('command', { command: command });
25+
let context: any;
26+
if (command === Commands.GitCommands) {
27+
const arg = args?.[0];
28+
if (arg?.command != null) {
29+
context = { mode: args[0].command };
30+
if (arg?.state?.subcommand != null) {
31+
context.submode = arg.state.subcommand;
32+
}
33+
}
34+
}
35+
Container.instance.telemetry.sendEvent('command', { command: command, context: context });
2636
callback.call(this, ...args);
2737
},
2838
thisArg,

0 commit comments

Comments
 (0)