You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actions[bot] edited this page Apr 23, 2024
·
3 revisions
In case your extension contributes a CustomEditor/CustomTextEditor. Both are based on a webview, and the page object is a combination of a Webview and common editor functionality.
Lookup
import{CustomEditor}from'vscode-extension-tester'
...
// make sure the editor is opened by nowconsteditor=newCustomEditor();
Webview
The whole editor is serviced by a WebView, we just need to get a reference to it.
constwebview=editor.getWebView();
Common Functionality
Most editors share this:
// check if there are unsaved changesconstdirty=awaiteditor.isDirty();// saveawaiteditor.save();// open 'save as' promptconstprompt=awaiteditor.saveAs();// get titleconsttitle=awaiteditor.getTitle();// get the editor tabconsttab=awaiteditor.getTab();