fix: fix warning emitted incorrectly when using ..
This commit is contained in:
parent
8cf96fe27c
commit
b7a5ab5f52
@ -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_token = tree.nodes.items(.main_token)[params[0]];
|
||||||
const import_str = tree.tokenSlice(import_str_token);
|
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, .{
|
try diagnostics.append(allocator, .{
|
||||||
.range = astLocationToRange(tree.tokenLocation(0, import_str_token)),
|
.range = astLocationToRange(tree.tokenLocation(0, import_str_token)),
|
||||||
.severity = .Hint,
|
.severity = .Hint,
|
||||||
.code = "useless_dot",
|
.code = "dot_slash_import",
|
||||||
.source = "zls",
|
.source = "zls",
|
||||||
.message = "A . or ./ is not needed in imports",
|
.message = "A ./ is not needed in imports",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user