mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
Connect the editor for Script operations (#2123)
This commit is contained in:
@@ -218,13 +218,22 @@ export function script(connectionProfile: IConnectionProfile, metadata: sqlops.O
|
||||
let script: string = result.script;
|
||||
|
||||
if (script) {
|
||||
queryEditorService.newSqlEditor(script, connectionProfile.providerName).then(() => {
|
||||
resolve();
|
||||
queryEditorService.newSqlEditor(script, connectionProfile.providerName).then((owner) => {
|
||||
// Connect our editor to the input connection
|
||||
let options: IConnectionCompletionOptions = {
|
||||
params: { connectionType: ConnectionType.editor, runQueryOnCompletion: RunQueryOnConnectionMode.none, input: owner },
|
||||
saveTheConnection: false,
|
||||
showDashboard: false,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
};
|
||||
connectionService.connect(connectionProfile, owner.uri, options).then(() => {
|
||||
resolve();
|
||||
});
|
||||
}).catch(editorError => {
|
||||
reject(editorError);
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
let scriptNotFoundMsg = nls.localize('scriptNotFoundForObject', 'No script was returned when scripting as {0} on object {1}',
|
||||
GetScriptOperationName(operation), metadata.metadataTypeName);
|
||||
let messageDetail = '';
|
||||
|
||||
Reference in New Issue
Block a user