mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
add config for open after save behavior (#15675)
This commit is contained in:
@@ -20,7 +20,8 @@ export interface IQueryEditorConfiguration {
|
|||||||
readonly copyIncludeHeaders: boolean,
|
readonly copyIncludeHeaders: boolean,
|
||||||
readonly copyRemoveNewLine: boolean,
|
readonly copyRemoveNewLine: boolean,
|
||||||
readonly optimizedTable: boolean,
|
readonly optimizedTable: boolean,
|
||||||
readonly inMemoryDataProcessingThreshold: number
|
readonly inMemoryDataProcessingThreshold: number,
|
||||||
|
readonly openAfterSave: boolean
|
||||||
},
|
},
|
||||||
readonly messages: {
|
readonly messages: {
|
||||||
readonly showBatchTime: boolean,
|
readonly showBatchTime: boolean,
|
||||||
|
|||||||
@@ -396,6 +396,11 @@ const queryEditorConfiguration: IConfigurationNode = {
|
|||||||
'default': 5000,
|
'default': 5000,
|
||||||
'description': localize('queryEditor.inMemoryDataProcessingThreshold', "Controls the max number of rows allowed to do filtering and sorting in memory. If the number is exceeded, sorting and filtering will be disabled. Warning: Increasing this may impact performance.")
|
'description': localize('queryEditor.inMemoryDataProcessingThreshold', "Controls the max number of rows allowed to do filtering and sorting in memory. If the number is exceeded, sorting and filtering will be disabled. Warning: Increasing this may impact performance.")
|
||||||
},
|
},
|
||||||
|
'queryEditor.results.openAfterSave': {
|
||||||
|
'type': 'boolean',
|
||||||
|
'description': localize('queryEditor.results.openAfterSave', "Whether to open the file in Azure Data Studio after the result is saved."),
|
||||||
|
'default': true
|
||||||
|
},
|
||||||
'queryEditor.messages.showBatchTime': {
|
'queryEditor.messages.showBatchTime': {
|
||||||
'type': 'boolean',
|
'type': 'boolean',
|
||||||
'description': localize('queryEditor.messages.showBatchTime', "Should execution time be shown for individual batches"),
|
'description': localize('queryEditor.messages.showBatchTime', "Should execution time be shown for individual batches"),
|
||||||
|
|||||||
@@ -314,7 +314,8 @@ export class ResultSerializer {
|
|||||||
* Open the saved file in a new vscode editor pane
|
* Open the saved file in a new vscode editor pane
|
||||||
*/
|
*/
|
||||||
private openSavedFile(filePath: URI, format: string): void {
|
private openSavedFile(filePath: URI, format: string): void {
|
||||||
if (format !== SaveFormat.EXCEL) {
|
const openAfterSaveConfig = this._configurationService.getValue<IQueryEditorConfiguration>('queryEditor').results.openAfterSave;
|
||||||
|
if (format !== SaveFormat.EXCEL && openAfterSaveConfig) {
|
||||||
this._editorService.openEditor({ resource: filePath }).then((result) => {
|
this._editorService.openEditor({ resource: filePath }).then((result) => {
|
||||||
|
|
||||||
}, (error: any) => {
|
}, (error: any) => {
|
||||||
@@ -330,7 +331,7 @@ export class ResultSerializer {
|
|||||||
[{
|
[{
|
||||||
label: nls.localize('openFile', "Open file"),
|
label: nls.localize('openFile', "Open file"),
|
||||||
run: () => {
|
run: () => {
|
||||||
this.openerService.open(filePath, { openExternal: true });
|
this.openerService.open(filePath, { openExternal: format === SaveFormat.EXCEL });
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user