Copy clipboard command in ADS (html/plain text supported) (#13527)

* draft commit

* few changes

* Changes to copy query with results in plain and html formatting

* undo changes

* undo unintended change

* remove comments

* Addressed comments

* Some clean up

Co-authored-by: Monica Gupta <mogupt@microsoft.com>
This commit is contained in:
Monica Gupta
2020-11-25 21:08:29 -08:00
committed by GitHub
parent 2a7b90fd70
commit 397354ebc3
9 changed files with 117 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ClipboardData, IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; // {{SQL CARBON EDIT}}
import { URI } from 'vs/base/common/uri';
import { isMacintosh } from 'vs/base/common/platform';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
@@ -20,6 +20,11 @@ export class NativeClipboardService implements IClipboardService {
@IElectronService private readonly electronService: IElectronService
) { }
// {{SQL CARBON EDIT}}
async write(data: ClipboardData, type?: 'selection' | 'clipboard'): Promise<void> {
return this.electronService.writeClipboardData(data, type);
}
async writeText(text: string, type?: 'selection' | 'clipboard'): Promise<void> {
return this.electronService.writeClipboardText(text, type);
}

View File

@@ -222,6 +222,7 @@ export class TestElectronService implements IElectronService {
async toggleDevTools(): Promise<void> { }
async resolveProxy(url: string): Promise<string | undefined> { return undefined; }
async readClipboardText(type?: 'selection' | 'clipboard' | undefined): Promise<string> { return ''; }
async writeClipboardData(data: any, type?: 'selection' | 'clipboard' | undefined): Promise<void> { } // {{SQL CARBON EDIT}}
async writeClipboardText(text: string, type?: 'selection' | 'clipboard' | undefined): Promise<void> { }
async readClipboardFindText(): Promise<string> { return ''; }
async writeClipboardFindText(text: string): Promise<void> { }