diff --git a/extensions/azuremonitor/package.json b/extensions/azuremonitor/package.json index e1ce0d9e5e6a..8fccd909984d 100644 --- a/extensions/azuremonitor/package.json +++ b/extensions/azuremonitor/package.json @@ -209,7 +209,7 @@ "update-grammar": "node ../../build/npm/update-grammar.js Microsoft/vscode-azuremonitor ./syntaxes/azuremonitor.tmLanguage" }, "dependencies": { - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "figures": "^2.0.0", "find-remove": "1.2.1", "@microsoft/ads-service-downloader": "^1.2.1", diff --git a/extensions/azuremonitor/yarn.lock b/extensions/azuremonitor/yarn.lock index 3379fffc6f36..8131efa64d5e 100644 --- a/extensions/azuremonitor/yarn.lock +++ b/extensions/azuremonitor/yarn.lock @@ -75,9 +75,9 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/extensions/datavirtualization/package.json b/extensions/datavirtualization/package.json index 8b6c65a193e2..5346dbf19f3f 100644 --- a/extensions/datavirtualization/package.json +++ b/extensions/datavirtualization/package.json @@ -107,7 +107,7 @@ "dependencies": { "@microsoft/ads-extension-telemetry": "^3.0.1", "@microsoft/ads-service-downloader": "^1.2.1", - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "vscode-nls": "^5.2.0" }, "devDependencies": { diff --git a/extensions/datavirtualization/yarn.lock b/extensions/datavirtualization/yarn.lock index ea559862b7e8..447e26017a49 100644 --- a/extensions/datavirtualization/yarn.lock +++ b/extensions/datavirtualization/yarn.lock @@ -504,9 +504,9 @@ crypt@0.0.2: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/extensions/import/package.json b/extensions/import/package.json index 4ab0b54e828d..e566318c8fbb 100644 --- a/extensions/import/package.json +++ b/extensions/import/package.json @@ -77,7 +77,7 @@ } }, "dependencies": { - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "htmlparser2": "^3.10.1", "@microsoft/ads-service-downloader": "^1.2.1", "@microsoft/ads-extension-telemetry": "^3.0.1", diff --git a/extensions/import/src/test/utils.test.ts b/extensions/import/src/test/utils.test.ts index b940c479be92..4179fd17b18f 100644 --- a/extensions/import/src/test/utils.test.ts +++ b/extensions/import/src/test/utils.test.ts @@ -78,7 +78,7 @@ export class TestQueryProvider implements azdata.QueryProvider { saveResults(requestParams: azdata.SaveResultsRequestParams): Thenable { throw new Error('Method not implemented.'); } - copyResults(requestParams: azdata.CopyResultsRequestParams): Thenable { + copyResults(requestParams: azdata.CopyResultsRequestParams): Thenable { throw new Error('Method not implemented.'); } setQueryExecutionOptions(ownerUri: string, options: azdata.QueryExecutionOptions): Thenable { diff --git a/extensions/import/yarn.lock b/extensions/import/yarn.lock index 464ef1d865bb..886361e77b53 100644 --- a/extensions/import/yarn.lock +++ b/extensions/import/yarn.lock @@ -559,9 +559,9 @@ crypt@0.0.2: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/extensions/kusto/package.json b/extensions/kusto/package.json index 13787282c692..fe2cdd913c6e 100644 --- a/extensions/kusto/package.json +++ b/extensions/kusto/package.json @@ -444,7 +444,7 @@ } }, "dependencies": { - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "figures": "^2.0.0", "find-remove": "1.2.1", "@microsoft/ads-service-downloader": "^1.2.1", diff --git a/extensions/kusto/yarn.lock b/extensions/kusto/yarn.lock index 97a3ce2df8c5..b36a8673b94d 100644 --- a/extensions/kusto/yarn.lock +++ b/extensions/kusto/yarn.lock @@ -124,9 +124,9 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/extensions/mssql/config.json b/extensions/mssql/config.json index 1a02ff944fb1..44fcd3446152 100644 --- a/extensions/mssql/config.json +++ b/extensions/mssql/config.json @@ -1,6 +1,6 @@ { "downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}", - "version": "5.0.20240724.1", + "version": "5.0.20240912.2", "downloadFileNames": { "Windows_86": "win-x86-net8.0.zip", "Windows_64": "win-x64-net8.0.zip", diff --git a/extensions/mssql/package.json b/extensions/mssql/package.json index f22c75d98ab4..d4c07c53b9e2 100644 --- a/extensions/mssql/package.json +++ b/extensions/mssql/package.json @@ -1712,7 +1712,7 @@ "@aws-sdk/client-s3": "^3.490.0", "@microsoft/ads-extension-telemetry": "^3.0.1", "@microsoft/ads-service-downloader": "^1.2.1", - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "find-remove": "1.2.1", "vscode-languageclient": "5.2.1", "vscode-nls": "^4.0.0" diff --git a/extensions/mssql/yarn.lock b/extensions/mssql/yarn.lock index b4a6749edffd..21e7e9e10849 100644 --- a/extensions/mssql/yarn.lock +++ b/extensions/mssql/yarn.lock @@ -1559,9 +1559,9 @@ crypt@0.0.2: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/extensions/sql-migration/package.json b/extensions/sql-migration/package.json index 75cd8ba1ff3c..65597ea07d6d 100644 --- a/extensions/sql-migration/package.json +++ b/extensions/sql-migration/package.json @@ -174,7 +174,7 @@ ] }, "dependencies": { - "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.0", + "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#2.0.1", "@microsoft/ads-service-downloader": "^1.2.1", "@microsoft/ads-extension-telemetry": "^3.0.1", "uuid": "^8.3.2", diff --git a/extensions/sql-migration/yarn.lock b/extensions/sql-migration/yarn.lock index 8fb6e726a5a9..4ede03b200e2 100644 --- a/extensions/sql-migration/yarn.lock +++ b/extensions/sql-migration/yarn.lock @@ -195,9 +195,9 @@ chownr@^2.0.0: resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== -"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.0": - version "2.0.0" - resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/39d7544771a4f44e707d0a38eb2fda1f08793d08" +"dataprotocol-client@github:Microsoft/sqlops-dataprotocolclient#2.0.1": + version "2.0.1" + resolved "https://codeload.github.com/Microsoft/sqlops-dataprotocolclient/tar.gz/7e8dff4aee7e674516367421a3e84fe9a1aa37b1" dependencies: vscode-languageclient "5.2.1" diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index acac6b5f8dd8..129d2577467a 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -894,13 +894,6 @@ declare module 'azdata' { selections: SelectionRange[]; } - export interface CopyResultsRequestResult { - /** - * Result string from copy operation - */ - results: string; - } - export interface QueryProvider { /** * Notify clients that the URI for a connection has been changed. @@ -912,7 +905,7 @@ declare module 'azdata' { * ADS will use this if 'supportCopyResultsToClipboard' property is set to true in the provider contribution point in extension's package.json. * Otherwise, The default handler will load all the selected data to ADS and perform the copy operation. */ - copyResults?(requestParams: CopyResultsRequestParams): Thenable; + copyResults?(requestParams: CopyResultsRequestParams): Thenable; } export enum DataProviderType { diff --git a/src/sql/workbench/api/browser/mainThreadDataProtocol.ts b/src/sql/workbench/api/browser/mainThreadDataProtocol.ts index e39384c463c1..40abdce2dc48 100644 --- a/src/sql/workbench/api/browser/mainThreadDataProtocol.ts +++ b/src/sql/workbench/api/browser/mainThreadDataProtocol.ts @@ -161,7 +161,7 @@ export class MainThreadDataProtocol extends Disposable implements MainThreadData return Promise.resolve(self._serializationService.saveAs(requestParams.resultFormat, requestParams.filePath, undefined, true)); } }, - copyResults(requestParams: azdata.CopyResultsRequestParams): Promise { + copyResults(requestParams: azdata.CopyResultsRequestParams): Promise { return Promise.resolve(self._proxy.$copyResults(handle, requestParams)); }, initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): Promise { diff --git a/src/sql/workbench/api/common/extHostDataProtocol.ts b/src/sql/workbench/api/common/extHostDataProtocol.ts index 4fbdbf45e39f..060b8008ff11 100644 --- a/src/sql/workbench/api/common/extHostDataProtocol.ts +++ b/src/sql/workbench/api/common/extHostDataProtocol.ts @@ -420,7 +420,7 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape { return this._resolveProvider(handle).saveResults(requestParams); } - override $copyResults(handle: number, requestParams: azdata.CopyResultsRequestParams): Thenable { + override $copyResults(handle: number, requestParams: azdata.CopyResultsRequestParams): Thenable { const provider = this._resolveProvider(handle); if (provider.copyResults) { return provider.copyResults(requestParams); diff --git a/src/sql/workbench/api/common/sqlExtHost.protocol.ts b/src/sql/workbench/api/common/sqlExtHost.protocol.ts index bbdd3a1795cb..0d69395668aa 100644 --- a/src/sql/workbench/api/common/sqlExtHost.protocol.ts +++ b/src/sql/workbench/api/common/sqlExtHost.protocol.ts @@ -254,7 +254,7 @@ export abstract class ExtHostDataProtocolShape { /** * Copies the selected data to clipboard. */ - $copyResults(handle: number, requestParams: azdata.CopyResultsRequestParams): Thenable { throw ni(); } + $copyResults(handle: number, requestParams: azdata.CopyResultsRequestParams): Thenable { throw ni(); } /** * Commits all pending edits in an edit session diff --git a/src/sql/workbench/contrib/query/browser/query.contribution.ts b/src/sql/workbench/contrib/query/browser/query.contribution.ts index a39a3ad0fc7c..684dff2e1d3a 100644 --- a/src/sql/workbench/contrib/query/browser/query.contribution.ts +++ b/src/sql/workbench/contrib/query/browser/query.contribution.ts @@ -9,6 +9,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IConfigurationRegistry, Extensions as ConfigExtensions, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry'; import { MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions'; import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; +import * as platform from 'vs/base/common/platform'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ContextKeyExpr, ContextKeyEqualsExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -335,8 +336,8 @@ const queryEditorConfiguration: IConfigurationNode = { }, 'queryEditor.results.preferProvidersCopyHandler': { 'type': 'boolean', - 'description': localize('queryEditor.results.preferProvidersCopyHandler', "Whether the copy result request should be handled by the query provider when it is supported. The default value is true, set this to false to force all copy handling to be done by Azure Data Studio."), - 'default': true + 'description': localize('queryEditor.results.preferProvidersCopyHandler', "Whether the copy result request should be handled by the query provider when it is supported. The default value is true for Windows and Mac, and false for Linux, set this to false to force all copy handling to be done by Azure Data Studio."), + 'default': platform.isLinux ? false : true }, 'queryEditor.results.inMemoryDataProcessingThreshold': { 'type': 'number', diff --git a/src/sql/workbench/services/query/common/queryManagement.ts b/src/sql/workbench/services/query/common/queryManagement.ts index cfb5f1177fff..241b43d8529b 100644 --- a/src/sql/workbench/services/query/common/queryManagement.ts +++ b/src/sql/workbench/services/query/common/queryManagement.ts @@ -69,7 +69,7 @@ export interface IQueryManagementService { changeConnectionUri(newUri: string, oldUri: string): Promise; saveResults(requestParams: azdata.SaveResultsRequestParams): Promise; setQueryExecutionOptions(uri: string, options: azdata.QueryExecutionOptions): Promise; - copyResults(params: azdata.CopyResultsRequestParams): Promise; + copyResults(params: azdata.CopyResultsRequestParams): Promise; // Callbacks onQueryComplete(result: azdata.QueryExecuteCompleteNotificationResult): void; @@ -108,7 +108,7 @@ export interface IQueryRequestHandler { disposeQuery(ownerUri: string): Promise; connectionUriChanged(newUri: string, oldUri: string): Promise; saveResults(requestParams: azdata.SaveResultsRequestParams): Promise; - copyResults(requestParams: azdata.CopyResultsRequestParams): Promise; + copyResults(requestParams: azdata.CopyResultsRequestParams): Promise; setQueryExecutionOptions(ownerUri: string, options: azdata.QueryExecutionOptions): Promise; // Edit Data actions @@ -364,7 +364,7 @@ export class QueryManagementService implements IQueryManagementService { }); } - public copyResults(requestParams: azdata.CopyResultsRequestParams): Promise { + public copyResults(requestParams: azdata.CopyResultsRequestParams): Promise { return this._runAction(requestParams.ownerUri, (runner) => { return runner.copyResults(requestParams); }); diff --git a/src/sql/workbench/services/query/common/queryModelService.ts b/src/sql/workbench/services/query/common/queryModelService.ts index 2f7d84d2505c..7945c3f19c87 100644 --- a/src/sql/workbench/services/query/common/queryModelService.ts +++ b/src/sql/workbench/services/query/common/queryModelService.ts @@ -22,7 +22,6 @@ import Severity from 'vs/base/common/severity'; import EditQueryRunner from 'sql/workbench/services/editData/common/editQueryRunner'; import { IRange } from 'vs/editor/common/core/range'; import { ServerConnID } from 'sql/workbench/services/query/common/query'; -import { ClipboardData, IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IQueryManagementService } from 'sql/workbench/services/query/common/queryManagement'; const selectionSnippetMaxLen = 100; @@ -88,7 +87,6 @@ export class QueryModelService implements IQueryModelService { @IQueryManagementService protected queryManagementService: IQueryManagementService, @IInstantiationService private _instantiationService: IInstantiationService, @INotificationService private _notificationService: INotificationService, - @IClipboardService private _clipboardService: IClipboardService, @ILogService private _logService: ILogService ) { this._queryInfoMap = new Map(); @@ -178,11 +176,7 @@ export class QueryModelService implements IQueryModelService { public async copyResults(uri: string, selection: Slick.Range[], batchId: number, resultId: number, includeHeaders?: boolean): Promise { if (this._queryInfoMap.has(uri)) { - const results = await this._queryInfoMap.get(uri)!.queryRunner!.copyResults(selection, batchId, resultId, includeHeaders); - let clipboardData: ClipboardData = { - text: results.results - }; - this._clipboardService.write(clipboardData); + return this._queryInfoMap.get(uri)!.queryRunner!.copyResults(selection, batchId, resultId, includeHeaders); } } diff --git a/src/sql/workbench/services/query/common/queryRunner.ts b/src/sql/workbench/services/query/common/queryRunner.ts index fb4e046c6980..75c60091b0fe 100644 --- a/src/sql/workbench/services/query/common/queryRunner.ts +++ b/src/sql/workbench/services/query/common/queryRunner.ts @@ -11,7 +11,7 @@ import { ResultSerializer, SaveFormat } from 'sql/workbench/services/query/commo import * as azdata from 'azdata'; import * as nls from 'vs/nls'; -import { ClipboardData, IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import * as types from 'vs/base/common/types'; import { Disposable } from 'vs/base/common/lifecycle'; import { INotificationService } from 'vs/platform/notification/common/notification'; @@ -494,8 +494,8 @@ export default class QueryRunner extends Disposable { * @param resultId The result id of the result to copy from * @param includeHeaders [Optional]: Should column headers be included in the copy selection */ - async copyResults(selections: Slick.Range[], batchId: number, resultId: number, includeHeaders?: boolean): Promise { - return this.queryManagementService.copyResults({ + async copyResults(selections: Slick.Range[], batchId: number, resultId: number, includeHeaders?: boolean): Promise { + await this.queryManagementService.copyResults({ ownerUri: this.uri, batchIndex: batchId, resultSetIndex: resultId, @@ -617,11 +617,7 @@ export class QueryGridDataProvider implements IGridDataProvider { private async handleCopyRequestByProvider(selections: Slick.Range[], includeHeaders?: boolean): Promise { executeCopyWithNotification(this._notificationService, this._configurationService, selections, async () => { - let results = await this.queryRunner.copyResults(selections, this.batchId, this.resultSetId, this.shouldIncludeHeaders(includeHeaders)); - let clipboardData: ClipboardData = { - text: results.results - } - this._clipboardService.write(clipboardData); + await this.queryRunner.copyResults(selections, this.batchId, this.resultSetId, this.shouldIncludeHeaders(includeHeaders)); }); } diff --git a/src/sql/workbench/services/query/test/common/testQueryManagementService.ts b/src/sql/workbench/services/query/test/common/testQueryManagementService.ts index 20aa1f079db2..0da575694cdc 100644 --- a/src/sql/workbench/services/query/test/common/testQueryManagementService.ts +++ b/src/sql/workbench/services/query/test/common/testQueryManagementService.ts @@ -66,7 +66,7 @@ export class TestQueryManagementService implements IQueryManagementService { saveResults(requestParams: azdata.SaveResultsRequestParams): Promise { throw new Error('Method not implemented.'); } - copyResults(params: azdata.CopyResultsRequestParams): Promise { + copyResults(params: azdata.CopyResultsRequestParams): Promise { throw new Error('Method not implemented.'); } setQueryExecutionOptions(uri: string, options: azdata.QueryExecutionOptions): Promise {