-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Extended property patterns: few more tests #53874
Extended property patterns: few more tests #53874
Conversation
@333fred @dotnet/roslyn-compiler for review. This is just adding a few tests we discussed during feature review. Thanks |
@CyrusNajmabadi @333fred @dotnet/roslyn-compiler for review. This is just adding a few tests we discussed during feature review. Thanks |
{ | ||
public C Instance { get; set; } | ||
public static C Static { get; set; } | ||
public bool True { get { System.Console.Write(""True ""); return true; } } |
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.
code, | ||
indentationLine: 8, | ||
expectedIndentation: 12); | ||
} |
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.
can you add a test with this form:
class C
{
void M()
{
_ = this is
{
A.B: 1,
Where we're testing the indentation above A.B: 1
#Resolved
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.
Adjusted test to cover this (I think)
{ | ||
} | ||
} | ||
", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); |
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 actually a bit odd since patterns have to be constant, and you can't have constants of user defined types. that said... seems fine for us to do this since i don't have anything that would be better :) #Resolved
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.
Technically, you can have constants of user-defined types, but it must be null :-P
showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.Preview) | ||
|
||
' We don't yet offer expression completion in this context (could be a constant for a list-pattern) | ||
state.SendTypeChars("CP") |
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.
seems... bad :) it's not blocking, but i would say this is a basic completion scenario we want to get working by ship time.
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.
Why would this work in this branch or main
branch (ie. without support for list-patterns)?
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.
sorry, the comment int eh code confused me. it sounded like you were saying this shoudln't work even with list patterns.
I would instead have this test state that this is expected behavior prior to list pattenrs comining online. Then we shoudl have a tracking bug that ensures that this scenario works when we do list patterns :)
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.
Sorry the comment wasn't clear. I'll tweak the wording.
There's no need for tracking bug. List-patterns is in active development, so we're tracking work remaining in the test plan.
Also, I have a PR queued that fixes that for list-patterns already (it's waiting on another PR to merge first) ;-)
https://github.com/dotnet/roslyn/pull/53850/files#diff-31303c421816ee9001acbb872ec31e6ef3d701cd04eba6f2a41d02e49d70ae21
Adding remaining tests from test plan and from feature review discussion.
Test plan #52468
FYI @alrz