mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add a few missed instantiation service usages (#17554)
* Add a few missed instantiation service usages * remove unused
This commit is contained in:
@@ -105,15 +105,14 @@ export class CopyResultAction extends Action {
|
|||||||
constructor(
|
constructor(
|
||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
private configurationService: IConfigurationService,
|
|
||||||
private copyHeader: boolean,
|
private copyHeader: boolean,
|
||||||
private accountForNumberColumn = true
|
@IConfigurationService private configurationService: IConfigurationService
|
||||||
) {
|
) {
|
||||||
super(id, label);
|
super(id, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async run(context: IGridActionContext): Promise<void> {
|
public override async run(context: IGridActionContext): Promise<void> {
|
||||||
const selection = this.accountForNumberColumn ? mapForNumberColumn(context.selection) : context.selection;
|
const selection = mapForNumberColumn(context.selection);
|
||||||
const includeHeader = this.configurationService.getValue<boolean>('queryEditor.results.copyIncludeHeaders') || this.copyHeader;
|
const includeHeader = this.configurationService.getValue<boolean>('queryEditor.results.copyIncludeHeaders') || this.copyHeader;
|
||||||
await context.gridDataProvider.copyResults(selection, includeHeader, context.table.getData());
|
await context.gridDataProvider.copyResults(selection, includeHeader, context.table.getData());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
|||||||
this.rowNumberColumn = new RowNumberColumn({ numberOfRows: this.resultSet.rowCount });
|
this.rowNumberColumn = new RowNumberColumn({ numberOfRows: this.resultSet.rowCount });
|
||||||
let copyHandler = new CopyKeybind<T>();
|
let copyHandler = new CopyKeybind<T>();
|
||||||
copyHandler.onCopy(e => {
|
copyHandler.onCopy(e => {
|
||||||
new CopyResultAction(CopyResultAction.COPY_ID, CopyResultAction.COPY_LABEL, this.configurationService, false).run(this.generateContext());
|
this.instantiationService.createInstance(CopyResultAction, CopyResultAction.COPY_ID, CopyResultAction.COPY_LABEL, false).run(this.generateContext());
|
||||||
});
|
});
|
||||||
this.columns.unshift(this.rowNumberColumn.getColumnDefinition());
|
this.columns.unshift(this.rowNumberColumn.getColumnDefinition());
|
||||||
let tableOptions: Slick.GridOptions<T> = {
|
let tableOptions: Slick.GridOptions<T> = {
|
||||||
@@ -814,8 +814,8 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
|||||||
actions.push(new Separator());
|
actions.push(new Separator());
|
||||||
}
|
}
|
||||||
actions.push(
|
actions.push(
|
||||||
new CopyResultAction(CopyResultAction.COPY_ID, CopyResultAction.COPY_LABEL, this.configurationService, false),
|
this.instantiationService.createInstance(CopyResultAction, CopyResultAction.COPY_ID, CopyResultAction.COPY_LABEL, false),
|
||||||
new CopyResultAction(CopyResultAction.COPYWITHHEADERS_ID, CopyResultAction.COPYWITHHEADERS_LABEL, this.configurationService, true)
|
this.instantiationService.createInstance(CopyResultAction, CopyResultAction.COPYWITHHEADERS_ID, CopyResultAction.COPYWITHHEADERS_LABEL, true)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.state.canBeMaximized) {
|
if (this.state.canBeMaximized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user