@@ -188,6 +188,26 @@ function registerCommands(context: vscode.ExtensionContext): void {
188188 }
189189 } )
190190 ) ;
191+
192+ context . subscriptions . push (
193+ vscode . commands . registerCommand ( 'vbnet.showLogs' , async ( ) => {
194+ outputChannel ?. show ( ) ;
195+ traceChannel ?. show ( ) ;
196+ outputChannel ?. appendLine ( `Log directory: ${ context . logUri . fsPath } ` ) ;
197+ } )
198+ ) ;
199+
200+ context . subscriptions . push (
201+ vscode . commands . registerCommand ( 'vbnet.toggleLspTrace' , async ( ) => {
202+ try {
203+ await toggleLspTrace ( ) ;
204+ } catch ( error ) {
205+ const message = error instanceof Error ? error . message : String ( error ) ;
206+ outputChannel ?. appendLine ( `Failed to toggle LSP trace: ${ message } ` ) ;
207+ vscode . window . showErrorMessage ( `Failed to toggle LSP trace: ${ message } ` ) ;
208+ }
209+ } )
210+ ) ;
191211}
192212
193213interface SolutionPickItem extends vscode . QuickPickItem {
@@ -299,6 +319,25 @@ async function solutionLikelyHasVbProjects(solutionPath: string): Promise<boolea
299319 }
300320}
301321
322+ async function toggleLspTrace ( ) : Promise < void > {
323+ const config = vscode . workspace . getConfiguration ( 'vbnet' ) ;
324+ const current = config . get < string > ( 'trace.server' , 'off' ) ;
325+ const enabled = current === 'off' ;
326+ const next = enabled ? 'verbose' : 'off' ;
327+
328+ await config . update ( 'trace.server' , next , vscode . ConfigurationTarget . Workspace ) ;
329+
330+ if ( enabled ) {
331+ traceChannel ?. show ( ) ;
332+ }
333+
334+ const message = enabled
335+ ? 'VB.NET LSP trace enabled (verbose).'
336+ : 'VB.NET LSP trace disabled.' ;
337+ outputChannel ?. appendLine ( message ) ;
338+ vscode . window . showInformationMessage ( message ) ;
339+ }
340+
302341/**
303342 * Extension deactivation.
304343 * Called when the extension is deactivated.
0 commit comments