Skip to content

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Mar 15, 2025

Using a MetadataId ensures that the cache items for metadata only stay alive as long as the metadata does (and are released once they are). Similary, using a CWT ensures that we only keep things alive as long as something is rooting it. but we release once it is not (obviating the need for custom flushing routines).

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 15, 2025
@CyrusNajmabadi CyrusNajmabadi requested a review from genlu March 15, 2025 06:27
@CyrusNajmabadi CyrusNajmabadi changed the base branch from main to release/dev18.0 March 15, 2025 20:20
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review March 15, 2025 20:21
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 15, 2025 20:21
s_projectItemsCache.AddOrUpdate(project.State, cacheEntry);
#else
s_projectItemsCache.Remove(project.State);
s_projectItemsCache.GetValue(project.State, _ => cacheEntry);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the result of this be put into cacheEntry?

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 should be fine either way. i prefer this way so that we ensure that we exactly return the data we computed for this exact arguments.

@CyrusNajmabadi
Copy link
Member Author

@genlu @jasonmalinowski ptal.

@CyrusNajmabadi CyrusNajmabadi requested a review from ToddGrun March 20, 2025 15:23
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal.

namespace Microsoft.VisualStudio.LanguageServices;

[ExportWorkspaceService(typeof(IWorkspaceCacheService), ServiceLayer.Host), Shared]
internal sealed class WorkspaceCacheService : IWorkspaceCacheService
Copy link
Member

Choose a reason for hiding this comment

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

huh, so this thing is not called by anyone

Copy link
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.

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit ae62ca0 into dotnet:release/dev18.0 Mar 20, 2025
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the importCaching branch March 20, 2025 20:07
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