clipboard changes
This commit is contained in:
parent
1ecf01b9c7
commit
4cfd5f8508
|
@ -45,9 +45,9 @@ suite('vscode', function () {
|
|||
} catch (err) {
|
||||
assert.fail(err);
|
||||
}
|
||||
assert.strictEqual(rpcPaths.length, 0);
|
||||
assert.strictEqual(rpcPaths.length, 0, rpcPaths.join('\n'));
|
||||
|
||||
// assert.strictEqual(proxyPaths.length, 0); // proxies are accessible...
|
||||
// assert.strictEqual(proxyPaths.length, 0, proxyPaths.join('\n')); // proxies are accessible...
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -288,9 +288,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
|||
get appName() { return initData.environment.appName; },
|
||||
get appRoot() { return initData.environment.appRoot?.fsPath ?? ''; },
|
||||
get uriScheme() { return initData.environment.appUriScheme; },
|
||||
get clipboard(): vscode.Clipboard {
|
||||
return extHostClipboard;
|
||||
},
|
||||
get clipboard(): vscode.Clipboard { return extHostClipboard.value; },
|
||||
get shell() {
|
||||
return extHostTerminalService.getDefaultShell(false, configProvider);
|
||||
},
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IMainContext, MainContext, MainThreadClipboardShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { IMainContext, MainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import type * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostClipboard implements vscode.Clipboard {
|
||||
export class ExtHostClipboard {
|
||||
|
||||
private readonly _proxy: MainThreadClipboardShape;
|
||||
readonly value: vscode.Clipboard;
|
||||
|
||||
constructor(mainContext: IMainContext) {
|
||||
this._proxy = mainContext.getProxy(MainContext.MainThreadClipboard);
|
||||
}
|
||||
|
||||
readText(): Promise<string> {
|
||||
return this._proxy.$readText();
|
||||
}
|
||||
|
||||
writeText(value: string): Promise<void> {
|
||||
return this._proxy.$writeText(value);
|
||||
const proxy = mainContext.getProxy(MainContext.MainThreadClipboard);
|
||||
this.value = Object.freeze({
|
||||
readText() {
|
||||
return proxy.$readText();
|
||||
},
|
||||
writeText(value: string) {
|
||||
return proxy.$writeText(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue