Example #1
0
        public RemoteLanguageServiceWorkspace(
            ExportProvider exportProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IVsFolderWorkspaceService vsFolderWorkspaceService,
            SVsServiceProvider serviceProvider,
            IDiagnosticService diagnosticService,
            ITableManagerProvider tableManagerProvider,
            IGlobalOptionService globalOptions,
            IThreadingContext threadingContext)
            : base(VisualStudioMefHostServices.Create(exportProvider), WorkspaceKind.CloudEnvironmentClientWorkspace)
        {
            _serviceProvider = serviceProvider;

            _remoteDiagnosticListTable = new RemoteDiagnosticListTable(serviceProvider, this, globalOptions, diagnosticService, tableManagerProvider);

            var runningDocumentTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable));

            _runningDocumentTableEventTracker = new RunningDocumentTableEventTracker(threadingContext, editorAdaptersFactoryService, runningDocumentTable, this);
            _threadingContext = threadingContext;

            _vsFolderWorkspaceService = vsFolderWorkspaceService;

            _remoteWorkspaceRootPaths = ImmutableHashSet <string> .Empty;
            _registeredExternalPaths  = ImmutableHashSet <string> .Empty;
        }
Example #2
0
        public SourceGeneratedFileManager(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            IThreadingContext threadingContext,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            VisualStudioWorkspace visualStudioWorkspace,
            VisualStudioDocumentNavigationService visualStudioDocumentNavigationService,
            IAsynchronousOperationListenerProvider listenerProvider)
        {
            _serviceProvider                       = serviceProvider;
            _threadingContext                      = threadingContext;
            _textDocumentFactoryService            = textDocumentFactoryService;
            _temporaryDirectory                    = Path.Combine(Path.GetTempPath(), "VisualStudioSourceGeneratedDocuments");
            _visualStudioWorkspace                 = visualStudioWorkspace;
            _visualStudioDocumentNavigationService = visualStudioDocumentNavigationService;

            Directory.CreateDirectory(_temporaryDirectory);

            _listener = listenerProvider.GetListener(FeatureAttribute.SourceGenerators);

            // The IVsRunningDocumentTable is a free-threaded VS service that allows fetching of the service and advising events
            // to be done without implicitly marshalling to the UI thread.
            _runningDocumentTable             = _serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _runningDocumentTableEventTracker = new RunningDocumentTableEventTracker(
                threadingContext,
                editorAdaptersFactoryService,
                _runningDocumentTable,
                this);
        }
        public RemoteLanguageServiceWorkspace(ExportProvider exportProvider,
                                              IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
                                              SVsServiceProvider serviceProvider,
                                              IDiagnosticService diagnosticService,
                                              ITableManagerProvider tableManagerProvider,
                                              IThreadingContext threadingContext)
            : base(VisualStudioMefHostServices.Create(exportProvider), WorkspaceKind.AnyCodeRoslynWorkspace)

        {
            _serviceProvider = serviceProvider;

            _remoteDiagnosticListTable = new RemoteDiagnosticListTable(serviceProvider, this, diagnosticService, tableManagerProvider);

            var componentModel = _serviceProvider.GetService(typeof(SComponentModel)) as IComponentModel;

            Assumes.Present(componentModel);

            _editorAdaptersFactoryService = componentModel.GetService <IVsEditorAdaptersFactoryService>();

            var runningDocumentTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable));

            _runningDocumentTableEventTracker = new RunningDocumentTableEventTracker(threadingContext, editorAdaptersFactoryService, runningDocumentTable, this);
            _threadingContext = threadingContext;
        }