mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add saved files to recently opened (#20470)
This commit is contained in:
@@ -193,12 +193,8 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
|
||||
}
|
||||
}
|
||||
|
||||
private addFileToRecentlyOpened(uri: URI): void {
|
||||
// add the picked file into the list of recently opened
|
||||
// only if it is outside the currently opened workspace
|
||||
if (!this.contextService.isInsideWorkspace(uri)) {
|
||||
this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri) }]);
|
||||
}
|
||||
protected addFileToRecentlyOpened(uri: URI): void {
|
||||
this.workspacesService.addRecentlyOpened([{ fileUri: uri, label: this.labelService.getUriLabel(uri) }]);
|
||||
}
|
||||
|
||||
protected async pickFolderAndOpenSimplified(schema: string, options: IPickAndOpenOptions): Promise<void> {
|
||||
@@ -228,7 +224,13 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
|
||||
}
|
||||
|
||||
options.title = nls.localize('saveFileAs.title', 'Save As');
|
||||
return this.saveRemoteResource(options);
|
||||
const uri = await this.saveRemoteResource(options);
|
||||
|
||||
if (uri) {
|
||||
this.addFileToRecentlyOpened(uri);
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
protected async showSaveDialogSimplified(schema: string, options: ISaveDialogOptions): Promise<URI | undefined> {
|
||||
|
||||
@@ -131,7 +131,11 @@ export class FileDialogService extends AbstractFileDialogService implements IFil
|
||||
} else {
|
||||
const result = await this.nativeHostService.showSaveDialog(this.toNativeSaveDialogOptions(options));
|
||||
if (result && !result.canceled && result.filePath) {
|
||||
return URI.file(result.filePath);
|
||||
const uri = URI.file(result.filePath);
|
||||
|
||||
this.addFileToRecentlyOpened(uri);
|
||||
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
return undefined; // {{SQL CARBON EDIT}} strict-null-check
|
||||
|
||||
Reference in New Issue
Block a user