mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix saved queries opening in plain text editor (#18096)
This commit is contained in:
@@ -1157,9 +1157,12 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces connection info uri with new uri.
|
* Replaces connection info uri with new uri. No-op if the URI does not currently have an associated connection.
|
||||||
*/
|
*/
|
||||||
public changeConnectionUri(newUri: string, oldUri: string): void {
|
public changeConnectionUri(newUri: string, oldUri: string): void {
|
||||||
|
if (!this._connectionStatusManager.hasConnection(oldUri)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._connectionStatusManager.changeConnectionUri(newUri, oldUri);
|
this._connectionStatusManager.changeConnectionUri(newUri, oldUri);
|
||||||
if (!this._uriToProvider[oldUri]) {
|
if (!this._uriToProvider[oldUri]) {
|
||||||
this._logService.error(`No provider found for old URI : '${oldUri}'`);
|
this._logService.error(`No provider found for old URI : '${oldUri}'`);
|
||||||
|
|||||||
@@ -435,8 +435,8 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
// Get existing query runner
|
// Get existing query runner
|
||||||
let queryRunner = this.internalGetQueryRunner(oldUri);
|
let queryRunner = this.internalGetQueryRunner(oldUri);
|
||||||
if (!queryRunner) {
|
if (!queryRunner) {
|
||||||
this._logService.error(`A Query and QueryRunner was not found for '${oldUri}'`);
|
// Nothing to do if we don't have a query runner currently (no connection)
|
||||||
throw new Error(nls.localize('queryModelService.noQueryFoundForUri', 'No Query found for {0}', oldUri));
|
return;
|
||||||
}
|
}
|
||||||
else if (this._queryInfoMap.has(newUri)) {
|
else if (this._queryInfoMap.has(newUri)) {
|
||||||
this._logService.error(`New URI '${newUri}' already has query info associated with it.`);
|
this._logService.error(`New URI '${newUri}' already has query info associated with it.`);
|
||||||
|
|||||||
Reference in New Issue
Block a user