Skip to content

Conversation

@jasonmalinowski
Copy link
Member

@jasonmalinowski jasonmalinowski commented Apr 17, 2025

(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

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
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner April 17, 2025 23:53
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 17, 2025
@arunchndr arunchndr merged commit c407108 into dotnet:main Apr 18, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 18, 2025
@jasonmalinowski jasonmalinowski deleted the fix-cross-language-go-to-definition branch April 18, 2025 18:23
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants