-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some things from IProjectSnapshot
for cohostings benefit
#10831
Remove some things from IProjectSnapshot
for cohostings benefit
#10831
Conversation
Was only used in one place, and that place could never have any result except false due to a FileKind check above
This is only called from the LSP server, and shouldn't be called from cohosting, so now it can't be!
@@ -27,12 +27,6 @@ internal static class IDocumentSnapshotExtensions | |||
|
|||
var project = documentSnapshot.Project; | |||
|
|||
// If the document is an import document, then it can't be a component | |||
if (project.IsImportDocument(documentSnapshot)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mentioned in the commit message, but if you're looking at the PR as a whole let me explain here: This was the only call to IsImportDocument
, and it was impossible for it to ever return true
because 10 lines above this there is a check for FileKind
. Import documents have their own file kind, so would never get this far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking a shot at this! These methods have been on my list to remove from IProjectSnapshot
for a long while. However, I'm uncomfortable with the changes to ProjectChangeEventsArgs
, and ProjectSnapshotManager
. I feel like these go a bit far and there's a way to do this without breaking the contract of those APIs.
Chris found these to be problematic in his branch where he enabled the source generator, but fortunately they're simply unnecessary in cohosting.