Skip to content

Move more of FindRefs OOP#43914

Merged
CyrusNajmabadi merged 15 commits intodotnet:masterfrom
CyrusNajmabadi:findRefsOOP
May 4, 2020
Merged

Move more of FindRefs OOP#43914
CyrusNajmabadi merged 15 commits intodotnet:masterfrom
CyrusNajmabadi:findRefsOOP

Conversation

@CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented May 2, 2020

The previous model was that FindRefs would call into OOP and OOP would report symbols it found. This worked, but required the host to then do the work to rehydrate those symbols/compilations on the VS side. This is extraneous work we don't need for FAR.

Now, we ask OOP to do the work, and OOP just reports back the results that can be directly shown in the UI. This means no extra work necessary on hte host side. We can just immediately display the work and not cause any symbols/compilations to be created.

Also did teh above for FindImpls.

This should be reviewed one commit at a time.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 2, 2020 20:40
@CyrusNajmabadi CyrusNajmabadi requested a review from tmat May 2, 2020 20:40
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: it's unortunate that hte host side still starts with a symbol. However, this is something that is harder to change now. The reason for this is metadata-as-source. The way MAS works is that you start with teh MAS document in the MAS workspace. We find the symbol you're on, then map that back to the normal metadata symbol in the primary workspace. We then do a FAR on that metadata symbol.

@tmat We could likely support this in OOP as well. But it means OOP understanding more about different workspaces (and especially providing the services so those workspaces can map between each other). This was out of scope for this PR, but would be good to have in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ITheadingContext was unused. So i removed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

context and cancellationToken together are redundant (since context has the cancellationToken). I removed the latter, esp. so we don't accidentally pass the wrong one along.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 2, 2020 21:15
@CyrusNajmabadi CyrusNajmabadi force-pushed the findRefsOOP branch 2 times, most recently from d6b25b5 to e59f350 Compare May 2, 2020 22:27
@jinujoseph jinujoseph added Area-IDE Concept-OOP Related to out-of-proc labels May 3, 2020
Copy link
Contributor

@dpoeschl dpoeschl left a comment

Choose a reason for hiding this comment

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

I'm not an OOP expert, but everything I read here makes sense both conceptually and in implementation.

public Task ReportMessageAsync(string message)
=> _context.ReportMessageAsync(message);

[Obsolete]
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this same method obsoleted in other places too. Can this one have a message too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup. i will add :)

@CyrusNajmabadi CyrusNajmabadi merged commit 0852232 into dotnet:master May 4, 2020
@ghost ghost added this to the Next milestone May 4, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the findRefsOOP branch May 4, 2020 23:46
}


public Task FindImplementationsAsync(PinnedSolutionInfo solutionInfo,
Copy link
Member

@tmat tmat May 5, 2020

Choose a reason for hiding this comment

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

PinnedSolutionInf [](start = 45, length = 17)

Nit: this is an odd wrapping, i'd expect the first param to be on the next line.

@tmat
Copy link
Member

tmat commented May 6, 2020

LGTM

mavasani added a commit to mavasani/roslyn that referenced this pull request May 13, 2020
…ourceReferenceItem

Fixes dotnet#44184
Find References "Kind" column uses `SymbolUsageInfo` for its data. `SymbolUsageInfo` is correctly serialized/deserialized when Find References is invoked via [SymbolFinder.FindReferencesServerCallback](https://github.com/dotnet/roslyn/blob/b8585be8e9ff9e30dbe64980e2c9156ae8b6c2bf/src/Workspaces/Core/Portable/FindSymbols/SymbolFinder.FindReferencesServerCallback.cs#L72-L84), as it uses [SerializableReferenceLocation](https://github.com/dotnet/roslyn/blob/a65653a77b2862329052d84816b5fb324f8bc8bd/src/Workspaces/Core/Portable/Remote/RemoteArguments.cs#L156) which uses `SerializableSymbolUsageInfo`. With dotnet#43914, we added a new [FindUsagesServerCallback](https://github.com/dotnet/roslyn/blob/0852232f315e952fee1dc63a0b374614b55c1c69/src/EditorFeatures/Core/FindUsages/IRemoteFindUsagesService.cs#L32) and switched to it for Find references serialization/deserialization. This callback does not use `SerializableSymbolUsageInfo`, hence loses the SymbolUsageInfo for "Kind" column. This change fixes this part.
@JoeRobich JoeRobich modified the milestones: Next, 16.7.P2 May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Concept-OOP Related to out-of-proc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants