From 3cac23f8a123e75c4ece91d5dc20984bfda022fe Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Sat, 10 Dec 2022 23:21:55 +0200 Subject: [PATCH] Fix references to now removed, previously deprecated std.ascii declarations --- build.zig | 2 +- src/Server.zig | 2 +- src/analysis.zig | 2 +- src/code_actions.zig | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index 1007ad0..097bd7b 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const zls_version = std.builtin.Version{ .major = 0, .minor = 11, .patch = 0 }; pub fn build(b: *std.build.Builder) !void { const current_zig = builtin.zig_version; - const min_zig = std.SemanticVersion.parse("0.11.0-dev.399+44ee1c885") catch return; // whereabouts allocgate 2.0 + const min_zig = std.SemanticVersion.parse("0.11.0-dev.715+cffbb32d3") catch return; // whereabouts allocgate 2.0 if (current_zig.order(min_zig).compare(.lt)) @panic(b.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig })); const target = b.standardTargetOptions(.{}); diff --git a/src/Server.zig b/src/Server.zig index 7aabb99..e040a4e 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -795,7 +795,7 @@ pub fn identifierFromPosition(pos_index: usize, handle: DocumentStore.Handle) [] } fn isSymbolChar(char: u8) bool { - return std.ascii.isAlNum(char) or char == '_'; + return std.ascii.isAlphanumeric(char) or char == '_'; } fn gotoDefinitionSymbol( diff --git a/src/analysis.zig b/src/analysis.zig index 757d602..1e32ae4 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -77,7 +77,7 @@ pub fn collectDocComments(allocator: std.mem.Allocator, tree: Ast, doc_comments: while (true) : (curr_line_tok += 1) { const comm = tokens[curr_line_tok]; if ((container_doc and comm == .container_doc_comment) or (!container_doc and comm == .doc_comment)) { - try lines.append(std.mem.trim(u8, tree.tokenSlice(curr_line_tok)[3..], &std.ascii.spaces)); + try lines.append(std.mem.trim(u8, tree.tokenSlice(curr_line_tok)[3..], &std.ascii.whitespace)); } else break; } diff --git a/src/code_actions.zig b/src/code_actions.zig index 74ead7c..bb7160a 100644 --- a/src/code_actions.zig +++ b/src/code_actions.zig @@ -299,7 +299,7 @@ fn createDiscardText(builder: *Builder, identifier_name: []const u8, declaration const indent = find_indent: { const line = offsets.lineSliceUntilIndex(builder.handle.text, declaration_start); for(line) |char, i| { - if(!std.ascii.isSpace(char)) { + if(!std.ascii.isWhitespace(char)) { break :find_indent line[0..i]; } } @@ -600,5 +600,5 @@ fn getCaptureLoc(text: []const u8, loc: offsets.Loc, is_index_payload: bool) ?Ca } fn isSymbolChar(char: u8) bool { - return std.ascii.isAlNum(char) or char == '_'; + return std.ascii.isAlphanumeric(char) or char == '_'; }