From b7a5ab5f5278de9d5a79b41a925b93fda563bee3 Mon Sep 17 00:00:00 2001 From: nullptrdevs <16590917+nullptrdevs@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:13:58 -0700 Subject: [PATCH] fix: fix warning emitted incorrectly when using .. --- src/Server.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Server.zig b/src/Server.zig index 97367b5..59eec00 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -324,13 +324,13 @@ fn publishDiagnostics(server: *Server, writer: anytype, handle: DocumentStore.Ha const import_str_token = tree.nodes.items(.main_token)[params[0]]; const import_str = tree.tokenSlice(import_str_token); - if (std.mem.startsWith(u8, import_str, "\".")) { + if (std.mem.startsWith(u8, import_str, "\"./")) { try diagnostics.append(allocator, .{ .range = astLocationToRange(tree.tokenLocation(0, import_str_token)), .severity = .Hint, - .code = "useless_dot", + .code = "dot_slash_import", .source = "zls", - .message = "A . or ./ is not needed in imports", + .message = "A ./ is not needed in imports", }); } }