Skip to content
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 .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: mlugg/setup-zig@v2
if: env.SKIP_DEPLOY != 'true'
with:
version: master
version: 0.16.0

- name: Install APT packages
if: env.SKIP_DEPLOY != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: mlugg/setup-zig@v2
with:
version: master
version: 0.16.0

- name: Install kcov
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: mlugg/setup-zig@v2
with:
version: master
version: 0.16.0

- name: Run zig fmt
if: matrix.os == 'ubuntu-22.04'
Expand Down
10 changes: 5 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const zls_version = std.SemanticVersion.parse(@import("build.zig.zon").version)
const minimum_build_zig_version = @import("build.zig.zon").minimum_zig_version;

/// Specify the minimum Zig version that is usable with ZLS:
/// std.Io: move netReceive to become an Operation
/// Release 0.16.0
///
/// A breaking change to the Zig Build System should be handled by updating ZLS's build runner (see src\build_runner)
const minimum_runtime_zig_version = "0.16.0-dev.2736+3b515fbed";
const minimum_runtime_zig_version = "0.16.0";

const release_targets = [_]std.Target.Query{
.{ .cpu_arch = .aarch64, .os_tag = .linux },
Expand Down Expand Up @@ -171,7 +171,7 @@ pub fn build(b: *Build) !void {
artifact.* = b.addExecutable(.{
.name = "zls",
.root_module = exe_module,
.max_rss = if (optimize == .Debug and target_query.os_tag == .wasi) 2_200_000_000 else 1_800_000_000,
.max_rss = if (optimize == .Debug and target_query.os_tag == .wasi) 2_600_000_000 else 2_000_000_000,
.use_llvm = use_llvm,
.use_lld = use_llvm,
});
Expand All @@ -188,7 +188,7 @@ pub fn build(b: *Build) !void {
.build_options = build_options,
.version_data = version_data_module,
});
b.modules.put("zls", zls_module) catch @panic("OOM");
b.modules.put(b.allocator, "zls", zls_module) catch @panic("OOM");

const known_folders_module = b.dependency("known_folders", .{
.target = target,
Expand Down Expand Up @@ -498,7 +498,7 @@ fn release(b: *Build, release_artifacts: []const *Build.Step.Compile, released_z
@"tar.gz",
};

var compressed_artifacts: std.StringArrayHashMapUnmanaged(std.Build.LazyPath) = .empty;
var compressed_artifacts: std.array_hash_map.String(std.Build.LazyPath) = .empty;

for (release_artifacts) |exe| {
const resolved_target = exe.root_module.resolved_target.?.result;
Expand Down
14 changes: 7 additions & 7 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
// nix flake update --commit-lock-file
// ```
// If you do not use Nix, a ZLS maintainer can take care of this.
.minimum_zig_version = "0.16.0-dev.3133+5ec8e45f3",
.minimum_zig_version = "0.16.0",
// Must be kept in sync with the `deps.nix` for the Nix flake.
// If you do not use Nix, a ZLS maintainer can take care of this.
.dependencies = .{
.known_folders = .{
.url = "https://github.com/ziglibs/known-folders/archive/175f5596b3d2ee3c658282bb07885580895a0e73.tar.gz",
.hash = "known_folders-0.0.0-Fy-PJk7KAAC41mQXzmFyGa0Q7tvmQjatENkREa6Gc4zu",
.url = "https://github.com/ziglibs/known-folders/archive/d6d03830968cca6b7b9f24fd97ee348346a6905d.tar.gz",
.hash = "known_folders-0.0.0-Fy-PJk3KAACzUg2us_0JvQQmod1ZA8jBt7MuoKCihq88",
},
.diffz = .{
.url = "https://github.com/ziglibs/diffz/archive/d93d5737d2c19a2fb279c8dcaa80a4ce35529a3b.tar.gz",
.hash = "diffz-0.0.1-G2tlIXvNAQCPPTvl-leqv4d5nfEdwLw2lfE11P7EGKhy",
.url = "https://github.com/ziglibs/diffz/archive/b39fe07e7fdbcf56e43ba2890b9f484f16969f90.tar.gz",
.hash = "diffz-0.0.1-G2tlISzNAQCldmOcINavGmF1zdt20NFPXeM8d07jp_68",
},
.lsp_kit = .{
.url = "https://github.com//zigtools/lsp-kit/archive/ec325a3c33d1da7708cf513355208f74d9560580.tar.gz",
.hash = "lsp_kit-0.1.0-bi_PL_kyDACVTEhLaMq2-PJx0MocqRyjXDAN0ybMUyQQ",
.url = "https://github.com/zigtools/lsp-kit/archive/b886a2b0d5cee85ecbcc3089b863f7517cc9ff7f.tar.gz",
.hash = "lsp_kit-0.1.0-bi_PL3IyDACfp1xdTnkiOHEok2YpPCCCJHuuOcNzjl1D",
},
.tracy = .{
.url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.13.1.tar.gz",
Expand Down
18 changes: 9 additions & 9 deletions deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
}:
linkFarm "zig-packages" [
{
name = "known_folders-0.0.0-Fy-PJk7KAAC41mQXzmFyGa0Q7tvmQjatENkREa6Gc4zu";
name = "known_folders-0.0.0-Fy-PJk3KAACzUg2us_0JvQQmod1ZA8jBt7MuoKCihq88";
path = fetchzip {
url = "https://github.com/ziglibs/known-folders/archive/4575ac4088eb7d0c8421d5b3d642f19de392d898.tar.gz";
hash = "sha256-YE4KRNvrqzMtB7sSPnnbhwCokfNP7RqNtO1QVgwbiBc=";
url = "https://github.com/ziglibs/known-folders/archive/d6d03830968cca6b7b9f24fd97ee348346a6905d.tar.gz";
hash = "sha256-8LlAnEwuoeQuN9V5nUuh2UwXRhS5KOwDkpm6yuOfClk=";
};
}
{
name = "diffz-0.0.1-G2tlIXvNAQCPPTvl-leqv4d5nfEdwLw2lfE11P7EGKhy";
name = "diffz-0.0.1-G2tlISzNAQCldmOcINavGmF1zdt20NFPXeM8d07jp_68";
path = fetchzip {
url = "https://github.com/ziglibs/diffz/archive/d93d5737d2c19a2fb279c8dcaa80a4ce35529a3b.tar.gz";
hash = "sha256-1IDqdr0+74IlH76eovC6m5Ww6bNMAAyHFt1ukat/UXk=";
url = "https://github.com/ziglibs/diffz/archive/b39fe07e7fdbcf56e43ba2890b9f484f16969f90.tar.gz";
hash = "sha256-mmgaOXFpoBYMsNdVkoFa7wJKkiXtzXIbSxRUgWLdVUc=";
};
}
{
name = "lsp_kit-0.1.0-bi_PL_kyDACVTEhLaMq2-PJx0MocqRyjXDAN0ybMUyQQ";
name = "lsp_kit-0.1.0-bi_PL3IyDACfp1xdTnkiOHEok2YpPCCCJHuuOcNzjl1D";
path = fetchzip {
url = "https://github.com/zigtools/lsp-kit/archive/ec325a3c33d1da7708cf513355208f74d9560580.tar.gz";
hash = "sha256-60F2BOCrl3CreQFmpH3HAz6zzxd3VgJ3iSEkP39gtgQ=";
url = "https://github.com/zigtools/lsp-kit/archive/b886a2b0d5cee85ecbcc3089b863f7517cc9ff7f.tar.gz";
hash = "sha256-367wPydvnpl9RYlTrXwk4bZ/ui9DbYjeY/VDYs7ZJRs=";
};
}
]
60 changes: 13 additions & 47 deletions flake.lock

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

14 changes: 10 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";

zig-overlay.url = "github:mitchellh/zig-overlay";
zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
zig-flake.url = "github:silversquirl/zig-flake";
zig-flake.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = {
self,
nixpkgs,
zig-overlay,
zig-flake,
}: let
lib = nixpkgs.lib;
parseVersionFieldFromZon = name:
Expand All @@ -18,6 +18,7 @@
(builtins.match ".*\n[[:space:]]*\\.${name}[[:space:]]=[[:space:]]\"([^\"]+)\".*")
builtins.head
];
minimum_zig_version = parseVersionFieldFromZon "minimum_zig_version";
zlsVersionShort = parseVersionFieldFromZon "version";
zlsVersionFull =
zlsVersionShort
Expand All @@ -33,7 +34,12 @@
system: let
pkgs = nixpkgs.legacyPackages.${system};
fs = lib.fileset;
zig = zig-overlay.packages.${system}.master;
zigVersion = lib.pipe minimum_zig_version [
builtins.splitVersion
(lib.sublist 0 5)
(lib.concatStringsSep "_")
];
zig = zig-flake.packages.${system}."zig_${zigVersion}";
target = builtins.replaceStrings ["darwin"] ["macos"] system;
in {
formatter.${system} = pkgs.alejandra;
Expand Down
2 changes: 1 addition & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"default": false
},
"skip_std_references": {
"description": "When true, skips searching for references in the standard library. Improves lookup speed for functions in user's code. Renaming and go-to-definition will continue to work as is",
"description": "No longer used. May be brought back to configure how symbol references in the standard library should behave",
"type": "boolean",
"default": false
},
Expand Down
2 changes: 1 addition & 1 deletion src/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ warn_style: bool = false,
/// Whether to highlight global var declarations
highlight_global_var_declarations: bool = false,

/// When true, skips searching for references in the standard library. Improves lookup speed for functions in user's code. Renaming and go-to-definition will continue to work as is
/// No longer used. May be brought back to configure how symbol references in the standard library should behave
skip_std_references: bool = false,

/// Favor using `zig ast-check` instead of the builtin one
Expand Down
2 changes: 1 addition & 1 deletion src/DiagnosticsCollection.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Uri = @import("Uri.zig");
io: std.Io,
allocator: std.mem.Allocator,
mutex: std.Io.Mutex = .init,
tag_set: std.AutoArrayHashMapUnmanaged(Tag, struct {
tag_set: std.array_hash_map.Auto(Tag, struct {
version: u32 = 0,
error_bundle_src_base_path: ?[]const u8 = null,
/// Used to store diagnostics from `pushErrorBundle`
Expand Down
2 changes: 1 addition & 1 deletion src/DocumentScope.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extra: std.ArrayList(u32),

/// Every `index` inside this `ArrayhashMap` is equivalent to a `Declaration.Index`
/// This means that every declaration is only the child of a single scope
pub const DeclarationLookupMap = std.ArrayHashMapUnmanaged(
pub const DeclarationLookupMap = std.array_hash_map.Custom(
DeclarationLookup,
void,
DeclarationLookupContext,
Expand Down
4 changes: 2 additions & 2 deletions src/DocumentStore.zig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mutex: std.Io.Mutex = .init,
wait_group: if (supports_build_system) std.Io.Group else void = if (supports_build_system) .init else {},
handles: Uri.ArrayHashMap(*Handle.Future) = .empty,
build_files: if (supports_build_system) Uri.ArrayHashMap(*BuildFile) else void = if (supports_build_system) .empty else {},
cimports: if (supports_build_system) std.AutoArrayHashMapUnmanaged(CImportHash, translate_c.Result) else void = if (supports_build_system) .empty else {},
cimports: if (supports_build_system) std.array_hash_map.Auto(CImportHash, translate_c.Result) else void = if (supports_build_system) .empty else {},
diagnostics_collection: *DiagnosticsCollection,
builds_in_progress: std.atomic.Value(i32) = .init(0),
transport: ?*lsp.Transport = null,
Expand Down Expand Up @@ -361,7 +361,7 @@ pub const Handle = struct {
const target_index = modules.getIndex(target_root_source_file).?;

// We only care about the root source file of each root module so we convert them to a set.
var root_modules: std.StringArrayHashMapUnmanaged(void) = .empty;
var root_modules: std.array_hash_map.String(void) = .empty;
defer root_modules.deinit(allocator);

try root_modules.ensureTotalCapacity(allocator, build_config.compilations.len);
Expand Down
10 changes: 5 additions & 5 deletions src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ fn initializedHandler(server: *Server, arena: std.mem.Allocator, notification: t

if (server.client_capabilities.supports_workspace_did_change_watched_files) {
// `{ "watchers": [ { "globPattern": "**/*.{zig,zon}" } ] }`
var watcher: std.json.ObjectMap = .init(arena);
try watcher.putNoClobber("globPattern", .{ .string = "**/*.{zig,zon}" });
var watcher: std.json.ObjectMap = .empty;
try watcher.putNoClobber(arena, "globPattern", .{ .string = "**/*.{zig,zon}" });
var watchers_arr: std.json.Array = try .initCapacity(arena, 1);
watchers_arr.appendAssumeCapacity(.{ .object = watcher });
var fs_watcher_obj: std.json.ObjectMap = .init(arena);
try fs_watcher_obj.putNoClobber("watchers", .{ .array = watchers_arr });
var fs_watcher_obj: std.json.ObjectMap = .empty;
try fs_watcher_obj.putNoClobber(arena, "watchers", .{ .array = watchers_arr });
const json_val: std.json.Value = .{ .object = fs_watcher_obj };

try server.registerCapability("workspace/didChangeWatchedFiles", json_val);
Expand Down Expand Up @@ -1894,7 +1894,7 @@ fn processMessageReportError(server: *Server, arena_state: std.heap.ArenaAllocat
if (err == error.Canceled) return error.Canceled;
log.err("failed to process {f}: {}", .{ fmtMessage(message), err });
if (@errorReturnTrace()) |trace| {
std.debug.dumpStackTrace(trace);
std.debug.dumpErrorReturnTrace(trace);
}

switch (message) {
Expand Down
4 changes: 2 additions & 2 deletions src/TrigramStore.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub const Declaration = struct {
};

filter_buckets: ?[]CuckooFilter.Bucket,
trigram_to_declarations: std.AutoArrayHashMapUnmanaged(Trigram, std.ArrayList(Declaration.Index)),
trigram_to_declarations: std.array_hash_map.Auto(Trigram, std.ArrayList(Declaration.Index)),
declarations: std.MultiArrayList(Declaration),

pub fn init(
Expand Down Expand Up @@ -649,7 +649,7 @@ test CuckooFilter {
const element_count = 499;
const filter_size = comptime CuckooFilter.capacityForCount(element_count) catch unreachable;

var entries: std.AutoArrayHashMapUnmanaged(Trigram, void) = .empty;
var entries: std.array_hash_map.Auto(Trigram, void) = .empty;
defer entries.deinit(allocator);
try entries.ensureTotalCapacity(allocator, element_count);

Expand Down
2 changes: 1 addition & 1 deletion src/Uri.zig
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub const format = @compileError("Cannot format @import(\"Uri.zig\") directly!.
pub const jsonStringify = @compileError("Cannot stringify @import(\"Uri.zig\") directly!. Access the underlying raw string field instead.");

pub fn ArrayHashMap(comptime V: type) type {
return std.ArrayHashMapUnmanaged(Uri, V, Context, true);
return std.array_hash_map.Custom(Uri, V, Context, true);
}

const Context = struct {
Expand Down
Loading
Loading