mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
This commit is contained in:
@@ -27,13 +27,10 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IUntit
|
||||
|
||||
public static readonly ID = UNTITLED_QUERY_EDITOR_TYPEID;
|
||||
|
||||
private originalConnectionUri: string;
|
||||
|
||||
constructor(
|
||||
description: string | undefined,
|
||||
text: UntitledTextEditorInput,
|
||||
results: QueryResultsInput,
|
||||
initialConnectionUri: string | undefined,
|
||||
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
|
||||
@IQueryModelService queryModelService: IQueryModelService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@@ -42,7 +39,6 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IUntit
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService
|
||||
) {
|
||||
super(description, text, results, connectionManagementService, queryModelService, configurationService, instantiationService);
|
||||
this.originalConnectionUri = initialConnectionUri;
|
||||
// Set the mode explicitely to stop the auto language detection service from changing the mode unexpectedly.
|
||||
// the auto language detection service won't do the language change only if the mode is explicitely set.
|
||||
// if the mode (e.g. kusto, sql) do not exist for whatever reason, we will default it to sql.
|
||||
@@ -125,11 +121,4 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IUntit
|
||||
// Subclasses need to explicitly opt-in to being untitled.
|
||||
return EditorInputCapabilities.Untitled;
|
||||
}
|
||||
|
||||
override dispose() {
|
||||
if (this.originalConnectionUri) {
|
||||
this.connectionManagementService.disconnect(this.originalConnectionUri);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user