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

Switch to just using paths as keys for file watching #74877

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

CyrusNajmabadi
Copy link
Member

This simplifies work happening in #74780

In that PR we want to be able to make things like AnalyzerFileReferences temporarily, but switch out with IsolatedReferences to get dedicated ALCs. If we use the analyzer ref itself as a key, this becomes much more complicated. However, if all we're using is the path anyways (for both listening to notifications, and for reporting them externally), then it's simpler to just base the API on that.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner August 23, 2024 17:26
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 23, 2024
@CyrusNajmabadi CyrusNajmabadi marked this pull request as draft August 23, 2024 17:26
@@ -31,7 +31,7 @@ internal sealed class FileWatchedReferenceFactory<TReference>
/// are only created once we are actually applying a batch because we don't determine until the batch is applied if
/// the file reference will actually be a file reference or it'll be a converted project reference.
/// </summary>
private readonly Dictionary<TReference, (IWatchedFile Token, int RefCount)> _referenceFileWatchingTokens = [];
private readonly Dictionary<string, (IWatchedFile Token, int RefCount)> _referenceFileWatchingTokens = [];
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the crux of the change. it keeps the token/ref-count assocaited with the path, not the reerence identity anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Dumb question: Could _previousDisposalLocations key on the path too?

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review August 23, 2024 17:31
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski @ToddGrun @dibarbet ptal :)

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants