Skip to content

Commit 9513480

Browse files
committed
fix: debug telemetry missing and terminate tasks failure
1 parent bfab5b0 commit 9513480

File tree

2 files changed

+31
-25
lines changed

2 files changed

+31
-25
lines changed

packages/vscode-extension/src/debug/officeTaskHandler.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@ function isDebugPreLaunchTask(task: vscode.Task): boolean {
5959
// Debug: Excel Desktop
6060
if (task.execution && <vscode.ShellExecution>task.execution) {
6161
const execution = <vscode.ShellExecution>task.execution;
62-
if (execution.command) {
63-
const commandLine =
64-
execution.commandLine ||
65-
`${
66-
typeof execution.command === "string" ? execution.command : execution.command.value
67-
} ${(execution.args || []).join(" ")}`;
68-
if (/npm[\s]+run[\s]+start:desktop -- --app (word|excel|powerpoint)/i.test(commandLine)) {
69-
return true;
70-
}
62+
const commandLine =
63+
execution.commandLine ||
64+
`${
65+
execution.command
66+
? typeof execution.command === "string"
67+
? execution.command
68+
: execution.command.value
69+
: ""
70+
} ${(execution.args || []).join(" ")}`;
71+
if (/npm[\s]+run[\s]+start:desktop -- --app (word|excel|powerpoint)/i.test(commandLine)) {
72+
return true;
7173
}
7274
}
7375
}

packages/vscode-extension/src/debug/teamsfxTaskHandler.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ function isTeamsfxTask(task: vscode.Task): boolean {
139139
let commandLine: string | undefined;
140140
if (task.execution && <vscode.ShellExecution>task.execution) {
141141
const execution = <vscode.ShellExecution>task.execution;
142-
if (execution.command) {
143-
commandLine =
144-
execution.commandLine ||
145-
`${
146-
typeof execution.command === "string" ? execution.command : execution.command.value
147-
} ${(execution.args || []).join(" ")}`;
148-
}
142+
commandLine =
143+
execution.commandLine ||
144+
`${
145+
execution.command
146+
? typeof execution.command === "string"
147+
? execution.command
148+
: execution.command.value
149+
: ""
150+
} ${(execution.args || []).join(" ")}`;
149151
}
150152
if (commandLine !== undefined) {
151153
if (/(npm|yarn)[\s]+(run )?[\s]*[^:\s]+:teamsfx/i.test(commandLine)) {
@@ -168,15 +170,17 @@ function isLaunchTestToolTask(task: vscode.Task): boolean {
168170
// dev:teamsfx and watch:teamsfx
169171
if (task.execution && <vscode.ShellExecution>task.execution) {
170172
const execution = <vscode.ShellExecution>task.execution;
171-
if (execution.command) {
172-
const commandLine =
173-
execution.commandLine ||
174-
`${
175-
typeof execution.command === "string" ? execution.command : execution.command.value
176-
} ${(execution.args || []).join(" ")}`;
177-
if (/(npm|yarn)[\s]+(run )?[\s]*[^:\s]+:teamsfx:launch-testtool/i.test(commandLine)) {
178-
return true;
179-
}
173+
const commandLine =
174+
execution.commandLine ||
175+
`${
176+
execution.command
177+
? typeof execution.command === "string"
178+
? execution.command
179+
: execution.command.value
180+
: ""
181+
} ${(execution.args || []).join(" ")}`;
182+
if (/(npm|yarn)[\s]+(run )?[\s]*[^:\s]+:teamsfx:launch-testtool/i.test(commandLine)) {
183+
return true;
180184
}
181185
}
182186
}

0 commit comments

Comments
 (0)