public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (workspaceServices == null)
            {
                throw new ArgumentNullException(nameof(workspaceServices));
            }

            var fileChangeTrackerFactory = workspaceServices.GetRequiredService <FileChangeTrackerFactory>();
            var editorDocumentManager    = new VisualStudioMacEditorDocumentManager(_foregroundDispatcher, fileChangeTrackerFactory);

            return(editorDocumentManager);
        }
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
        {
            if (workspaceServices is null)
            {
                throw new ArgumentNullException(nameof(workspaceServices));
            }

            var fileChangeTrackerFactory = workspaceServices.GetRequiredService <FileChangeTrackerFactory>();
            var editorDocumentManager    = new VisualStudioMacEditorDocumentManager(_projectSnapshotManagerDispatcher, _joinableTaskContext, fileChangeTrackerFactory);

            return(editorDocumentManager);
        }
        public override Task Initialize(Properties status)
        {
            var controller = (FileDocumentController)Controller;
            var filePath   = controller.FilePath.ToString();
            var textBuffer = controller.GetContent <ITextBuffer>();

            if (!_workspaceAccessor.TryGetWorkspace(textBuffer, out var workspace))
            {
                return(Task.CompletedTask);
            }

            _editorDocumentManager = workspace.Services.GetRequiredService <EditorDocumentManager>() as VisualStudioMacEditorDocumentManager;

            Debug.Assert(_editorDocumentManager != null);

            _editorDocumentManager.HandleDocumentOpened(filePath, textBuffer);

            return(Task.CompletedTask);
        }