-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/improve union(enum)
completions
#1719
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1719 +/- ##
==========================================
+ Coverage 78.24% 78.27% +0.03%
==========================================
Files 35 35
Lines 10512 10523 +11
==========================================
+ Hits 8225 8237 +12
+ Misses 2287 2286 -1 ☔ View full report in Codecov by Sentry. |
Could give an explanation on how completions would look like with anon struct inits?
I would say yes otherwise it may be a bit unclear on what to type next. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing test coverage.
I'm thinking it'd be identical, ie (If
|
3ad04a1
to
4241ddf
Compare
also why is this only done for tagged unions? regular unions are initialized the same way |
4241ddf
to
549b718
Compare
|
it does, as long as it is after the The amount of times I've spent back and forth debugging those situations $#^#^@^@# The regression you made me aware is |
@nullptrdevs I could take care of rebasing this PR if you'd like. |
34e8935
to
4b52ac0
Compare
Yes, please do take over. PS Dropping |
4b52ac0
to
87bd0b1
Compare
I've removed the second copy of every test that tested with and without snippets and instead used the new |
It was worth finding out, 👍 |
Does your approval stand on this one, merge? |
I have found an issue. In the following example I am doing a comparison which should only complete to const Birdie = enum { canary };
const U = union(enum) { alpha: []const u8 };
const u: U = undefined;
const boolean = u == .<cursor> Can be tested with: try testCompletionTextEdit(.{
.source =
\\const U = union(enum) { alpha: []const u8 };
\\const u: U = undefined;
\\const boolean = u == .<cursor>
,
.label = "alpha",
.expected_insert_line = "const foo: U = .alphh",
.expected_replace_line = "const foo: U = .alphh",
}); |
87bd0b1
to
06e87d2
Compare
Resolves #1707
It'd require some rework but should this be extended to anon struct inits?
Should completions include
=
for struct fields?