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
Copy file name to clipboardExpand all lines: src/panel.js
+41-2Lines changed: 41 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
1
constvscode=require('vscode');
2
+
const{ getNonce }=require('./getNonce.js');
3
+
const{ Parser }=require('./parser.js');
4
+
5
+
// let panel;
2
6
3
7
functioncreatePanel(context){
8
+
// if the current panel exists, then reveal the column, else make one?
9
+
4
10
// utilize method on vscode.window object to create webview
5
11
constpanel=vscode.window.createWebviewPanel(
6
12
'reactLabyrinth',
@@ -22,8 +28,34 @@ function createPanel(context) {
22
28
23
29
// render html of webview here
24
30
panel.webview.html=createWebviewHTML(bundleURI);
31
+
32
+
// will need to use onDidDispose to clear cached data and reset tree when the webview and/or application is closed
33
+
34
+
// from my understadning, we will have to use onDidReceiveMessage to send message from the webview to and from the extension. its sent and read based on the switch case 'string' and then activates their functionality there
35
+
36
+
// we will need to grab the value of the root file path => then make new instance of parser => call parse method on new instance => then create a func to then post a message to our flow.jsx
37
+
38
+
// panel.webview.onDidReceiveMessage(
39
+
// async (msg) => {
40
+
// console.log('Message: ', msg)
41
+
// switch (msg.type) {
42
+
// case 'test':
43
+
// console.log('testing onDidReceiveMessage');
44
+
45
+
// break;
46
+
// }
47
+
// },
48
+
// null,
49
+
// vscode.Disposable
50
+
// );
51
+
52
+
25
53
}
26
54
55
+
// getNonce generates a new random string each time ext is used to prevent external injection of foreign code into the html
56
+
constnonce=getNonce();
57
+
58
+
// function to update state in webview
27
59
28
60
// function to create the HTML page for webview
29
61
functioncreateWebviewHTML(URI){
@@ -38,11 +70,18 @@ function createWebviewHTML(URI) {
0 commit comments