Example #1
0
        public ProjectManager(
            ILoggerFactory loggerFactory,
            MSBuildOptions options,
            IEventEmitter eventEmitter,
            IFileSystemWatcher fileSystemWatcher,
            MetadataFileReferenceCache metadataFileReferenceCache,
            PackageDependencyChecker packageDependencyChecker,
            ProjectLoader projectLoader,
            OmniSharpWorkspace workspace,
            IAnalyzerAssemblyLoader analyzerAssemblyLoader,
            ImmutableArray <IMSBuildEventSink> eventSinks,
            DotNetInfo dotNetInfo)
        {
            _logger                     = loggerFactory.CreateLogger <ProjectManager>();
            _options                    = options ?? new MSBuildOptions();
            _eventEmitter               = eventEmitter;
            _fileSystemWatcher          = fileSystemWatcher;
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _packageDependencyChecker   = packageDependencyChecker;
            _projectFiles               = new ProjectFileInfoCollection();
            _failedToLoadProjectFiles   = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            _projectsRequestedOnDemand  = new ConcurrentDictionary <string, int>(StringComparer.OrdinalIgnoreCase);
            _projectLoader              = projectLoader;
            _workspace                  = workspace;
            _eventSinks                 = eventSinks;
            _dotNetInfo                 = dotNetInfo;
            _queue = new BufferBlock <ProjectToUpdate>();
            _processLoopCancellation = new CancellationTokenSource();
            _processLoopTask         = Task.Run(() => ProcessLoopAsync(_processLoopCancellation.Token));
            _analyzerAssemblyLoader  = analyzerAssemblyLoader;
            _onDirectoryFileChanged  = OnDirectoryFileChanged;

            if (_options.LoadProjectsOnDemand)
            {
                _workspace.AddWaitForProjectModelReadyHandler(WaitForProjectModelReadyAsync);
            }
        }
        public ProjectManager(ILoggerFactory loggerFactory, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, MetadataFileReferenceCache metadataFileReferenceCache, PackageDependencyChecker packageDependencyChecker, ProjectLoader projectLoader, OmniSharpWorkspace workspace)
        {
            _logger                     = loggerFactory.CreateLogger <ProjectManager>();
            _eventEmitter               = eventEmitter;
            _fileSystemWatcher          = fileSystemWatcher;
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _packageDependencyChecker   = packageDependencyChecker;
            _projectFiles               = new ProjectFileInfoCollection();
            _projectLoader              = projectLoader;
            _workspace                  = workspace;

            _queue = new BufferBlock <ProjectToUpdate>();
            _processLoopCancellation = new CancellationTokenSource();
            _processLoopTask         = Task.Run(() => ProcessLoopAsync(_processLoopCancellation.Token));

            _onDirectoryFileChanged = OnDirectoryFileChanged;
        }
Example #3
0
        public ProjectManager(ILoggerFactory loggerFactory, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, MetadataFileReferenceCache metadataFileReferenceCache, PackageDependencyChecker packageDependencyChecker, ProjectLoader projectLoader, OmniSharpWorkspace workspace, ImmutableArray <IMSBuildEventSink> eventSinks)
        {
            _logger                     = loggerFactory.CreateLogger <ProjectManager>();
            _eventEmitter               = eventEmitter;
            _fileSystemWatcher          = fileSystemWatcher;
            _metadataFileReferenceCache = metadataFileReferenceCache;
            _packageDependencyChecker   = packageDependencyChecker;
            _projectFiles               = new ProjectFileInfoCollection();
            _failedToLoadProjectFiles   = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            _projectLoader              = projectLoader;
            _workspace                  = workspace;
            _eventSinks                 = eventSinks;

            _queue = new BufferBlock <ProjectToUpdate>();
            _processLoopCancellation = new CancellationTokenSource();
            _processLoopTask         = Task.Run(() => ProcessLoopAsync(_processLoopCancellation.Token));

            _onDirectoryFileChanged = OnDirectoryFileChanged;
        }