66
77import * as vscode from 'vscode' ;
88import * as which from 'which' ;
9+ import { window , type OutputChannel } from 'vscode' ;
910
1011import {
1112 LanguageClient ,
@@ -15,6 +16,7 @@ import {
1516import { time } from 'console' ;
1617
1718let client : LanguageClient ;
19+ let outputChannel : OutputChannel ;
1820
1921function findNushellExecutable ( ) : string | null {
2022 try {
@@ -48,6 +50,8 @@ function startLanguageServer(
4850 context : vscode . ExtensionContext ,
4951 found_nushell_path : string ,
5052) : void {
53+ outputChannel = window . createOutputChannel ( 'Nushell LSP Output' , 'log' ) ;
54+
5155 // Use Nushell's native LSP server
5256 const serverOptions : ServerOptions = {
5357 run : {
@@ -62,6 +66,11 @@ function startLanguageServer(
6266
6367 // Options to control the language client
6468 const clientOptions : LanguageClientOptions = {
69+ outputChannelName : 'Nushell Language Server' ,
70+ markdown : {
71+ isTrusted : true ,
72+ supportHtml : true ,
73+ } ,
6574 initializationOptions : {
6675 timeout : 10000 , // 10 seconds
6776 } ,
@@ -168,6 +177,10 @@ export function activate(context: vscode.ExtensionContext) {
168177 return ;
169178 }
170179
180+ context . subscriptions . push ( outputChannel ) ;
181+ console . log ( `Found nushell executable at: ${ found_nushell_path } ` ) ;
182+ console . log ( 'Activating Nushell Language Server extension.' ) ;
183+
171184 // Start the language server when the extension is activated
172185 startLanguageServer ( context , found_nushell_path ) ;
173186
0 commit comments