mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
open a file on a different path but with same name fails (#208785)
Fixes #204886
This commit is contained in:
parent
4166553e05
commit
1a54634c51
|
@ -581,7 +581,12 @@ export class SimpleFileDialog implements ISimpleFileDialog {
|
|||
valueUri = this.root(this.currentFolder);
|
||||
value = this.pathFromUri(valueUri);
|
||||
return await this.updateItems(valueUri, true) ? UpdateResult.UpdatedWithTrailing : UpdateResult.Updated;
|
||||
} else if (!resources.extUriIgnorePathCase.isEqual(this.currentFolder, valueUri) && (this.endsWithSlash(value) || (!resources.extUriIgnorePathCase.isEqual(this.currentFolder, resources.dirname(valueUri)) && resources.extUriIgnorePathCase.isEqualOrParent(this.currentFolder, resources.dirname(valueUri))))) {
|
||||
} else {
|
||||
const newFolderIsOldFolder = resources.extUriIgnorePathCase.isEqual(this.currentFolder, valueUri);
|
||||
const newFolderIsSubFolder = resources.extUriIgnorePathCase.isEqual(this.currentFolder, resources.dirname(valueUri));
|
||||
const newFolderIsParent = !newFolderIsOldFolder && resources.extUriIgnorePathCase.isEqualOrParent(this.currentFolder, resources.dirname(valueUri));
|
||||
const newFolderIsUnrelated = !newFolderIsOldFolder && !newFolderIsParent && !newFolderIsSubFolder;
|
||||
if (this.endsWithSlash(value) || newFolderIsParent || newFolderIsUnrelated) {
|
||||
let stat: IFileStatWithPartialMetadata | undefined;
|
||||
try {
|
||||
stat = await this.fileService.stat(valueUri);
|
||||
|
@ -619,6 +624,7 @@ export class SimpleFileDialog implements ISimpleFileDialog {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.badPath = undefined;
|
||||
return UpdateResult.NotUpdated;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue