Revert "Windows ssh remote: Cannot use \ in explorer new file dialog to create directories"

This reverts commit 85f587ab64.
This commit is contained in:
isidor
2019-12-18 10:57:54 +01:00
parent a62ea85438
commit 26f5dfcd76
@@ -7,7 +7,7 @@ import 'vs/css!./media/fileactions';
import * as nls from 'vs/nls';
import { isWindows, isWeb } from 'vs/base/common/platform';
import * as extpath from 'vs/base/common/extpath';
import { extname, basename, posix, win32 } from 'vs/base/common/path';
import { extname, basename } from 'vs/base/common/path';
import * as resources from 'vs/base/common/resources';
import { URI } from 'vs/base/common/uri';
import { toErrorMessage } from 'vs/base/common/errorMessage';
@@ -45,7 +45,6 @@ import { asDomUri, triggerDownload } from 'vs/base/browser/dom';
import { mnemonicButtonLabel } from 'vs/base/common/labels';
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
import { IWorkingCopyService, IWorkingCopy } from 'vs/workbench/services/workingCopy/common/workingCopyService';
import { ILabelService } from 'vs/platform/label/common/label';
export const NEW_FILE_COMMAND_ID = 'explorer.newFile';
export const NEW_FILE_LABEL = nls.localize('newFile', "New File");
@@ -855,7 +854,6 @@ async function openExplorerAndCreate(accessor: ServicesAccessor, isFolder: boole
const editorService = accessor.get(IEditorService);
const viewletService = accessor.get(IViewletService);
const notificationService = accessor.get(INotificationService);
const labelService = accessor.get(ILabelService);
await viewletService.openViewlet(VIEWLET_ID, true);
@@ -878,10 +876,7 @@ async function openExplorerAndCreate(accessor: ServicesAccessor, isFolder: boole
folder.addChild(newStat);
const onSuccess = (value: string): Promise<void> => {
const separator = labelService.getSeparator(folder.resource.scheme);
const resource = folder.resource.with({ path: separator === '/' ? posix.join(folder.resource.path, value) : win32.join(folder.resource.path, value) });
const createPromise = isFolder ? fileService.createFolder(resource) : textFileService.create(resource);
const createPromise = isFolder ? fileService.createFolder(resources.joinPath(folder.resource, value)) : textFileService.create(resources.joinPath(folder.resource, value));
return createPromise.then(created => {
refreshIfSeparator(value, explorerService);
return isFolder ? explorerService.select(created.resource, true)