Merge from vscode 777931080477e28b7c27e8f7d4b0d69897945946 (#9220)

This commit is contained in:
Anthony Dresser
2020-02-19 22:27:53 -08:00
committed by GitHub
parent ab6fb810f8
commit 0cec223301
115 changed files with 1431 additions and 1133 deletions

View File

@@ -28,7 +28,6 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/commo
import { withNullAsUndefined } from 'vs/base/common/types';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { isStandalone } from 'vs/base/browser/browser';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
export interface IDraggedResource {
@@ -343,7 +342,6 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources:
// Editors: enables cross window DND of tabs into the editor area
const textFileService = accessor.get(ITextFileService);
const editorService = accessor.get(IEditorService);
const modelService = accessor.get(IModelService);
const draggedEditors: ISerializedDraggedEditor[] = [];
files.forEach(file => {
@@ -374,11 +372,8 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources:
// If the resource is dirty or untitled, send over its content
// to restore dirty state. Get that from the text model directly
let content: string | undefined = undefined;
if (textFileService.isDirty(file.resource)) {
const textModel = modelService.getModel(file.resource);
if (textModel) {
content = textModel.getValue();
}
if (model?.isDirty()) {
content = model.textEditorModel.getValue();
}
// Add as dragged editor