Change:
Testing Have a file in a folder : Like this: ! Right click and rename Type Observe the message: ! That message is wrong, because pressing Enter will create a folder and then move file into it.
I think the message can be improved but the behavior is by design
Yeah, that's what I'm trying to say, that the help message is wrong

Discussion:
return nls.localize('emptyFileNameError', "A file or folder name must be provided."); } <ins> // Relative paths only if (name[0] === '/' || name[0] === '') { return nls.localize('fileNameStartsWithSlashError', "A file or folder name cannot start with a slash."); } </ins> const names: string[] = name.split(/[/]/).filter(part => !!part); const analyzedPath = analyzePath(parent, names);

if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) { projectFolderName = paths.basename(stat.root.resource.fsPath);	// show root folder name in multi-folder project } <del> this.displayCurrentPath(inputBox, initialRelPath, fileKind, projectFolderName); </del> <ins> this.displayCurrentPath(inputBox, initialRelPath, projectFolderName, editableData.action.id); </ins> }), DOM.addDisposableListener(inputBox.inputElement, DOM.EventType.BLUR, () => { done(inputBox.isInputValid(), true);

]; } <del> private displayCurrentPath(inputBox: InputBox, initialRelPath: string, fileKind: FileKind, projectFolderName: string = '') { </del> <ins> private displayCurrentPath(inputBox: InputBox, initialRelPath: string, projectFolderName: string = '', actionID: string) { </ins> if (inputBox.validate()) { const value = inputBox.value; <del> if (value && value.search(/[/]/) !== -1) {	// only show if there's a slash </del> <ins> if (value && /.[/]./.test(value)) {	// only show if there's at least one slash enclosed in the string </ins> let displayPath = path.normalize(path.join(projectFolderName, initialRelPath, value)); displayPath = rtrim(displayPath, paths.nativeSep); <del> const fileType: string = FileKind[fileKind].toLowerCase(); </del> <ins> const indexLastSlash: number = displayPath.lastIndexOf(paths.nativeSep); const name: string = displayPath.substring(indexLastSlash + 1); const leadingPathPart: string = displayPath.substring(0, indexLastSlash); let msg: string; switch (actionID) { case 'workbench.files.action.createFileFromExplorer': msg = nls.localize('createFileFromExplorerInfoMessage', "Create file **{0}** in **{1}**", name, leadingPathPart); break; case 'workbench.files.action.renameFile': msg = nls.localize('renameFileFromExplorerInfoMessage', "Move and rename to **{0}**", displayPath); break; case 'workbench.files.action.createFolderFromExplorer':	// fallthrough default: msg = nls.localize('createFolderFromExplorerInfoMessage', "Create folder **{0}** in **{1}**", name, leadingPathPart); } </ins> inputBox.showMessage({ type: MessageType.INFO, <del> content: nls.localize('constructedPath', "Create {0} in **{1}**", fileType, displayPath), </del> <ins> content: msg, </ins> formatContent: true }); }

assert(validateFileName(wsFolder, 'foobar') === null); assert(validateFileName(wsFolder, 'all/slashes/are/same') === null); assert(validateFileName(wsFolder, 'theres/one/differentslash') === null); <del> assert(validateFileName(wsFolder, '/slashAtBeginning') === null); </del> <ins> assert(validateFileName(wsFolder, '/slashAtBeginning') !== null); </ins> // validation should detect if user tries to add a child to a file const fileInRoot = createStat('/fileInRoot', 'fileInRoot', false, false, 8096, d);