Remove references to query model service in query code (#6513)

* remove references of query model service from query code

* fix tests

* clean up the code
This commit is contained in:
Anthony Dresser
2019-08-03 01:26:58 -07:00
committed by GitHub
parent 62d2fb534d
commit 674351dc75
12 changed files with 113 additions and 201 deletions

View File

@@ -24,7 +24,6 @@ import {
RunQueryOnConnectionMode
} from 'sql/platform/connection/common/connectionManagement';
import { QueryEditor } from 'sql/workbench/parts/query/browser/queryEditor';
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { attachEditableDropdownStyler, attachSelectBoxStyler } from 'sql/platform/theme/common/styler';
import { Dropdown } from 'sql/base/parts/editableDropdown/browser/dropdown';
@@ -107,9 +106,7 @@ export class RunQueryAction extends QueryTaskbarAction {
constructor(
editor: QueryEditor,
@IQueryModelService protected readonly queryModelService: IQueryModelService,
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
@IExtensionTipsService private readonly extensionTipsService: IExtensionTipsService
@IConnectionManagementService connectionManagementService: IConnectionManagementService
) {
super(connectionManagementService, editor, RunQueryAction.ID, RunQueryAction.EnabledClass);
this.label = nls.localize('runQueryLabel', "Run");
@@ -178,8 +175,7 @@ export class CancelQueryAction extends QueryTaskbarAction {
constructor(
editor: QueryEditor,
@IQueryModelService private readonly queryModelService: IQueryModelService,
@IConnectionManagementService connectionManagementService: IConnectionManagementService
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
) {
super(connectionManagementService, editor, CancelQueryAction.ID, CancelQueryAction.EnabledClass);
this.enabled = false;
@@ -188,7 +184,7 @@ export class CancelQueryAction extends QueryTaskbarAction {
public run(): Promise<void> {
if (this.isConnected(this.editor)) {
this.queryModelService.cancelQuery(this.editor.input.uri);
this.editor.input.runner.cancelQuery();
}
return Promise.resolve(null);
}