MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / getWebview

Method getWebview

src/helpViewer/panel.ts:93–114  ·  view source on GitHub ↗
(preserveFocus: boolean = false, viewColumn: vscode.ViewColumn = vscode.ViewColumn.Two)

Source from the content-addressed store, hash-verified

91
92 // retrieves the stored webview or creates a new one if the webview was closed
93 private getWebview(preserveFocus: boolean = false, viewColumn: vscode.ViewColumn = vscode.ViewColumn.Two): vscode.Webview {
94 // create webview if necessary
95 if (!this.panel) {
96 const webViewOptions: vscode.WebviewOptions & vscode.WebviewPanelOptions = {
97 enableScripts: true,
98 enableFindWidget: true,
99 enableCommandUris: true,
100 retainContextWhenHidden: true // keep scroll position when not focussed
101 };
102 const showOptions = {
103 viewColumn: viewColumn,
104 preserveFocus: preserveFocus
105 };
106 this.panel = vscode.window.createWebviewPanel('rhelp', 'R Help', showOptions, webViewOptions);
107 this.initializePanel();
108 }
109
110 this.panel.reveal(undefined, preserveFocus);
111 void this.setContextValues();
112
113 return this.panel.webview;
114 }
115
116 private initializePanel(): void {
117 if (!this.panel) {

Callers 1

showHelpFileMethod · 0.95

Calls 2

initializePanelMethod · 0.95
setContextValuesMethod · 0.95

Tested by

no test coverage detected