Explore modifying Zig's parser to fit the needs of a language server#1536
Explore modifying Zig's parser to fit the needs of a language server#1536llogick wants to merge 10 commits intozigtools:masterfrom
Conversation
|
Would you consider to try and upstream these changes? I think these changes quite different from a PR like ziglang/zig#14391 where a feature that only gets used by third party projects is being added. |
// Test for `fnCall(.{.})` and `fnCall(Parser.Node{. .some})` because they are handled in different places
// Test for completions after `.{` and every `,`
pub fn gamma(p: Parser) void {
return p.addNode(.{
.tag = 1,
.main_token = 1,
.data = .{
.lhs = undefined,
.rhs = p.addNode(Parser.Node{
.tag,
}),
},
});
}
const Parser = struct {
const Node = struct {
tag: u32,
main_token: u32,
data: struct {
lhs: u32,
rhs: u32,
},
};
pub fn addNode(_: Node) u32 {}
};
fn foo(e: Enum) void {
switch (e) {}
}
const Enum = enum {
foo,
bar,
baz,
}; |
bb0c315 to
fdac742
Compare
3834407 to
65b0d69
Compare
e99a934 to
cf3aed6
Compare
|
Upkeep's been quite light, the only change being ziglang/zig@f258a39 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1536 +/- ##
=======================================
Coverage 78.45% 78.45%
=======================================
Files 35 35
Lines 10549 10552 +3
=======================================
+ Hits 8276 8279 +3
Misses 2273 2273 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6dc707d to
f06b587
Compare
0f92c2b to
ca60277
Compare
|
Isn't only the |
The intention is to keep it (close to) a carbon copy as it makes it easy to update by just overwriting a/the file(s) and looking at the overlapping sections. |
6261c74 to
f6bdfc6
Compare
|
I'm not sure why this PR is still open, but I'm growing fond of it and updated it for it's upcoming anniversary 😋 Cheers |
|
RIP |
Feeling out how disruptive this would be
Ignoring missing semicolons (https://github.com/ziglang/zig/blob/eb5276c94eaab238551fdae9a2e77b0133e31cfb/lib/std/zig/Parse.zig#L876) solves
Haven't observed any side effects and the number and type of errors is the same.
Somewhat of a changelog
fixes #1112
fixes #1525
fixes #1535
fixes #1549