Skip to content

Commit 4c4a348

Browse files
committed
rudimentary logging
1 parent fefd976 commit 4c4a348

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

client/src/extension.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import * as vscode from 'vscode';
88
import * as which from 'which';
9+
import { window, type OutputChannel } from 'vscode';
910

1011
import {
1112
LanguageClient,
@@ -15,6 +16,7 @@ import {
1516
import { time } from 'console';
1617

1718
let client: LanguageClient;
19+
let outputChannel: OutputChannel;
1820

1921
function 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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "vscode-nushell-lang",
44
"description": "nushell language for vscode",
55
"author": "The Nushell Project Developers",
6-
"version": "2.0.1",
6+
"version": "2.0.2",
77
"preview": false,
88
"license": "MIT",
99
"publisher": "TheNuProjectContributors",

0 commit comments

Comments
 (0)