add notebook to the text document of the input box in iw.

This commit is contained in:
rebornix
2021-06-25 15:17:51 -07:00
parent 95ac778330
commit b17fa9dcf5
9 changed files with 129 additions and 4 deletions

View 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();
}
}