Skip to content
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 FindImplementationService not finding all implementations of the partial class #1318

Merged
merged 7 commits into from
Nov 3, 2018

Conversation

SirIntruder
Copy link
Contributor

Currently, when you use "Find Implementations" on a partial class, it appears to randomly select one of the definitions instead of returning all of them (like VS does). Looks like this was unintentionally broken in order to handle partialMethod case (guess there is makes sense to take symbol.Locations.First() instead of symbol.Locations).

Should be easy to merge with @filipw fix for separate bug fix in the same service.

@filipw
Copy link
Member

filipw commented Oct 24, 2018

can you add a test illustrating what this is fixing?

@SirIntruder
Copy link
Contributor Author

Will push test in later today

@SirIntruder
Copy link
Contributor Author

SirIntruder commented Oct 29, 2018

@filipw Sorry for the delay, I added test for finding all implementations of the partial class and one test for partial methods (to make sure this functionality is kept intact).

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@filipw
Copy link
Member

filipw commented Oct 31, 2018

I merged #1302, could you please resolve the conflicts - thanks! Otherwise, looks good to me

MisaJovanovic added 2 commits October 31, 2018 23:01
# Conflicts:
#	src/OmniSharp.Roslyn.CSharp/Helpers/QuickFixExtensions.cs
@SirIntruder
Copy link
Contributor Author

@filipw done!

Assert.Single(implementations);

var implementation = implementations.First();
Assert.Equal("SomeMethod", implementation.Name);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert on the location of implementation to prove you found the implementation copy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirIntruder if you could fix this feedback, this looks good to me.

Assert.Single(implementations);

var implementation = implementations.First();
Assert.Equal("SomeMethod", implementation.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirIntruder if you could fix this feedback, this looks good to me.

@SirIntruder
Copy link
Contributor Author

@rchande @filipw @david-driscoll Thanks a lot for the tip, I would actually regress partial method without it. I enhanced the test and changed handler code, looks like it works correctly now.

2018-11-03_17-28-29

@filipw
Copy link
Member

filipw commented Nov 3, 2018

looks good, indeed this is the behavior we want 👍

@filipw filipw dismissed david-driscoll’s stale review November 3, 2018 16:57

requested changes were implemented

@filipw filipw merged commit db13bea into OmniSharp:master Nov 3, 2018
@filipw
Copy link
Member

filipw commented Nov 3, 2018

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants