6
6
7
7
import * as vscode from 'vscode' ;
8
8
import * as which from 'which' ;
9
+ import { window , type OutputChannel } from 'vscode' ;
9
10
10
11
import {
11
12
LanguageClient ,
@@ -15,6 +16,7 @@ import {
15
16
import { time } from 'console' ;
16
17
17
18
let client : LanguageClient ;
19
+ let outputChannel : OutputChannel ;
18
20
19
21
function findNushellExecutable ( ) : string | null {
20
22
try {
@@ -48,6 +50,8 @@ function startLanguageServer(
48
50
context : vscode . ExtensionContext ,
49
51
found_nushell_path : string ,
50
52
) : void {
53
+ outputChannel = window . createOutputChannel ( 'Nushell LSP Output' , 'log' ) ;
54
+
51
55
// Use Nushell's native LSP server
52
56
const serverOptions : ServerOptions = {
53
57
run : {
@@ -62,6 +66,11 @@ function startLanguageServer(
62
66
63
67
// Options to control the language client
64
68
const clientOptions : LanguageClientOptions = {
69
+ outputChannelName : 'Nushell Language Server' ,
70
+ markdown : {
71
+ isTrusted : true ,
72
+ supportHtml : true ,
73
+ } ,
65
74
initializationOptions : {
66
75
timeout : 10000 , // 10 seconds
67
76
} ,
@@ -168,6 +177,10 @@ export function activate(context: vscode.ExtensionContext) {
168
177
return ;
169
178
}
170
179
180
+ context . subscriptions . push ( outputChannel ) ;
181
+ console . log ( `Found nushell executable at: ${ found_nushell_path } ` ) ;
182
+ console . log ( 'Activating Nushell Language Server extension.' ) ;
183
+
171
184
// Start the language server when the extension is activated
172
185
startLanguageServer ( context , found_nushell_path ) ;
173
186
0 commit comments