Skip to content

Commit

Permalink
remove the "Open ZLS Config" command
Browse files Browse the repository at this point in the history
This command may let users think that this is where they are supposed
to configure ZLS which is not the case when using VS Code.
  • Loading branch information
Techatrix authored and Vexu committed Apr 3, 2024
1 parent 0098c1d commit 0adc753
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@
"title": "Stop Server",
"category": "Zig Language Server"
},
{
"command": "zig.zls.openconfig",
"title": "Open ZLS Config",
"category": "Zig Language Server"
},
{
"command": "zig.zls.update",
"title": "Check for Server Updates",
Expand Down
14 changes: 0 additions & 14 deletions src/zls.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import vscode from "vscode";

import childProcess from "child_process";
import fs from "fs";

import { LanguageClient, LanguageClientOptions, ResponseError, ServerOptions } from "vscode-languageclient/node";
Expand Down Expand Up @@ -270,13 +269,6 @@ async function installVersion(context: vscode.ExtensionContext, version: semver.
);
}

async function openConfig() {
const zlsPath = getZLSPath();
const buffer = childProcess.execFileSync(zlsPath, ["--show-config-path"]);
const path: string = buffer.toString("utf8").trimEnd();
await vscode.window.showTextDocument(vscode.Uri.file(path), { preview: false });
}

function checkInstalled(): boolean {
const zlsPath = vscode.workspace.getConfiguration("zig.zls").get<string>("path");
if (!zlsPath) {
Expand Down Expand Up @@ -317,12 +309,6 @@ export async function activate(context: vscode.ExtensionContext) {
await startClient();
});

vscode.commands.registerCommand("zig.zls.openconfig", async () => {
if (!checkInstalled()) return;

await openConfig();
});

vscode.commands.registerCommand("zig.zls.update", async () => {
if (!checkInstalled()) return;

Expand Down

0 comments on commit 0adc753

Please sign in to comment.