Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 58 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
"libsodium-wrappers": "^0.7.15",
"lodash-es": "^4.17.21",
"semver": "^7.5.2",
"vscode-languageclient": "8.0.2-next.5",
"vscode-languageclient": "10.0.0-next.15",
"which": "^3.0.0"
}
}
9 changes: 4 additions & 5 deletions src/zls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import vscode from "vscode";
import {
CancellationToken,
ConfigurationParams,
DocumentSelector,
LSPAny,
LanguageClient,
LanguageClientOptions,
Expand All @@ -19,14 +18,14 @@ import * as versionManager from "./versionManager";
import { getHostZigName, handleConfigOption, resolveExePathAndVersion, workspaceConfigUpdateNoThrow } from "./zigUtil";
import { zigProvider } from "./zigSetup";

const ZIG_MODE: DocumentSelector = [
const ZIG_MODE = [
{ language: "zig", scheme: "file" },
{ language: "zig", scheme: "untitled" },
];

let versionManagerConfig: versionManager.Config;
let statusItem: vscode.LanguageStatusItem;
let outputChannel: vscode.OutputChannel;
let outputChannel: vscode.LogOutputChannel;
export let client: LanguageClient | null = null;

export async function restartClient(context: vscode.ExtensionContext): Promise<void> {
Expand Down Expand Up @@ -87,7 +86,7 @@ async function startClient(zlsPath: string, zlsVersion: semver.SemVer): Promise<
const languageClient = new LanguageClient("zig.zls", "ZLS language server", serverOptions, clientOptions);
await languageClient.start();
// Formatting is handled by `zigFormat.ts`
languageClient.getFeature("textDocument/formatting").dispose();
languageClient.getFeature("textDocument/formatting").clear();
return languageClient;
}

Expand Down Expand Up @@ -439,7 +438,7 @@ export async function activate(context: vscode.ExtensionContext) {
},
};

outputChannel = vscode.window.createOutputChannel("ZLS language server");
outputChannel = vscode.window.createOutputChannel("ZLS language server", { log: true });
statusItem = vscode.languages.createLanguageStatusItem("zig.zls.status", ZIG_MODE);
statusItem.name = "ZLS";
updateStatusItem(null);
Expand Down