mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode 05fc61ffb1aee9fd19173c32113daed079f9b7bd (#5074)
* Merge from vscode 05fc61ffb1aee9fd19173c32113daed079f9b7bd * fix tests
This commit is contained in:
@@ -52,7 +52,6 @@ export class RemoteFileDialog {
|
||||
private remoteAuthority: string | undefined;
|
||||
private requiresTrailing: boolean;
|
||||
private scheme: string = REMOTE_HOST_SCHEME;
|
||||
private shouldOverwriteFile: boolean = false;
|
||||
private contextKey: IContextKey<boolean>;
|
||||
private userEnteredPathSegment: string;
|
||||
private autoCompletePathSegment: string;
|
||||
@@ -179,6 +178,7 @@ export class RemoteFileDialog {
|
||||
this.filePickBox = this.quickInputService.createQuickPick<FileQuickPickItem>();
|
||||
this.filePickBox.matchOnLabel = false;
|
||||
this.filePickBox.autoFocusOnList = false;
|
||||
this.filePickBox.ignoreFocusOut = true;
|
||||
this.filePickBox.ok = true;
|
||||
if (this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1)) {
|
||||
this.filePickBox.customButton = true;
|
||||
@@ -255,6 +255,7 @@ export class RemoteFileDialog {
|
||||
isAcceptHandled = false;
|
||||
// update input box to match the first selected item
|
||||
if ((i.length === 1) && this.isChangeFromUser()) {
|
||||
this.filePickBox.validationMessage = undefined;
|
||||
this.setAutoComplete(this.constructFullUserPath(), this.userEnteredPathSegment, i[0], true);
|
||||
}
|
||||
});
|
||||
@@ -265,7 +266,6 @@ export class RemoteFileDialog {
|
||||
// If the user has just entered more bad path, don't change anything
|
||||
if (value !== this.constructFullUserPath() && !this.isBadSubpath(value)) {
|
||||
this.filePickBox.validationMessage = undefined;
|
||||
this.shouldOverwriteFile = false;
|
||||
const valueUri = this.remoteUriFrom(this.trimTrailingSlash(this.filePickBox.value));
|
||||
let updated: UpdateResult = UpdateResult.NotUpdated;
|
||||
if (!resources.isEqual(this.remoteUriFrom(this.trimTrailingSlash(this.pathFromUri(this.currentFolder))), valueUri, true)) {
|
||||
@@ -550,9 +550,8 @@ export class RemoteFileDialog {
|
||||
// Can't do this
|
||||
this.filePickBox.validationMessage = nls.localize('remoteFileDialog.validateFolder', 'The folder already exists. Please use a new file name.');
|
||||
return Promise.resolve(false);
|
||||
} else if (stat && !this.shouldOverwriteFile) {
|
||||
} else if (stat) {
|
||||
// Replacing a file.
|
||||
this.shouldOverwriteFile = true;
|
||||
// Show a yes/no prompt
|
||||
const message = nls.localize('remoteFileDialog.validateExisting', '{0} already exists. Are you sure you want to overwrite it?', resources.basename(uri));
|
||||
return this.yesNoPrompt(message);
|
||||
|
||||
Reference in New Issue
Block a user