Revert "Fix for database name in connection details after changing database (#22376)" (#23610)

This commit is contained in:
Cheena Malhotra
2023-06-30 13:12:59 -07:00
committed by GitHub
parent b409d9e5bb
commit a6bd752082
14 changed files with 36 additions and 76 deletions

View File

@@ -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();
}
}