internal TestDiagnosticAnalyzerService( AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace) : base(new Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> >(() => ImmutableArray <HostDiagnosticAnalyzerPackage> .Empty), hostAnalyzerAssemblyLoader : null, hostDiagnosticUpdateSource, primaryWorkspace, new MockDiagnosticUpdateSourceRegistrationService()) { }
public VisualStudioWorkspaceImpl(ExportProvider exportProvider) : base( MefV1HostServices.Create(exportProvider), backgroundWork: WorkspaceBackgroundWork.ParseAndCompile) { PrimaryWorkspace.Register(this); }
public RemoteWorkspace() : base(RoslynServices.HostServices, workspaceKind: RemoteWorkspace.WorkspaceKind_RemoteWorkspace) { PrimaryWorkspace.Register(this); Options = Options.WithChangedOption(CacheOptions.RecoverableTreeLengthThreshold, 0); }
public VisualStudioWorkspace( SVsServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactoryService) : base(MefV1HostServices.Create(GetExportProvider(serviceProvider))) { PrimaryWorkspace.Register(this); _serviceProvider = serviceProvider; _textDocumentFactoryService = textDocumentFactoryService; _backgroundParser = new BackgroundParser(this); _backgroundParser.Start(); _textBufferToTextDocumentMap = new ConditionalWeakTable <ITextBuffer, ITextDocument>(); _documentIdToTextBufferMap = new ConditionalWeakTable <DocumentId, ITextBuffer>(); _textBufferToDocumentIdMap = new ConditionalWeakTable <ITextBuffer, DocumentId>(); _textBufferToViewsMap = new ConditionalWeakTable <ITextBuffer, List <ITextView> >(); _textViewToBuffersMap = new ConditionalWeakTable <ITextView, List <ITextBuffer> >(); Services.GetService <IDocumentTrackingService>(); if (Services.GetService <IOptionService>() is OptionServiceFactory.OptionService optionService) { optionService.RegisterDocumentOptionsProvider(new Implementation.Options.EditorconfigDocumentOptionsProvider()); } }
internal TestDiagnosticAnalyzerService( AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace, Action <Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null) : base(SpecializedCollections.EmptyEnumerable <HostDiagnosticAnalyzerPackage>(), null, hostDiagnosticUpdateSource, primaryWorkspace, new MockDiagnosticUpdateSourceRegistrationService()) { _onAnalyzerException = onAnalyzerException; }
public NavigateToItemProviderFactory(IAsynchronousOperationListenerProvider listenerProvider, PrimaryWorkspace primaryWorkspace) { if (listenerProvider == null) { throw new ArgumentNullException(nameof(listenerProvider)); } _asyncListener = listenerProvider.GetListener(FeatureAttribute.NavigateTo); _primaryWorkspace = primaryWorkspace; }
public RemoteWorkspace() : base(RoslynServices.HostServices, workspaceKind: WorkspaceKind.RemoteWorkspace) { PrimaryWorkspace.Register(this); Options = Options.WithChangedOption(CacheOptions.RecoverableTreeLengthThreshold, 0); _registrationService = Services.GetService <ISolutionCrawlerRegistrationService>(); _registrationService?.Register(this); }
// protected for testing purposes. protected DiagnosticAnalyzerService( Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> > workspaceAnalyzerPackages, IAnalyzerAssemblyLoader hostAnalyzerAssemblyLoader, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace, IDiagnosticUpdateSourceRegistrationService registrationService, IAsynchronousOperationListener listener = null) : this(new HostAnalyzerManager(workspaceAnalyzerPackages, hostAnalyzerAssemblyLoader, hostDiagnosticUpdateSource, primaryWorkspace), hostDiagnosticUpdateSource, registrationService, listener) { }
public DiagnosticAnalyzerService( IDiagnosticUpdateSourceRegistrationService registrationService, IAsynchronousOperationListenerProvider listenerProvider, PrimaryWorkspace primaryWorkspace, [Import(AllowDefault = true)] IHostDiagnosticAnalyzerPackageProvider?diagnosticAnalyzerProviderService = null, [Import(AllowDefault = true)] AbstractHostDiagnosticUpdateSource?hostDiagnosticUpdateSource = null) : this(new Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> >(() => GetHostDiagnosticAnalyzerPackage(diagnosticAnalyzerProviderService), isThreadSafe : true), diagnosticAnalyzerProviderService?.GetAnalyzerAssemblyLoader(), hostDiagnosticUpdateSource, primaryWorkspace, registrationService, listenerProvider.GetListener(FeatureAttribute.DiagnosticService)) { // diagnosticAnalyzerProviderService and hostDiagnosticUpdateSource can only be null in test harness. Otherwise, it should never be null. }
public DiagnosticAnalyzerService( IDiagnosticUpdateSourceRegistrationService registrationService, IAsynchronousOperationListenerProvider listenerProvider, PrimaryWorkspace primaryWorkspace, [Import(AllowDefault = true)] IWorkspaceDiagnosticAnalyzerProviderService diagnosticAnalyzerProviderService = null, [Import(AllowDefault = true)] AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource = null) : this(diagnosticAnalyzerProviderService != null ? diagnosticAnalyzerProviderService.GetHostDiagnosticAnalyzerPackages() : SpecializedCollections.EmptyEnumerable <HostDiagnosticAnalyzerPackage>(), diagnosticAnalyzerProviderService?.GetAnalyzerAssemblyLoader(), hostDiagnosticUpdateSource, primaryWorkspace, registrationService, listenerProvider.GetListener(FeatureAttribute.DiagnosticService)) { // diagnosticAnalyzerProviderService and hostDiagnosticUpdateSource can only be null in test hardness otherwise, it should // never be null }
private RoslynVisualStudioWorkspace( SVsServiceProvider serviceProvider, SaveEventsService saveEventsService, [ImportMany] IEnumerable <Lazy <INavigableItemsPresenter> > navigableItemsPresenters, [ImportMany] IEnumerable <Lazy <IReferencedSymbolsPresenter> > referencedSymbolsPresenters) : base( serviceProvider, backgroundWork: WorkspaceBackgroundWork.ParseAndCompile) { PrimaryWorkspace.Register(this); InitializeStandardVisualStudioWorkspace(serviceProvider, saveEventsService); _navigableItemsPresenters = navigableItemsPresenters; _referencedSymbolsPresenters = referencedSymbolsPresenters; }
public VisualStudioWorkspace( SVsServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactoryService) : base(MefV1HostServices.Create(GetExportProvider(serviceProvider))) { PrimaryWorkspace.Register(this); _serviceProvider = serviceProvider; _textDocumentFactoryService = textDocumentFactoryService; _backgroundParser = new BackgroundParser(this); _backgroundParser.Start(); _textBufferToTextDocumentMap = new ConditionalWeakTable <ITextBuffer, ITextDocument>(); _textBufferToDocumentIdMap = new ConditionalWeakTable <ITextBuffer, DocumentId>(); _textBufferToViewsMap = new ConditionalWeakTable <ITextBuffer, List <ITextView> >(); _textViewToBuffersMap = new ConditionalWeakTable <ITextView, List <ITextBuffer> >(); Services.GetService <IDocumentTrackingService>(); }
private RoslynVisualStudioWorkspace( SVsServiceProvider serviceProvider, SaveEventsService saveEventsService, [ImportMany] IEnumerable <Lazy <IStreamingFindUsagesPresenter> > streamingPresenters, [ImportMany] IEnumerable <Lazy <IDefinitionsAndReferencesPresenter> > referencedSymbolsPresenters, [ImportMany] IEnumerable <IDocumentOptionsProviderFactory> documentOptionsProviderFactories) : base( serviceProvider, backgroundWork: WorkspaceBackgroundWork.ParseAndCompile) { PrimaryWorkspace.Register(this); InitializeStandardVisualStudioWorkspace(serviceProvider, saveEventsService); _streamingPresenters = streamingPresenters; _referencedSymbolsPresenters = referencedSymbolsPresenters; foreach (var providerFactory in documentOptionsProviderFactories) { Services.GetRequiredService <IOptionService>().RegisterDocumentOptionsProvider(providerFactory.Create(this)); } }
public HostAnalyzerManager(Lazy <ImmutableArray <HostDiagnosticAnalyzerPackage> > hostAnalyzerPackages, IAnalyzerAssemblyLoader hostAnalyzerAssemblyLoader, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace) : this(new Lazy <ImmutableArray <AnalyzerReference> >(() => CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages.Value, new HostAnalyzerReferenceDiagnosticReporter(hostDiagnosticUpdateSource, primaryWorkspace), hostAnalyzerAssemblyLoader), isThreadSafe : true), hostAnalyzerPackages, hostDiagnosticUpdateSource) { }
public HostAnalyzerReferenceDiagnosticReporter(AbstractHostDiagnosticUpdateSource hostUpdateSource, PrimaryWorkspace primaryWorkspace) { _hostUpdateSource = hostUpdateSource; _primaryWorkspace = primaryWorkspace; }
public HostAnalyzerManager(IEnumerable <HostDiagnosticAnalyzerPackage> hostAnalyzerPackages, IAnalyzerAssemblyLoader hostAnalyzerAssemblyLoader, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, PrimaryWorkspace primaryWorkspace) : this(CreateAnalyzerReferencesFromPackages(hostAnalyzerPackages, new HostAnalyzerReferenceDiagnosticReporter(hostDiagnosticUpdateSource, primaryWorkspace), hostAnalyzerAssemblyLoader), hostAnalyzerPackages.ToImmutableArrayOrEmpty(), hostDiagnosticUpdateSource) { }