Skip to content

Remove cancellation token from NavigateTo#332

Merged
brettfo merged 2 commits intodotnet:masterfrom
brettfo:navigateto-cancellation
Feb 9, 2015
Merged

Remove cancellation token from NavigateTo#332
brettfo merged 2 commits intodotnet:masterfrom
brettfo:navigateto-cancellation

Conversation

@brettfo
Copy link
Member

@brettfo brettfo commented Feb 9, 2015

NavigateTo doesn't support cancellation when computing the display properties so the cancellation token is getting removed rather than having to manually handle an OperationCanceledException.

NavigateTo doesn't support cancellation when computing the display properties so the cancellation token is getting removed rather than having to manually handling OperationCanceledException.
@jaredpar
Copy link
Member

jaredpar commented Feb 9, 2015

LGTM

@tmeschter
Copy link
Contributor

👍

Copy link
Member

Choose a reason for hiding this comment

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

You might want to add a comment why CancellationToken.None is being used.

@jasonmalinowski
Copy link
Member

👍 ✨

Copy link
Member

Choose a reason for hiding this comment

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

Is there a known way that Symbol can be null here? I don't see how this is related to the rest of the change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ultimately, we're calling through SemanticModel.GetDeclaredSymbolForNode() for which null is a valid return value. This null check isn't directly related to cancellation, but I just spotted a potential future NRE when checking all references to DeclaredSymbolNavigableItem.Symbol that I wanted to prevent (especially since we're guarding against another NRE before descending into SummaryText).

Copy link
Member

Choose a reason for hiding this comment

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

In that case, should we have never created a SearchResult object in the first place?

Copy link
Member

Choose a reason for hiding this comment

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

👍 I like Jason's idea for that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally, you're right, but since NavigateTo resolves the symbol as late as possible for perf reasons (i.e., my recent NavigateTo changes), we don't have the symbol (or null) until it's too late. Realizing the symbol earlier in the process would knock our perf back down to what it was before.

brettfo added a commit that referenced this pull request Feb 9, 2015
Remove cancellation token from NavigateTo
@brettfo brettfo merged commit 4f147f5 into dotnet:master Feb 9, 2015
@brettfo brettfo deleted the navigateto-cancellation branch February 9, 2015 22:33
@theoy theoy added Concept-API This issue involves adding, removing, clarification, or modification of an API. Area-IDE labels Feb 10, 2015
dibarbet pushed a commit to dibarbet/roslyn that referenced this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Concept-API This issue involves adding, removing, clarification, or modification of an API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants