Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix detection of unset path options #185

Merged
merged 1 commit into from
Apr 2, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"scope": "machine-overridable",
"type": "string",
"default": "",
"description": "Path to `zls` executable. Example: `C:/zls/zig-cache/bin/zls.exe`.",
"description": "Path to `zls` executable. Example: `C:/zls/zig-cache/bin/zls.exe`. Empty string will lookup ZLS in PATH.",
"format": "path"
},
"zig.zls.enableSnippets": {
Expand Down
4 changes: 2 additions & 2 deletions src/zigSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export async function setupZig(context: vscode.ExtensionContext) {
async function initialSetup(context: vscode.ExtensionContext): Promise<boolean> {
const zigConfig = vscode.workspace.getConfiguration("zig");

if (!zigConfig.has("path")) {
if (zigConfig.get<string>("path") === "") {
const zigResponse = await vscode.window.showInformationMessage(
"Zig path hasn't been set, do you want to specify the path or install Zig?",
{ modal: true },
Expand Down Expand Up @@ -273,7 +273,7 @@ async function initialSetup(context: vscode.ExtensionContext): Promise<boolean>

const zlsConfig = vscode.workspace.getConfiguration("zig.zls");

if (!zlsConfig.has("path")) {
if (zlsConfig.get<string>("path") === "") {
const zlsResponse = await vscode.window.showInformationMessage(
"We recommend enabling ZLS (the Zig Language Server) for a better editing experience. Would you like to install it?",
{ modal: true },
Expand Down