lean4monaco 1.0.25 → 1.0.27

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.
package/README.md CHANGED
@@ -152,7 +152,12 @@ with 1 (or more) monaco editors and an infoview, showing the Lean infos at the c
152
152
  Some random errors we encountered. If you have more, please share them.
153
153
 
154
154
  * Make sure that only one version of the npm package `monaco-vscode-api` is installed. The error I typically got is:
155
-
155
+
156
156
  ```
157
157
  this._configurationService.onDidChangeConfiguration is not a function
158
158
  ```
159
+
160
+ ### Warnings on `npm install`
161
+
162
+ * Warnings about `glob` and `inflight` come from `copyfiles`: see [copyfiles#132](https://github.com/calvinmetcalf/copyfiles/pull/132)
163
+ * Warning about ` @types/cypress` comes from `cypress-iframe`
package/dist/editor.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ITextFileEditorModel } from 'vscode/monaco';
2
2
  import * as monaco from 'monaco-editor';
3
3
  import { IReference } from '@codingame/monaco-vscode-editor-service-override';
4
- import './editor.css';
5
4
  export declare class LeanMonacoEditor {
6
5
  editor: monaco.editor.IStandaloneCodeEditor;
7
6
  modelRef: IReference<ITextFileEditorModel>;
package/dist/editor.js CHANGED
@@ -3,7 +3,6 @@ import { fs } from 'memfs';
3
3
  import { createModelReference } from 'vscode/monaco';
4
4
  import * as monaco from 'monaco-editor';
5
5
  import path from 'path';
6
- import './editor.css';
7
6
  export class LeanMonacoEditor {
8
7
  editor;
9
8
  modelRef;
@@ -20,6 +20,7 @@ export type LeanMonacoOptions = {
20
20
  websocket: {
21
21
  url: string;
22
22
  };
23
+ htmlElement?: HTMLElement;
23
24
  vscode?: {
24
25
  [id: string]: any;
25
26
  };
@@ -32,6 +32,13 @@ export class LeanMonaco {
32
32
  infoviewEl;
33
33
  disposed = false;
34
34
  async start(options) {
35
+ if (!options.htmlElement) {
36
+ console.debug('[LeanMonaco]: not starting because container is null');
37
+ return;
38
+ }
39
+ else {
40
+ console.debug('[LeanMonaco]: starting');
41
+ }
35
42
  if (LeanMonaco.activeInstance == this) {
36
43
  console.warn('A LeanMonaco instance cannot be started twice.');
37
44
  return;
@@ -61,7 +68,7 @@ export class LeanMonaco {
61
68
  ...getConfigurationServiceOverride(),
62
69
  ...getLanguagesServiceOverride(),
63
70
  ...getModelServiceOverride()
64
- }, undefined, {
71
+ }, options.htmlElement, {
65
72
  workspaceProvider: {
66
73
  trusted: true,
67
74
  workspace: {
@@ -109,7 +116,10 @@ export class LeanMonaco {
109
116
  // Load fonts
110
117
  const fontFiles = [
111
118
  new FontFace("JuliaMono", `url(${new URL("./fonts/JuliaMono-Regular.ttf", import.meta.url)})`),
112
- new FontFace("LeanWeb", `url(${new URL("./fonts/LeanWeb-Regular.otf", import.meta.url)})`)
119
+ // new FontFace(
120
+ // "LeanWeb",
121
+ // `url(${new URL("./fonts/LeanWeb-Regular.otf", import.meta.url)})`,
122
+ // )
113
123
  ];
114
124
  fontFiles.map(font => {
115
125
  document.fonts.add(font);
@@ -135,7 +145,7 @@ export class LeanMonaco {
135
145
  "editor.acceptSuggestionOnEnter": "off", // since there are plenty suggestions
136
146
  // other options
137
147
  "editor.renderWhitespace": "trailing",
138
- "editor.fontFamily": "'LeanWeb', 'JuliaMono'",
148
+ "editor.fontFamily": "'JuliaMono'",
139
149
  "editor.wordWrap": "on",
140
150
  "editor.wrappingStrategy": "advanced",
141
151
  "workbench.colorTheme": "Visual Studio Light",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lean4monaco",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Monaco Editor support for the Lean 4 theorem prover.",
5
5
  "keywords": [
6
6
  "lean",
package/dist/editor.css DELETED
@@ -1,9 +0,0 @@
1
- @font-face {
2
- font-family: "JuliaMono";
3
- src: local(".fonts/JuliaMono-Regular.ttf"),
4
- }
5
-
6
- @font-face {
7
- font-family: "LeanWeb";
8
- src: local(".fonts/LeanWeb-Regular.otf"),
9
- }