public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     var optionService = workspaceServices.GetService<IOptionService>();
     var errorReportingService = workspaceServices.GetService<IErrorReportingService>();
     var errorLoggerService = workspaceServices.GetService<IErrorLoggerService>();
     return new ExtensionManager(optionService, errorReportingService, errorLoggerService, _errorHandlers);
 }
		public IWorkspaceService CreateService (HostWorkspaceServices workspaceServices)
		{
			if (microsoftFactory != null) {
				return microsoftFactory.CreateService (workspaceServices);
			}
			return new TemporaryStorageService ();
		}
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     // give out new option service per workspace
     return new OptionServiceFactory.OptionService(
         new GlobalOptionService(_providers, SpecializedCollections.EmptyEnumerable<Lazy<IOptionPersister>>()),
         workspaceServices);
 }
        private static IWorkspaceService GetVisualStudioProjectCache(HostWorkspaceServices workspaceServices)
        {
            var projectCacheService = new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS);

            var documentTrackingService = workspaceServices.GetService<IDocumentTrackingService>();

            // Subscribe to events so that we can cache items from the active document's project
            var manager = new ActiveProjectCacheManager(documentTrackingService, projectCacheService);

            // Subscribe to requests to clear the cache
            var workspaceCacheService = workspaceServices.GetService<IWorkspaceCacheService>();
            if (workspaceCacheService != null)
            {
                workspaceCacheService.CacheFlushRequested += (s, e) => manager.Clear();
            }

            // Also clear the cache when the solution is cleared or removed.
            workspaceServices.Workspace.WorkspaceChanged += (s, e) =>
            {
                if (e.Kind == WorkspaceChangeKind.SolutionCleared || e.Kind == WorkspaceChangeKind.SolutionRemoved)
                {
                    manager.Clear();
                }
            };

            return projectCacheService;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            var manager = workspaceServices.GetService<VisualStudioMetadataReferenceManager>();
            Debug.Assert(manager != null);

            return new Service(manager);
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (_singleton == null)
            {
                _singleton = new DefaultSymbolNavigationService();
            }

            return _singleton;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (_singleton == null)
            {
                var temporaryStorage = workspaceServices.GetService<ITemporaryStorageService>();
                Interlocked.CompareExchange(ref _singleton, new VisualStudioMetadataReferenceManager(_serviceProvider, temporaryStorage), null);
            }

            return _singleton;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (_singleton == null)
            {
                var optionService = workspaceServices.GetService<IOptionService>();
                System.Threading.Interlocked.CompareExchange(ref _singleton, new PersistentStorageService(optionService), null);
            }

            return _singleton;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            // we support active document tracking only for visual studio workspace host.
            if (workspaceServices.Workspace is VisualStudioWorkspace)
            {
                return GetVisualStudioProjectCache(workspaceServices);
            }

            return GetMiscProjectCache(workspaceServices);
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            lock (s_gate)
            {
                if (s_singleton == null)
                {
                    s_singleton = new VSDialogService(_uiShellService);
                }
            }

            return s_singleton;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            lock (s_gate)
            {
                if (s_singleton == null)
                {
                    s_singleton = new EditorDialogService();
                }
            }

            return s_singleton;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (cache == null)
            {
                var service = workspaceServices.GetService<IOptionService>();
                var newCache = CreateCache(service);

                Interlocked.CompareExchange(ref cache, newCache, null);
            }

            return cache;
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            var options = workspaceServices.Workspace.Options;
            if (options.GetOption(ServiceComponentOnOffOptions.PackageSearch))
            {
                // Only support package search in vs workspace.
                if (workspaceServices.Workspace is VisualStudioWorkspace)
                {
                    return new PackageSearchService(_serviceProvider, workspaceServices.GetService<IPackageInstallerService>());
                }
            }

            return new NullPackageSearchService();
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            var service = new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS);

            // Also clear the cache when the solution is cleared or removed.
            workspaceServices.Workspace.WorkspaceChanged += (s, e) =>
            {
                if (e.Kind == WorkspaceChangeKind.SolutionCleared || e.Kind == WorkspaceChangeKind.SolutionRemoved)
                {
                    service.ClearImplicitCache();
                }
            };

            return service;
        }
        private static IWorkspaceService GetMiscProjectCache(HostWorkspaceServices workspaceServices)
        {
            if (workspaceServices.Workspace.Kind != WorkspaceKind.Host)
            {
                return new ProjectCacheService(workspaceServices.Workspace);
            }

            var projectCacheService = new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS);

            // Also clear the cache when the solution is cleared or removed.
            workspaceServices.Workspace.WorkspaceChanged += (s, e) =>
            {
                if (e.Kind == WorkspaceChangeKind.SolutionCleared || e.Kind == WorkspaceChangeKind.SolutionRemoved)
                {
                    projectCacheService.ClearImplicitCache();
                }
            };

            return projectCacheService;
        }
Exemple #16
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS));
 }
Exemple #17
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 => this;
 public CSharpProjectFileLoader(HostWorkspaceServices workspaceServices)
 {
     this.workspaceServices = workspaceServices;
 }
 public IWorkspaceService?CreateService(HostWorkspaceServices workspaceServices) =>
 new DocumentTrackingService(workspaceServices.Workspace);
Exemple #20
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new DefaultTagHelperResolver());
 }
 public IWorkspaceService?CreateService(HostWorkspaceServices workspaceServices)
 => new CompileTimeSolutionProvider(workspaceServices.Workspace);
