internal VisualStudioWorkspace(HostServices hostServices, WorkspaceBackgroundWork backgroundWork) : base(hostServices, WorkspaceKind.Host) { if ((backgroundWork & WorkspaceBackgroundWork.Compile) != 0) { _backgroundCompiler = new BackgroundCompiler(this); } if ((backgroundWork & WorkspaceBackgroundWork.Parse) != 0) { _backgroundParser = new BackgroundParser(this); _backgroundParser.Start(); } }
private void OnCacheFlushRequested(object sender, EventArgs e) { if (_backgroundCompiler != null) { _backgroundCompiler.Dispose(); _backgroundCompiler = null; // PartialSemanticsEnabled will now return false } // No longer need cache notifications var cacheService = Services.GetService<IWorkspaceCacheService>(); if (cacheService != null) { cacheService.CacheFlushRequested -= OnCacheFlushRequested; } }
internal VisualStudioWorkspace(HostServices hostServices, WorkspaceBackgroundWork backgroundWork) : base(hostServices, WorkspaceKind.Host) { if ((backgroundWork & WorkspaceBackgroundWork.Compile) != 0) { _backgroundCompiler = new BackgroundCompiler(this); var cacheService = Services.GetService<IWorkspaceCacheService>(); if (cacheService != null) { cacheService.CacheFlushRequested += OnCacheFlushRequested; } } if ((backgroundWork & WorkspaceBackgroundWork.Parse) != 0) { _backgroundParser = new BackgroundParser(this); _backgroundParser.Start(); } }