From 9b281cd5a271360501ddca6d8f6aee920bd9ba2c Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 11 Jan 2025 17:16:27 +0100 Subject: Misc: Improve lsp errors --- build.zig | 11 +++++++++++ flake.nix | 1 + 2 files changed, 12 insertions(+) diff --git a/build.zig b/build.zig index 8774f19..50c7bc4 100644 --- a/build.zig +++ b/build.zig @@ -38,6 +38,17 @@ pub fn build(b: *std.Build) void { // step when running `zig build`). b.installArtifact(exe); + // This is needed for better lsp errors + const exe_check = b.addExecutable(.{ + .name = "interpreter-lsp", + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + + const check = b.step("check", "Check if foo compiles"); + check.dependOn(&exe_check.step); + // This *creates* a Run step in the build graph, to be executed when another // step is evaluated that depends on it. The next line below will establish // such a dependency. diff --git a/flake.nix b/flake.nix index b84930d..d638325 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ pkgs.mkShell { buildInputs = with pkgs; [ zig.packages."${system}".master + zls ]; }; in { -- cgit 1.4.1