Skip to content

Commit 9c0bb83

Browse files
committed
fix small regression in autoformatting code
1 parent 52527a6 commit 9c0bb83

5 files changed

Lines changed: 15 additions & 14 deletions

File tree

editors/vscode/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# SuperHTML LSP VSCode Extension
22

3-
This extension gives you reasonable diagnostics and autoformatting on HTML files.
3+
This extension gives you diagnostics and autoformatting for HTML files.
44

55
![](../../.github/vscode-autoformat.gif)
66

7-
**NOTE: you will need to get the `super` CLI tool and have it available in your PATH (or set the path manually in your VSCode settings)!**
7+
**NOTE: you will need to get the `superhtml` CLI tool and have it available in your PATH (or set the path manually in your VSCode settings)!**
88

9-
For prebuilt binaries and more info: https://github.com/kristoff-it/super-html
9+
For prebuilt binaries and more info: https://github.com/kristoff-it/superhtml
1010

1111

1212
## Diagnostics

editors/vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "HTML Language Server",
55
"repository": "https://github.com/kristoff-it/superhtml/",
66
"publisher": "LorisCro",
7-
"version": "0.1.4",
7+
"version": "0.1.5",
88
"engines": {
99
"vscode": "^1.87.0"
1010
},
@@ -90,4 +90,4 @@
9090
"watch": "npm run build-base -- --sourcemap --watch",
9191
"lint": "eslint . --ext .ts"
9292
}
93-
}
93+
}

src/fuzz.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ test "afl++ fuzz cases" {
3535
};
3636

3737
for (cases) |c| {
38-
std.debug.print("test: \n\n{s}\n\n", .{c});
38+
// std.debug.print("test: \n\n{s}\n\n", .{c});
3939
const ast = try super.html.Ast.init(std.testing.allocator, c, .html);
4040
defer ast.deinit(std.testing.allocator);
41-
ast.debug(c);
41+
// ast.debug(c);
4242
}
4343
}

src/html/Ast.zig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,11 @@ pub fn render(ast: Ast, src: []const u8, w: anytype) !void {
556556
try w.writeAll(" ");
557557
}
558558
}
559-
switch (current.kind) {
560-
else => {},
561-
.element => indentation += 1,
562-
}
559+
}
560+
561+
switch (current.kind) {
562+
else => {},
563+
.element => indentation += 1,
563564
}
564565
},
565566
.exit => {
@@ -574,10 +575,10 @@ pub fn render(ast: Ast, src: []const u8, w: anytype) !void {
574575
current,
575576
});
576577

577-
if (pre == 0) switch (current.kind) {
578+
switch (current.kind) {
578579
else => {},
579580
.element => indentation -= 1,
580-
};
581+
}
581582

582583
const open_was_vertical = std.ascii.isWhitespace(src[current.open.end]);
583584

src/root.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ pub const Span = struct {
7878

7979
test {
8080
_ = @import("html.zig");
81-
// _ = @import("Ast.zig");
81+
_ = @import("Ast.zig");
8282
// _ = @import("template.zig");
8383
}

0 commit comments

Comments
 (0)