Exemple #22
0
 public IWorkspaceService?CreateService(HostWorkspaceServices workspaceServices)
 => new EditAndContinueWorkspaceService(workspaceServices.Workspace);
 public UnitTestingHotReloadService(HostWorkspaceServices services)
 => _encService = services.GetRequiredService <IEditAndContinueWorkspaceService>();
Exemple #24
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(_singleton);
 }
Exemple #25
0
 public SolutionAssetProvider(HostWorkspaceServices services)
 {
     _services = services;
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new Factory());
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new SymbolTreeInfoCacheService(_projectToInfo, _metadataPathToInfo);
 }
Exemple #28
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new SemanticModelService());
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new Service();
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new VisualStudioGenerateTypeOptionsService();
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new Service(workspaceServices.GetService <ITemporaryStorageService>()));
 }
        public VisualStudioProjectTracker(IServiceProvider serviceProvider, HostWorkspaceServices workspaceServices)
            : base(assertIsForeground: true)
        {
            _projectMap = new Dictionary<ProjectId, AbstractProject>();
            _projectPathToIdMap = new Dictionary<string, ProjectId>(StringComparer.OrdinalIgnoreCase);

            _serviceProvider = serviceProvider;
            _workspaceHosts = new List<WorkspaceHostState>(capacity: 1);
            _workspaceServices = workspaceServices;

            _vsSolution = (IVsSolution)serviceProvider.GetService(typeof(SVsSolution));
            _runningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
            _vsSolution.AdviseSolutionEvents(this, out var solutionEventsCookie);
            _solutionEventsCookie = solutionEventsCookie;

            // It's possible that we're loading after the solution has already fully loaded, so see if we missed the event
            var shellMonitorSelection = (IVsMonitorSelection)serviceProvider.GetService(typeof(SVsShellMonitorSelection));
            if (ErrorHandler.Succeeded(shellMonitorSelection.GetCmdUIContextCookie(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_guid, out var fullyLoadedContextCookie)))
            {
                if (ErrorHandler.Succeeded(shellMonitorSelection.IsCmdUIContextActive(fullyLoadedContextCookie, out var fActive)) && fActive != 0)
                {
                    _solutionLoadComplete = true;
                }
            }
        }
 public CSharpTypeImportCompletionService(HostWorkspaceServices services)
     : base(services)
 {
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     // all different workspace kinds will share same service
     return singleton;
 }
Exemple #35
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new Service(workspaceServices.Workspace));
 }
 // Prevent inheritance outside of Roslyn.
 internal CompletionService(HostWorkspaceServices services)
 {
     _services        = services;
     _providerManager = new(this);
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new AnalyzerExecutor(_hostDiagnosticUpdateSourceOpt));
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return this;
 }
Exemple #39
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new RemoteHostClientService(workspaceServices.Workspace));
 }
Exemple #40
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 => new Service();
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new Service(
                workspaceServices.GetService <ITemporaryStorageService>() as ITemporaryStorageService2,
                workspaceServices.GetService <IDocumentationProviderService>()));
 }
Exemple #42
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(new Service(workspaceServices.Workspace as VisualStudioWorkspaceImpl));
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new SymbolMappingService();
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 => new ExtensionManager();
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     // reeturn new factory per workspace
     return new Factory();
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 => _singleton;
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return _singleton ?? (_singleton = new VisualStudioErrorLogger());
 }
 private static bool UseInMemoryWriteCache(HostWorkspaceServices workspaceServices)
 => workspaceServices.Workspace.Options.GetOption(StorageOptions.SQLiteInMemoryWriteCache) ||
 workspaceServices.GetService <IExperimentationService>()?.IsExperimentEnabled(WellKnownExperimentNames.SQLiteInMemoryWriteCache) == true;
Exemple #49
0
 IWorkspaceService IWorkspaceServiceFactory.CreateService(HostWorkspaceServices workspaceServices)
 {
     return this;
 }
Exemple #50
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return(this);
 }
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return _singleton;
 }
Exemple #52
0
 internal static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, HostWorkspaceServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken)
 => Format(node, annotation, services, options, rules: null, cancellationToken);
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new Service(workspaceServices.Workspace as VisualStudioWorkspaceImpl);
 }
Exemple #54
0
 internal static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, HostWorkspaceServices services, SyntaxFormattingOptions options, IEnumerable <AbstractFormattingRule>?rules, CancellationToken cancellationToken)
 => Format(node, GetAnnotatedSpans(node, annotation), services, options, rules, cancellationToken);
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new RemoteHostClientService(_listener, workspaceServices.Workspace, _analyzerService);
 }
Exemple #56
0
 internal static SyntaxNode Format(SyntaxNode node, TextSpan span, HostWorkspaceServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken)
 => Format(node, SpecializedCollections.SingletonEnumerable(span), services, options, rules: null, cancellationToken: cancellationToken);
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new ExtensionManager(errorHandler);
 }
Exemple #58
0
 internal static SyntaxNode Format(SyntaxNode node, IEnumerable <TextSpan>?spans, HostWorkspaceServices services, SyntaxFormattingOptions options, IEnumerable <AbstractFormattingRule>?rules, CancellationToken cancellationToken)
 => GetFormattingResult(node, spans, services, options, rules, cancellationToken).GetFormattedRoot(cancellationToken);
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 {
     return new DocumentationProviderService();
 }
Exemple #60
0
 public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
 => new RemotableDataService(_assetStorages);