Skip to content

Commit

Permalink
Merge pull request #54332 from CyrusNajmabadi/codeModelOptionDeadLock
Browse files Browse the repository at this point in the history
remove dependency that codemodel has on option value that never changes.
  • Loading branch information
CyrusNajmabadi authored Jun 23, 2021
2 parents ee3e71c + efdc8ed commit 32bce68
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.SolutionCrawler;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Threading;
using Roslyn.Utilities;
Expand All @@ -28,6 +27,8 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel
[Export(typeof(ProjectCodeModelFactory))]
internal sealed class ProjectCodeModelFactory : ForegroundThreadAffinitizedObject, IProjectCodeModelFactory
{
private static readonly TimeSpan s_documentBatchProcessingCadence = TimeSpan.FromMilliseconds(1500);

private readonly ConcurrentDictionary<ProjectId, ProjectCodeModel> _projectCodeModels = new ConcurrentDictionary<ProjectId, ProjectCodeModel>();

private readonly VisualStudioWorkspace _visualStudioWorkspace;
Expand Down Expand Up @@ -56,7 +57,7 @@ public ProjectCodeModelFactory(
// for the same documents. Once enough time has passed, take the documents that were changed and run
// through them, firing their latest events.
_documentsToFireEventsFor = new AsyncBatchingWorkQueue<DocumentId>(
TimeSpan.FromMilliseconds(visualStudioWorkspace.Options.GetOption(InternalSolutionCrawlerOptions.AllFilesWorkerBackOffTimeSpanInMS)),
s_documentBatchProcessingCadence,
ProcessNextDocumentBatchAsync,
// We only care about unique doc-ids, so pass in this comparer to collapse streams of changes for a
// single document down to one notification.
Expand Down

0 comments on commit 32bce68

Please sign in to comment.