Ensure FindSourceDefinitionAsync works in frozen compilation cases #78195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This is the main branch version of #78164)
FindSourceDefinitionAsync was assuming that in the cross-language case, if you have a symbol from another project, that the compilation must always be available for that project -- for example, that calling TryGetCompilation on the project must always work. That's not the case if we're not generating skeleton references all the time. The fix to make that method work reliably again is simply to call GetCompilationAsync(). This results in a cascade of making more things async though: although our public entrypoint for FindSourceDefinitionAsync was Task-returning, it wasn't async and called into a non-async helper. So this removes those internal helpers and makes everything async again.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2443981
Fixes https://developercommunity.visualstudio.com/t/Go-to-definition-stopped-working-after-u/10796494