@@ -37,7 +37,7 @@ export function registerTraceCommand(
37
37
outputChannel : vscode . LogOutputChannel
38
38
) : void {
39
39
context . subscriptions . push (
40
- vscode . commands . registerCommand ( 'csharp.recordTrace ' , async ( ) => {
40
+ vscode . commands . registerCommand ( 'csharp.recordLanguageServerTrace ' , async ( ) => {
41
41
await vscode . window . withProgress (
42
42
{
43
43
location : vscode . ProgressLocation . Notification ,
@@ -86,9 +86,9 @@ async function executeDotNetTraceCommand(
86
86
throw new Error ( vscode . l10n . t ( 'Language server process not found, ensure the server is running.' ) ) ;
87
87
}
88
88
89
- let traceFolder : string | undefined = '' ;
89
+ let traceFolderUri : vscode . Uri | undefined ;
90
90
if ( vscode . workspace . workspaceFolders && vscode . workspace . workspaceFolders ?. length >= 1 ) {
91
- traceFolder = vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath ;
91
+ traceFolderUri = vscode . workspace . workspaceFolders [ 0 ] . uri ;
92
92
}
93
93
94
94
// Prompt the user for the folder to save the trace file
@@ -97,7 +97,7 @@ async function executeDotNetTraceCommand(
97
97
canSelectFiles : false ,
98
98
canSelectFolders : true ,
99
99
canSelectMany : false ,
100
- defaultUri : traceFolder ? vscode . Uri . file ( traceFolder ) : undefined ,
100
+ defaultUri : traceFolderUri ? traceFolderUri : undefined ,
101
101
openLabel : vscode . l10n . t ( 'Select Trace Folder' ) ,
102
102
title : vscode . l10n . t ( 'Select Folder to Save Trace File' ) ,
103
103
} ) ;
@@ -107,7 +107,7 @@ async function executeDotNetTraceCommand(
107
107
return ;
108
108
}
109
109
110
- traceFolder = uris [ 0 ] . fsPath ;
110
+ const traceFolder = uris [ 0 ] . fsPath ;
111
111
112
112
if ( ! fs . existsSync ( traceFolder ) ) {
113
113
throw new Error ( vscode . l10n . t ( `Folder for trace file {0} does not exist` , traceFolder ) ) ;
@@ -129,14 +129,14 @@ async function executeDotNetTraceCommand(
129
129
return ;
130
130
}
131
131
132
- const terminal = await getOrCreateTerminal ( traceFolder , outputChannel ) ;
133
-
134
132
const dotnetTraceInstalled = await verifyOrAcquireDotnetTrace ( traceFolder , progress , outputChannel ) ;
135
133
if ( ! dotnetTraceInstalled ) {
136
134
// Cancelled or unable to install dotnet-trace
137
135
return ;
138
136
}
139
137
138
+ const terminal = await getOrCreateTerminal ( traceFolder , outputChannel ) ;
139
+
140
140
const args = [ 'collect' , ...userArgs . split ( ' ' ) ] ;
141
141
142
142
progress . report ( { message : vscode . l10n . t ( 'Recording trace...' ) } ) ;
0 commit comments