public async Task <Unit> Handle(AddDocumentParams request, CancellationToken cancellationToken) { _foregroundDispatcher.AssertBackgroundThread(); var textLoader = _remoteTextLoaderFactory.Create(request.FilePath); await Task.Factory.StartNew( () => _projectService.AddDocument(request.FilePath, textLoader), CancellationToken.None, TaskCreationOptions.None, _foregroundDispatcher.ForegroundScheduler); return(Unit.Value); }
public async Task <Unit> Handle(DidCloseTextDocumentParams notification, CancellationToken token) { _foregroundDispatcher.AssertBackgroundThread(); var textLoader = _remoteTextLoaderFactory.Create(notification.TextDocument.Uri.AbsolutePath); await Task.Factory.StartNew( () => _projectService.CloseDocument(notification.TextDocument.Uri.AbsolutePath, textLoader), CancellationToken.None, TaskCreationOptions.None, _foregroundDispatcher.ForegroundScheduler); return(Unit.Value); }