lean4monaco 1.0.37 → 1.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,8 @@ export declare class IFrameInfoWebviewFactory implements InfoWebviewFactory {
20
20
  private fontFiles;
21
21
  private infoviewElement;
22
22
  private iframe;
23
+ rpc: Rpc;
24
+ editorApi: EditorApi;
23
25
  constructor(themeService: IThemeService, configurationService: IConfigurationService, fontFiles: FontFace[]);
24
26
  setInfoviewElement(infoviewElement: HTMLElement): void;
25
27
  make(editorApi: EditorApi, stylesheet: string, column: number): IFrameInfoWebview;
@@ -28,6 +28,8 @@ export class IFrameInfoWebviewFactory {
28
28
  fontFiles;
29
29
  infoviewElement;
30
30
  iframe;
31
+ rpc;
32
+ editorApi;
31
33
  constructor(themeService, configurationService, fontFiles) {
32
34
  this.themeService = themeService;
33
35
  this.configurationService = configurationService;
@@ -37,6 +39,7 @@ export class IFrameInfoWebviewFactory {
37
39
  this.infoviewElement = infoviewElement;
38
40
  }
39
41
  make(editorApi, stylesheet, column) {
42
+ this.editorApi = editorApi;
40
43
  this.iframe = document.createElement("iframe");
41
44
  this.infoviewElement.append(this.iframe);
42
45
  this.iframe.contentWindow.document.open();
@@ -49,7 +52,7 @@ export class IFrameInfoWebviewFactory {
49
52
  // inside the webview through the standard message event.
50
53
  // The receiving of these messages is done inside webview\index.ts where it
51
54
  // calls window.addEventListener('message',...
52
- const rpc = new Rpc(m => {
55
+ this.rpc = new Rpc(m => {
53
56
  try {
54
57
  // JSON.stringify is needed here to serialize getters such as `Position.line` and `Position.character`
55
58
  void this.iframe.contentWindow.postMessage(JSON.stringify(m));
@@ -58,20 +61,20 @@ export class IFrameInfoWebviewFactory {
58
61
  // ignore any disposed object exceptions
59
62
  }
60
63
  });
61
- rpc.register(editorApi);
64
+ this.rpc.register(editorApi);
62
65
  // Similarly, we can received data from the webview by listening to onDidReceiveMessage.
63
66
  document.defaultView.addEventListener('message', m => {
64
67
  if (m.source != this.iframe.contentWindow) {
65
68
  return;
66
69
  }
67
70
  try {
68
- rpc.messageReceived(JSON.parse(m.data));
71
+ this.rpc.messageReceived(JSON.parse(m.data));
69
72
  }
70
73
  catch {
71
74
  // ignore any disposed object exceptions
72
75
  }
73
76
  });
74
- return new IFrameInfoWebview(this.iframe, rpc);
77
+ return new IFrameInfoWebview(this.iframe, this.rpc);
75
78
  }
76
79
  updateCssVars() {
77
80
  const theme = this.themeService.getColorTheme();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lean4monaco",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Monaco Editor support for the Lean 4 theorem prover.",
5
5
  "keywords": [
6
6
  "lean",