Skip to content

Conversation

@jasonmalinowski
Copy link
Member

No description provided.

Copy link
Member Author

Choose a reason for hiding this comment

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

VsTextLines has been revised to never be null.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not clear to me why this was only using an 'as' cast to convert the docData to an IVsTextLines. We had a hard cast to IVsTextBuffer a line later, and although it's possible that somebody could implement IVsTextBuffer but not IVsTextLines, I can't think of any reasonable scenario for that. Worse off, the only objects here that can be passed to GetDocumentBuffer and actually work would be the editor implementations anyways which would implement all the interfaces.

I'm figuring this all just evolved this way for no good reason, so I'm cleaning it up.

Comment on lines 94 to 96
Copy link
Member Author

Choose a reason for hiding this comment

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

@davkean The AbtractHostObject stuff would all have been the fake IVsHierarchies you used to create for each target; that's all gone now right? I imagine we can delete this hack entirely.

@jasonmalinowski jasonmalinowski marked this pull request as ready for review July 14, 2020 21:52
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner July 14, 2020 21:52
@jasonmalinowski jasonmalinowski self-assigned this Jul 15, 2020
@jasonmalinowski jasonmalinowski force-pushed the nullable-annotate-invisibleeditor branch from 19f280e to 34fb647 Compare July 15, 2020 18:46
@sharwell sharwell added Area-IDE Concept-Null Annotations The issue involves annotating an API for nullable reference types labels Jul 15, 2020
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ Where would the previous implementation have thrown if this invariant was violated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Calling the VS API with an empty file path wouldn't have worked, that much is certain.

Copy link
Contributor

Choose a reason for hiding this comment

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

❔ How do we know FilePath is not null here? Is there already validation of this condition earlier in the code path?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ditto: code never could have worked prior. And more practically, remote files are backed by the file system in a certain magic temp directory.

@jasonmalinowski jasonmalinowski force-pushed the nullable-annotate-invisibleeditor branch from 34fb647 to fb34e59 Compare July 23, 2020 23:21
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@jasonmalinowski jasonmalinowski merged commit 2bde9dc into dotnet:master Jul 27, 2020
@ghost ghost added this to the Next milestone Jul 27, 2020
@jasonmalinowski jasonmalinowski deleted the nullable-annotate-invisibleeditor branch July 27, 2020 17:16
@RikkiGibson RikkiGibson modified the milestones: Next, 16.8.P2 Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Concept-Null Annotations The issue involves annotating an API for nullable reference types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants