Skip to content

Fix #33560 Handle equal tokens where Text is not available.#36380

Merged
sharwell merged 4 commits intodotnet:masterfrom
Andrew-Hanlon:master
Jun 14, 2019
Merged

Fix #33560 Handle equal tokens where Text is not available.#36380
sharwell merged 4 commits intodotnet:masterfrom
Andrew-Hanlon:master

Conversation

@Andrew-Hanlon
Copy link
Copy Markdown
Contributor

@Andrew-Hanlon Andrew-Hanlon commented Jun 12, 2019

Fixes #33560
I updated the helper method AreTwoTokensOnSameLine to exit early when the provided tokens are equal. This prevents an exception from being thrown when equal tokens are provided and the SyntaxTree is null or the SyntaxTree.TryGetText() call fails. I added unit tests to cover basic regressions as well as the erroneous case above.

@Andrew-Hanlon Andrew-Hanlon requested a review from a team as a code owner June 12, 2019 21:41
@dnfclas
Copy link
Copy Markdown

dnfclas commented Jun 12, 2019

CLA assistant check
All CLA requirements met.

Copy link
Copy Markdown
Contributor

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

Approve
Submit feedback approving these changes.

@vatsalyaagrawal vatsalyaagrawal added Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Jun 13, 2019
Copy link
Copy Markdown
Member

@genlu genlu left a comment

Choose a reason for hiding this comment

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

Thanks!

@genlu
Copy link
Copy Markdown
Member

genlu commented Jun 13, 2019

@jinujoseph @vatsalyaagrawal for approval

@genlu genlu self-assigned this Jun 13, 2019
@jinujoseph jinujoseph added Need Design Review The end user experience design needs to be reviewed and approved. Approved to merge and removed Need Design Review The end user experience design needs to be reviewed and approved. labels Jun 13, 2019
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

Thank you @Andrew-Hanlon ! :)

@sharwell
Copy link
Copy Markdown
Contributor

@jinujoseph for approval

@sharwell sharwell merged commit 9cdc1fb into dotnet:master Jun 14, 2019
@sharwell sharwell added this to the 16.2.P4 milestone Jun 14, 2019
@sharwell
Copy link
Copy Markdown
Contributor

Thank you @Andrew-Hanlon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved to merge Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

7 participants