mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
implement editor move and fix disposal error in query editor (#9281)
This commit is contained in:
@@ -193,10 +193,6 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
public isDirty(): boolean { return this._text.isDirty(); }
|
public isDirty(): boolean { return this._text.isDirty(); }
|
||||||
public get resource(): URI { return this._text.resource; }
|
public get resource(): URI { return this._text.resource; }
|
||||||
|
|
||||||
public matchInputInstanceType(inputType: any): boolean {
|
|
||||||
return (this._text instanceof inputType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getName(longForm?: boolean): string {
|
public getName(longForm?: boolean): string {
|
||||||
if (this.configurationService.getValue('sql.showConnectionInfoInTitle')) {
|
if (this.configurationService.getValue('sql.showConnectionInfoInTitle')) {
|
||||||
let profile = this.connectionManagementService.getConnectionProfile(this.uri);
|
let profile = this.connectionManagementService.getConnectionProfile(this.uri);
|
||||||
@@ -289,8 +285,10 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
|
|
||||||
public onDisconnect(): void {
|
public onDisconnect(): void {
|
||||||
this.state.connected = false;
|
this.state.connected = false;
|
||||||
|
if (!this.isDisposed()) {
|
||||||
this._onDidChangeLabel.fire();
|
this._onDidChangeLabel.fire();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public onRunQuery(): void {
|
public onRunQuery(): void {
|
||||||
this.state.executing = true;
|
this.state.executing = true;
|
||||||
@@ -309,10 +307,9 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
|||||||
}
|
}
|
||||||
|
|
||||||
public dispose() {
|
public dispose() {
|
||||||
|
super.dispose(); // we want to dispose first so that for future logic we know we are disposed
|
||||||
this.queryModelService.disposeQuery(this.uri);
|
this.queryModelService.disposeQuery(this.uri);
|
||||||
this.connectionManagementService.disconnectEditor(this, true);
|
this.connectionManagementService.disconnectEditor(this, true);
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isSharedSession(): boolean {
|
public get isSharedSession(): boolean {
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import { IQueryModelService } from 'sql/workbench/services/query/common/queryMod
|
|||||||
|
|
||||||
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { EncodingMode } from 'vs/workbench/common/editor';
|
import { EncodingMode, IMoveResult, GroupIdentifier } from 'vs/workbench/common/editor';
|
||||||
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
|
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
|
||||||
import { ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
import { ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
type PublicPart<T> = { [K in keyof T]: T[K] };
|
type PublicPart<T> = { [K in keyof T]: T[K] };
|
||||||
|
|
||||||
@@ -82,4 +83,8 @@ export class FileQueryEditorInput extends QueryEditorInput implements PublicPart
|
|||||||
public isResolved(): boolean {
|
public isResolved(): boolean {
|
||||||
return this.text.isResolved();
|
return this.text.isResolved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public move(group: GroupIdentifier, target: URI): IMoveResult {
|
||||||
|
return this.text.move(group, target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user