mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
add notebook to the text document of the input box in iw.
This commit is contained in:
32
src/vs/workbench/api/browser/mainThreadInteractive.ts
Normal file
32
src/vs/workbench/api/browser/mainThreadInteractive.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ExtHostContext, ExtHostInteractiveShape, IExtHostContext, MainContext, MainThreadInteractiveShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
|
||||
import { IInteractiveDocumentService } from 'vs/workbench/contrib/interactive/browser/interactiveDocumentService';
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadInteractive)
|
||||
export class MainThreadInteractive implements MainThreadInteractiveShape {
|
||||
private readonly _proxy: ExtHostInteractiveShape;
|
||||
|
||||
private readonly _disposables = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IInteractiveDocumentService interactiveDocumentService: IInteractiveDocumentService
|
||||
) {
|
||||
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostInteractive);
|
||||
|
||||
this._disposables.add(interactiveDocumentService.onWillAddInteractiveDocument((e) => {
|
||||
this._proxy.$acceptInputDocument(e.inputUri, '\n', 'plaintext', e.notebookUri);
|
||||
}));
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this._disposables.dispose();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user