mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
Fix handling of connections in editors (#9682)
* fix handling of connections in editors * initial tests * remove test
This commit is contained in:
@@ -120,7 +120,7 @@ export function openNewQuery(accessor: ServicesAccessor, profile?: IConnectionPr
|
||||
if (!profile) {
|
||||
profile = getCurrentGlobalConnection(objectExplorerService, connectionManagementService, editorService);
|
||||
}
|
||||
return queryEditorService.newSqlEditor(initalContent).then((owner: IConnectableInput) => {
|
||||
return queryEditorService.newSqlEditor({ initalContent }).then((owner: IConnectableInput) => {
|
||||
// Connect our editor to the input connection
|
||||
let options: IConnectionCompletionOptions = {
|
||||
params: { connectionType: ConnectionType.editor, runQueryOnCompletion: onConnection, input: owner },
|
||||
|
||||
@@ -42,7 +42,7 @@ export class QueryEditorLanguageAssociation implements ILanguageAssociation {
|
||||
queryEditorInput = this.instantiationService.createInstance(FileQueryEditorInput, '', activeEditor, queryResultsInput);
|
||||
} else if (activeEditor instanceof UntitledTextEditorInput) {
|
||||
const content = (await activeEditor.resolve()).textEditorModel.getValue();
|
||||
queryEditorInput = (this.queryEditorService.newSqlEditor(content) as any) as UntitledQueryEditorInput;
|
||||
queryEditorInput = await this.queryEditorService.newSqlEditor({ open: false, initalContent: content }) as UntitledQueryEditorInput;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user