query results filtering and sorting (#14833)

* query results filtering and sorting (#14589)

* enable filter

* attach button style

* add hybrid data provider

* make filter and sort work

* fix editor switch issue

* configuration

* fix sort and filter

* add more specific selector

* fix hidden items issue

* update text

* revert text change

* fix copy results issue

* put feature behind preview flag

* comments

* fix tslint error
This commit is contained in:
Alan Ren
2021-03-23 11:30:41 -07:00
committed by GitHub
parent 5c67f3dbed
commit 6c54059f89
22 changed files with 554 additions and 132 deletions

View File

@@ -26,6 +26,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { IRange, Range } from 'vs/editor/common/core/range';
import { BatchSummary, IQueryMessage, ResultSetSummary, QueryExecuteSubsetParams, CompleteBatchSummary, IResultMessage, ResultSetSubset, BatchStartSummary } from './query';
import { IQueryEditorConfiguration } from 'sql/platform/query/common/query';
import { IDisposableDataProvider } from 'sql/base/common/dataProvider';
/*
* Query Runner class which handles running a query, reports the results to the content manager,
@@ -501,18 +502,19 @@ export class QueryGridDataProvider implements IGridDataProvider {
return this.queryRunner.getQueryRows(rowStart, numberOfRows, this.batchId, this.resultSetId);
}
copyResults(selection: Slick.Range[], includeHeaders?: boolean): Promise<void> {
return this.copyResultsAsync(selection, includeHeaders);
copyResults(selection: Slick.Range[], includeHeaders?: boolean, tableView?: IDisposableDataProvider<Slick.SlickData>): Promise<void> {
return this.copyResultsAsync(selection, includeHeaders, tableView);
}
private async copyResultsAsync(selection: Slick.Range[], includeHeaders?: boolean): Promise<void> {
private async copyResultsAsync(selection: Slick.Range[], includeHeaders?: boolean, tableView?: IDisposableDataProvider<Slick.SlickData>): Promise<void> {
try {
let results = await getResultsString(this, selection, includeHeaders);
const results = await getResultsString(this, selection, includeHeaders, tableView);
await this._clipboardService.writeText(results);
} catch (error) {
this._notificationService.error(nls.localize('copyFailed', "Copy failed with error {0}", getErrorMessage(error)));
}
}
getEolString(): string {
return getEolString(this._textResourcePropertiesService, this.queryRunner.uri);
}