Skip to content

Check accessibility before offering "Implement interface" codefix#60297

Merged
CyrusNajmabadi merged 14 commits intodotnet:mainfrom
DoctorKrolic:check-accessibility-in-implement-interface
Apr 2, 2022
Merged

Check accessibility before offering "Implement interface" codefix#60297
CyrusNajmabadi merged 14 commits intodotnet:mainfrom
DoctorKrolic:check-accessibility-in-implement-interface

Conversation

@DoctorKrolic
Copy link
Copy Markdown
Contributor

Fixes: #4146

7 years later...

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner March 21, 2022 20:25
@ghost ghost added Community The pull request was submitted by a contributor who is not a Microsoft employee. Area-IDE labels Mar 21, 2022
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

CyrusNajmabadi commented Mar 21, 2022

I'm wary about this change as i think it may be fine for the user to still have the choice of implementing this. Perhaps they want this to be implicit and can change the accessibility later.

We have one report of this and no votes since this feature was ever implemented. So i'm really not sure this warrants any actual change.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

ok. so "implement interface" is not "implement implicitly". "implement interface" just means "implement this sensibly". So, as per kevin's suggestion, we should just be making those particular members be explicit impls.

And, we should check and see if we're going to make all the members explicit. If so, then we should not offer the main option, and just offer the second one.

…y check to a separate helper class, added a bunch of tests
@DoctorKrolic
Copy link
Copy Markdown
Contributor Author

@CyrusNajmabadi Any other egde cases?)

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Flying. We'll check tomorrow :-)

@DoctorKrolic
Copy link
Copy Markdown
Contributor Author

@CyrusNajmabadi ?

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

There is absolutely nothing wrong in old static class with main method model. At least make this optional!!!

@DoctorKrolic we're fixing our test-queues right now. Once htey're running successfully again I'll restart this PR :)

@DoctorKrolic
Copy link
Copy Markdown
Contributor Author

@CyrusNajmabadi Have you fixed your issues with the test-queues?)

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Yup. Can you please merge latest main info your branch.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

@DoctorKrolic You don't have to keep merging main in. I'll track this PR and get it in :)

@DoctorKrolic
Copy link
Copy Markdown
Contributor Author

This is my common strategy to get All checked passed green tick without need to ask you and other owners to restart CI 100500 times. I once tried to use azp command and found out, that I don't have permission to use it even on my PR). In the end it helps me to avoid situations like this, when PR is approved and even auto-merge is enabled, but CI failed and PR got stuck

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

This is my common strategy to get All checked passed green tick without need to ask you and other owners to restart CI 100500 times

The problem doing this is that you restart all tests instead of the ones that may be flakey. this means you have to run the flakey gamut each time.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Note: your PR keeps actually failing here. I think you may actually have introduced a product bug here.

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

I'm seeing the CI machine spit out:

The active Test Run was aborted because the host process exited unexpectedly. Please inspect the call stack above, if available, to get more information about where the exception originated from.
The test running when the crash occurred: 
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ImplementInterface.ImplementInterfaceTests.TestRenameConflictingTypeParameters3

auto-merge was automatically disabled March 30, 2022 20:21

Head branch was pushed to by a user without write access

@DoctorKrolic
Copy link
Copy Markdown
Contributor Author

you may actually have introduced a product bug here

Sounds scary. Fixed)

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge April 1, 2022 23:18
@CyrusNajmabadi CyrusNajmabadi merged commit 34b0206 into dotnet:main Apr 2, 2022
@ghost ghost added this to the Next milestone Apr 2, 2022
@DoctorKrolic DoctorKrolic deleted the check-accessibility-in-implement-interface branch April 2, 2022 06:18
@dibarbet dibarbet modified the milestones: Next, 17.3.P1 Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should not offer "Implement interface" if only "Implement interface explicitly" is legal

4 participants