Skip to content
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

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

davidwengier
Copy link
Contributor

Chris found these to be problematic in his branch where he enabled the source generator, but fortunately they're simply unnecessary in cohosting.

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!
@davidwengier davidwengier requested a review from a team as a code owner September 4, 2024 04:00
@@ -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))
Copy link
Contributor Author

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.

Copy link
Member

@DustinCampbell DustinCampbell left a 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.

@davidwengier davidwengier merged commit fbf8c8e into dotnet:main Sep 5, 2024
12 checks passed
@davidwengier davidwengier deleted the CleanupSomeStuffForCohosting branch September 5, 2024 00:16
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 5, 2024
@phil-allen-msft phil-allen-msft modified the milestones: Next, 17.12 P3 Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants