@typefox/monaco-editor-react 7.3.0 → 7.4.0-next.0
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/CHANGELOG.md +5 -0
- package/lib/index.d.ts +6 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +68 -68
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +72 -72
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to npm module [@typefox/monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [7.4.0-next.0] - 2025-11-18
|
|
6
|
+
|
|
7
|
+
- Use flags to trigger behaviour [#997](https://github.com/TypeFox/monaco-languageclient/pull/997).
|
|
8
|
+
- Updated all `@codingame/monaco-vscode` packages to `23.0.3`.
|
|
9
|
+
|
|
5
10
|
## [7.3.0] - 2025-11-16
|
|
6
11
|
|
|
7
12
|
- Fixed re-rendering issues with React StrictMode [#986](https://github.com/TypeFox/monaco-languageclient/pull/986).
|
package/lib/index.d.ts
CHANGED
|
@@ -14,10 +14,15 @@ export type MonacoEditorProps = {
|
|
|
14
14
|
onEditorStartDone?: (editorApp?: EditorApp) => void;
|
|
15
15
|
onLanguageClientsStartDone?: (lcsManager: LanguageClientManager) => void;
|
|
16
16
|
onTextChanged?: (textChanges: TextContents) => void;
|
|
17
|
-
onConfigProcessed?: (
|
|
17
|
+
onConfigProcessed?: (result: {
|
|
18
|
+
textUpdated: boolean;
|
|
19
|
+
modelUpdated: boolean;
|
|
20
|
+
}, editorApp?: EditorApp) => void;
|
|
18
21
|
onError?: (error: Error) => void;
|
|
19
22
|
onDisposeEditor?: () => void;
|
|
20
23
|
onDisposeLanguageClient?: () => void;
|
|
24
|
+
toggleReprocessConfig?: boolean;
|
|
25
|
+
enforceLanguageClientDispose?: boolean;
|
|
21
26
|
logLevel?: LogLevel | number;
|
|
22
27
|
};
|
|
23
28
|
export declare const MonacoEditorReactComp: React.FC<MonacoEditorProps>;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACrG,OAAO,EAAE,KAAK,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAgC,KAAK,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC1I,OAAO,KAAK,EAAE,EAAE,KAAK,aAAa,EAAqB,MAAM,OAAO,CAAC;AAErE,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,mBAAmB,CAAC,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC/E,iBAAiB,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACpD,0BAA0B,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzE,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,iBAAiB,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAA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,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAChC,CAAA;AAmED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuT7D,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -32,7 +32,7 @@ const executeQueue = async () => {
|
|
|
32
32
|
const lengthBefore = runQueue.length;
|
|
33
33
|
const queueObj = runQueue.shift();
|
|
34
34
|
debugLogging('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');
|
|
35
|
-
debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}
|
|
35
|
+
debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}`);
|
|
36
36
|
await queueObj?.func(queueObj.currentContainer);
|
|
37
37
|
debugLogging(`QUEUE ${queueObj?.id} end: SIZE after: ${runQueue.length}`);
|
|
38
38
|
}
|
|
@@ -57,16 +57,12 @@ const stopQueue = () => {
|
|
|
57
57
|
intervalId = undefined;
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
const debugLogging = (id
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
logger.debug(id);
|
|
66
|
-
}
|
|
60
|
+
const debugLogging = (id) => {
|
|
61
|
+
const now = new Date(Date.now());
|
|
62
|
+
logger.debug(`[${now.getMinutes()}:${now.getSeconds()}:${now.getMilliseconds()}]: ${id}`);
|
|
67
63
|
};
|
|
68
64
|
export const MonacoEditorReactComp = (props) => {
|
|
69
|
-
const { style, className, vscodeApiConfig, editorAppConfig, languageClientConfig, onVscodeApiInitDone, onEditorStartDone, onLanguageClientsStartDone, onTextChanged, onConfigProcessed, onError, onDisposeEditor, onDisposeLanguageClient, logLevel } = props;
|
|
65
|
+
const { style, className, vscodeApiConfig, editorAppConfig, languageClientConfig, onVscodeApiInitDone, onEditorStartDone, onLanguageClientsStartDone, onTextChanged, onConfigProcessed, onError, onDisposeEditor, onDisposeLanguageClient, logLevel, toggleReprocessConfig, enforceLanguageClientDispose } = props;
|
|
70
66
|
const editorAppRef = useRef(undefined);
|
|
71
67
|
const containerRef = useRef(null);
|
|
72
68
|
const modifiedCodeUriRef = useRef(undefined);
|
|
@@ -76,8 +72,10 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
76
72
|
const onTextChangedRef = useRef(onTextChanged);
|
|
77
73
|
const launchingRef = useRef(false);
|
|
78
74
|
const editorAppConfigRef = useRef(undefined);
|
|
75
|
+
const flipReprocessConfigRef = useRef(false);
|
|
76
|
+
const flipLanguageClientDisposeRef = useRef(false);
|
|
79
77
|
const performErrorHandling = (error) => {
|
|
80
|
-
debugLogging(`ERROR: ${error.message}
|
|
78
|
+
debugLogging(`ERROR: ${error.message}`);
|
|
81
79
|
if (onError) {
|
|
82
80
|
onError(error);
|
|
83
81
|
}
|
|
@@ -100,12 +98,10 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
100
98
|
apiWrapper = new MonacoVscodeApiWrapper(vscodeApiConfig);
|
|
101
99
|
const globalInitFunc = async () => {
|
|
102
100
|
try {
|
|
103
|
-
debugLogging('GLOBAL INIT', true);
|
|
104
101
|
if (apiWrapper === undefined)
|
|
105
102
|
throw new Error('Unexpected error occurred: apiWrapper is not available! Aborting...');
|
|
106
103
|
await apiWrapper.start();
|
|
107
104
|
onVscodeApiInitDone?.(apiWrapper);
|
|
108
|
-
debugLogging('GLOBAL INIT DONE', true);
|
|
109
105
|
runQueueLock = false;
|
|
110
106
|
}
|
|
111
107
|
catch (error) {
|
|
@@ -122,17 +118,15 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
122
118
|
};
|
|
123
119
|
const editorInit = async (htmlContainer) => {
|
|
124
120
|
try {
|
|
125
|
-
debugLogging('INIT EDITOR', true);
|
|
126
121
|
// it is possible to run without an editorApp, when the ViewsService or WorkbenchService
|
|
127
122
|
if (haveEditorService()) {
|
|
128
123
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
129
124
|
if (htmlContainer === null || (htmlContainer !== null && htmlContainer.parentElement === null)) {
|
|
130
|
-
debugLogging('INIT EDITOR: Unable to create editor. HTML container or the parent is missing.'
|
|
125
|
+
debugLogging('INIT EDITOR: Unable to create editor. HTML container or the parent is missing.');
|
|
131
126
|
}
|
|
132
127
|
else {
|
|
133
128
|
if (editorAppRef.current === undefined && !launchingRef.current) {
|
|
134
129
|
launchingRef.current = true;
|
|
135
|
-
debugLogging('INIT EDITOR: Creating editor', true);
|
|
136
130
|
editorAppRef.current = new EditorApp(editorAppConfigRef.current);
|
|
137
131
|
if (editorAppRef.current.isStarting() === true || editorAppRef.current.isDisposing() === true) {
|
|
138
132
|
await Promise.all([
|
|
@@ -156,16 +150,16 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
156
150
|
await editorAppRef.current.start(htmlContainer);
|
|
157
151
|
onEditorStartDone?.(editorAppRef.current);
|
|
158
152
|
launchingRef.current = false;
|
|
153
|
+
debugLogging('INIT EDITOR: Editor start was successful.');
|
|
159
154
|
}
|
|
160
155
|
else {
|
|
161
|
-
debugLogging('INIT EDITOR: Editor already
|
|
156
|
+
debugLogging('INIT EDITOR: Editor was already started.');
|
|
162
157
|
}
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
160
|
else {
|
|
166
|
-
debugLogging('INIT EDITOR: Do nothing: Using ViewsService'
|
|
161
|
+
debugLogging('INIT EDITOR: Do nothing: Using ViewsService');
|
|
167
162
|
}
|
|
168
|
-
debugLogging('INIT EDITOR: Done', true);
|
|
169
163
|
}
|
|
170
164
|
catch (error) {
|
|
171
165
|
performErrorHandling(error);
|
|
@@ -173,16 +167,16 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
173
167
|
};
|
|
174
168
|
const updateEditorModel = async () => {
|
|
175
169
|
try {
|
|
176
|
-
debugLogging('UPDATE EDITOR MODEL', true);
|
|
177
170
|
if (!launchingRef.current && editorAppRef.current) {
|
|
178
171
|
editorAppRef.current.updateCodeResources(editorAppConfigRef.current?.codeResources);
|
|
179
172
|
updateModelRelatedRefs();
|
|
180
|
-
onConfigProcessed?.(editorAppRef.current);
|
|
173
|
+
onConfigProcessed?.({ modelUpdated: true, textUpdated: true }, editorAppRef.current);
|
|
174
|
+
debugLogging('UPDATE EDITOR MODEL: Model was updated.');
|
|
181
175
|
}
|
|
182
176
|
else {
|
|
183
|
-
|
|
177
|
+
onConfigProcessed?.({ modelUpdated: false, textUpdated: false }, editorAppRef.current);
|
|
178
|
+
debugLogging('UPDATE EDITOR MODEL: No editor is avilable. Model update was not possible.');
|
|
184
179
|
}
|
|
185
|
-
debugLogging('UPDATE EDITOR MODEL: Done', true);
|
|
186
180
|
}
|
|
187
181
|
catch (error) {
|
|
188
182
|
performErrorHandling(error);
|
|
@@ -197,25 +191,25 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
197
191
|
const disposeEditor = async () => {
|
|
198
192
|
try {
|
|
199
193
|
// dispose editor if used
|
|
200
|
-
debugLogging('DISPOSE', true);
|
|
201
194
|
if (editorAppRef.current !== undefined) {
|
|
202
195
|
await editorAppRef.current.dispose();
|
|
203
196
|
editorAppRef.current = undefined;
|
|
204
197
|
onDisposeEditor?.();
|
|
198
|
+
debugLogging('DISPOSE: EditorApp was disposed');
|
|
205
199
|
}
|
|
206
200
|
else {
|
|
207
|
-
debugLogging('DISPOSE: EditorApp is not disposed'
|
|
201
|
+
debugLogging('DISPOSE: EditorApp is not disposed');
|
|
208
202
|
}
|
|
209
|
-
debugLogging('DISPOSE DONE', true);
|
|
210
203
|
}
|
|
211
204
|
catch (error) {
|
|
212
205
|
performErrorHandling(error);
|
|
213
206
|
}
|
|
214
207
|
};
|
|
215
208
|
const processConfig = () => {
|
|
216
|
-
let
|
|
209
|
+
let modelUpdated = false;
|
|
210
|
+
let textUpdated = false;
|
|
217
211
|
try {
|
|
218
|
-
debugLogging('CONFIG PROCESSED'
|
|
212
|
+
debugLogging('CONFIG PROCESSED: Started');
|
|
219
213
|
if (!launchingRef.current && editorAppRef.current) {
|
|
220
214
|
if (editorAppConfigRef.current?.codeResources !== undefined) {
|
|
221
215
|
const newModifiedCodeUri = editorAppConfigRef.current.codeResources.modified?.uri;
|
|
@@ -224,7 +218,7 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
224
218
|
const originalUri = originalCodeUriRef.current !== newOriginalCodeUri ? newOriginalCodeUri : undefined;
|
|
225
219
|
// re-create the editor if the URIs have changed
|
|
226
220
|
if (modifiedUri !== undefined || originalUri !== undefined) {
|
|
227
|
-
|
|
221
|
+
modelUpdated = true;
|
|
228
222
|
}
|
|
229
223
|
else {
|
|
230
224
|
const newModifiedCode = editorAppConfigRef.current.codeResources.modified?.text;
|
|
@@ -232,6 +226,7 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
232
226
|
const modified = modifiedCodeRef.current !== newModifiedCode ? newModifiedCode : undefined;
|
|
233
227
|
const original = originalCodeRef.current !== newOriginalCode ? newOriginalCode : undefined;
|
|
234
228
|
if (modified !== undefined || original !== undefined) {
|
|
229
|
+
textUpdated = true;
|
|
235
230
|
editorAppRef.current.updateCode({ modified, original });
|
|
236
231
|
}
|
|
237
232
|
}
|
|
@@ -247,15 +242,16 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
247
242
|
}
|
|
248
243
|
}
|
|
249
244
|
}
|
|
250
|
-
if
|
|
251
|
-
|
|
245
|
+
// notitfy now if no async model update was necessary
|
|
246
|
+
if (!modelUpdated) {
|
|
247
|
+
onConfigProcessed?.({ modelUpdated, textUpdated }, editorAppRef.current);
|
|
252
248
|
}
|
|
253
|
-
debugLogging('CONFIG PROCESSED: Done'
|
|
249
|
+
debugLogging('CONFIG PROCESSED: Done');
|
|
254
250
|
}
|
|
255
251
|
catch (error) {
|
|
256
252
|
performErrorHandling(error);
|
|
257
253
|
}
|
|
258
|
-
return
|
|
254
|
+
return modelUpdated;
|
|
259
255
|
};
|
|
260
256
|
useEffect(() => {
|
|
261
257
|
// fast-fail
|
|
@@ -266,68 +262,72 @@ export const MonacoEditorReactComp = (props) => {
|
|
|
266
262
|
editorAppConfigRef.current = editorAppConfig;
|
|
267
263
|
// it is possible to run without an editorApp, when the ViewsService or WorkbenchService
|
|
268
264
|
if (haveEditorService()) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
addQueue({ id: 'model update', func: updateEditorModel, currentContainer: containerRef.current });
|
|
265
|
+
if (editorAppRef.current === undefined) {
|
|
266
|
+
addQueue({ id: 'editorInit', func: editorInit, currentContainer: containerRef.current });
|
|
272
267
|
}
|
|
273
268
|
else {
|
|
274
|
-
|
|
275
|
-
addQueue({ id: 'editorInit', func: editorInit, currentContainer: containerRef.current });
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
debugLogging('CHECK EDITOR: Editor already created', true);
|
|
279
|
-
}
|
|
269
|
+
debugLogging('CHECK EDITOR: Editor already created. No queueing necessary.');
|
|
280
270
|
}
|
|
281
271
|
}
|
|
282
272
|
else {
|
|
283
|
-
debugLogging('INIT EDITOR: Do nothing: Using ViewsService'
|
|
273
|
+
debugLogging('INIT EDITOR: Do nothing: Using ViewsService');
|
|
284
274
|
}
|
|
285
275
|
}, [editorAppConfig]);
|
|
276
|
+
useEffect(() => {
|
|
277
|
+
if (flipReprocessConfigRef.current !== (toggleReprocessConfig === true)) {
|
|
278
|
+
debugLogging('REPROCESS CONFIG: Triggered');
|
|
279
|
+
const updateModel = processConfig();
|
|
280
|
+
if (updateModel) {
|
|
281
|
+
addQueue({ id: 'modelUpdate', func: updateEditorModel, currentContainer: containerRef.current });
|
|
282
|
+
}
|
|
283
|
+
flipReprocessConfigRef.current = !flipReprocessConfigRef.current;
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
debugLogging('REPROCESS CONFIG: Denied');
|
|
287
|
+
}
|
|
288
|
+
}, [toggleReprocessConfig]);
|
|
286
289
|
useEffect(() => {
|
|
287
290
|
// fast-fail
|
|
288
291
|
if (languageClientConfig === undefined)
|
|
289
292
|
return;
|
|
290
293
|
// always try to perform global init. Reason: we cannot ensure order
|
|
291
294
|
performGlobalInit();
|
|
292
|
-
|
|
295
|
+
const lcInitFunc = async () => {
|
|
296
|
+
try {
|
|
297
|
+
await lcsManager.start();
|
|
298
|
+
onLanguageClientsStartDone?.(lcsManager);
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
performErrorHandling(error);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
lcsManager.setLogLevel(languageClientConfig.logLevel);
|
|
305
|
+
lcsManager.setConfig(languageClientConfig);
|
|
306
|
+
if (!lcsManager.isStarted()) {
|
|
307
|
+
addQueue({ id: 'lcInit', func: lcInitFunc, currentContainer: containerRef.current });
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
debugLogging('INIT LC: Language client is already running. No need to schedule async start.');
|
|
311
|
+
}
|
|
312
|
+
}, [languageClientConfig]);
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
if (flipLanguageClientDisposeRef.current !== (enforceLanguageClientDispose === true)) {
|
|
293
315
|
const disposeLCFunc = async () => {
|
|
294
|
-
// dispose editor if used
|
|
295
316
|
try {
|
|
296
|
-
debugLogging('DISPOSE LC ENFORCED', true);
|
|
297
317
|
await lcsManager.dispose();
|
|
298
318
|
onDisposeLanguageClient?.();
|
|
299
|
-
debugLogging('DISPOSE LC ENFORCED DONE', true);
|
|
300
319
|
}
|
|
301
320
|
catch (error) {
|
|
302
321
|
// The language client may throw an error during disposal, but we want to continue anyway
|
|
303
322
|
performErrorHandling(new Error(`Unexpected error occurred during disposal of the language client: ${error}`));
|
|
304
323
|
}
|
|
305
324
|
};
|
|
306
|
-
addQueue({ id: '
|
|
325
|
+
addQueue({ id: 'lcDispose', func: disposeLCFunc, currentContainer: containerRef.current });
|
|
307
326
|
}
|
|
308
327
|
else {
|
|
309
|
-
|
|
310
|
-
try {
|
|
311
|
-
debugLogging('INIT LC', true);
|
|
312
|
-
await lcsManager.start();
|
|
313
|
-
onLanguageClientsStartDone?.(lcsManager);
|
|
314
|
-
debugLogging('INIT LC: Language client started', true);
|
|
315
|
-
debugLogging('INIT LC DONE', true);
|
|
316
|
-
}
|
|
317
|
-
catch (error) {
|
|
318
|
-
performErrorHandling(error);
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
lcsManager.setLogLevel(languageClientConfig.logLevel);
|
|
322
|
-
lcsManager.setConfig(languageClientConfig);
|
|
323
|
-
if (!lcsManager.isStarted()) {
|
|
324
|
-
addQueue({ id: 'lcInit', func: lcInitFunc, currentContainer: containerRef.current });
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
debugLogging('INIT LC: Language client is already running. No need to schedule async start.', true);
|
|
328
|
-
}
|
|
328
|
+
debugLogging('ENFORCE DISPOSE LC: Denied');
|
|
329
329
|
}
|
|
330
|
-
}, [
|
|
330
|
+
}, [enforceLanguageClientDispose]);
|
|
331
331
|
useEffect(() => {
|
|
332
332
|
// this part runs on mount (componentDidMount)
|
|
333
333
|
// always try to perform global init. Reason: we cannot ensure order
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAA2C,MAAM,iCAAiC,CAAC;AACrG,OAAO,EAA6B,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAA8B,sBAAsB,EAAE,MAAM,wCAAwC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AAE,CAAC;oBACb,yFAAyF;oBACzF,oBAAoB,CAAC,IAAI,KAAK,CAAC,qEAAqE,KAAK,EAAE,CAAC,CAAC,CAAC;gBAClH,CAAC;YAAA,CACJ,CAAC;YACF,QAAQ,CAAC,EAAE,EAAE,EAAC,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9F,CAAC;aAAM,CAAC;YACJ,YAAY,CAAC,4BAA4B,CAAC,CAAC;QAC/C,CAAC;IAAA,CACJ,EAAE,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEnC,SAAS,CAAC,GAAG,EAAE,CAAC;QACZ,8CAA8C;QAE9C,oEAAoE;QACpE,iBAAiB,EAAE,CAAC;QAEpB,mDAAmD;QACnD,OAAO,GAAG,EAAE,CAAC;YACT,QAAQ,CAAC,EAAE,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;QAAA,CACjG,CAAC;IAAA,CACL,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE,CAAC;QACZ,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;IAAA,CACJ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACH,6BACI,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,GACtB,CACL,CAAC;AAAA,CACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typefox/monaco-editor-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React component for Monaco-Editor and Monaco Languageclient",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"npm": "10.9.3"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@codingame/monaco-vscode-editor-api": "^23.0.
|
|
49
|
+
"@codingame/monaco-vscode-editor-api": "^23.0.3",
|
|
50
50
|
"react": ">=18.0.0 || <20.0.0"
|
|
51
51
|
},
|
|
52
52
|
"repository": {
|
package/src/index.tsx
CHANGED
|
@@ -22,10 +22,12 @@ export type MonacoEditorProps = {
|
|
|
22
22
|
onEditorStartDone?: (editorApp?: EditorApp) => void;
|
|
23
23
|
onLanguageClientsStartDone?: (lcsManager: LanguageClientManager) => void;
|
|
24
24
|
onTextChanged?: (textChanges: TextContents) => void;
|
|
25
|
-
onConfigProcessed?: (editorApp?: EditorApp) => void;
|
|
25
|
+
onConfigProcessed?: (result: { textUpdated: boolean, modelUpdated: boolean}, editorApp?: EditorApp) => void;
|
|
26
26
|
onError?: (error: Error) => void;
|
|
27
27
|
onDisposeEditor?: () => void;
|
|
28
28
|
onDisposeLanguageClient?: () => void;
|
|
29
|
+
toggleReprocessConfig?: boolean;
|
|
30
|
+
enforceLanguageClientDispose?: boolean;
|
|
29
31
|
logLevel?: LogLevel | number;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -61,7 +63,7 @@ const executeQueue = async () => {
|
|
|
61
63
|
const lengthBefore = runQueue.length;
|
|
62
64
|
const queueObj = runQueue.shift();
|
|
63
65
|
debugLogging('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');
|
|
64
|
-
debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}
|
|
66
|
+
debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}`);
|
|
65
67
|
await queueObj?.func(queueObj.currentContainer);
|
|
66
68
|
debugLogging(`QUEUE ${queueObj?.id} end: SIZE after: ${runQueue.length}`);
|
|
67
69
|
}
|
|
@@ -89,12 +91,9 @@ const stopQueue = () => {
|
|
|
89
91
|
}
|
|
90
92
|
};
|
|
91
93
|
|
|
92
|
-
const debugLogging = (id: string
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} else {
|
|
96
|
-
logger.debug(id);
|
|
97
|
-
}
|
|
94
|
+
const debugLogging = (id: string) => {
|
|
95
|
+
const now = new Date(Date.now());
|
|
96
|
+
logger.debug(`[${now.getMinutes()}:${now.getSeconds()}:${now.getMilliseconds()}]: ${id}`);
|
|
98
97
|
};
|
|
99
98
|
|
|
100
99
|
export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
@@ -112,7 +111,9 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
112
111
|
onError,
|
|
113
112
|
onDisposeEditor,
|
|
114
113
|
onDisposeLanguageClient,
|
|
115
|
-
logLevel
|
|
114
|
+
logLevel,
|
|
115
|
+
toggleReprocessConfig,
|
|
116
|
+
enforceLanguageClientDispose
|
|
116
117
|
} = props;
|
|
117
118
|
|
|
118
119
|
const editorAppRef = useRef<EditorApp>(undefined);
|
|
@@ -124,9 +125,11 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
124
125
|
const onTextChangedRef = useRef(onTextChanged);
|
|
125
126
|
const launchingRef = useRef<boolean>(false);
|
|
126
127
|
const editorAppConfigRef = useRef<EditorAppConfig>(undefined);
|
|
128
|
+
const flipReprocessConfigRef = useRef<boolean>(false);
|
|
129
|
+
const flipLanguageClientDisposeRef = useRef<boolean>(false);
|
|
127
130
|
|
|
128
131
|
const performErrorHandling = (error: Error) => {
|
|
129
|
-
debugLogging(`ERROR: ${error.message}
|
|
132
|
+
debugLogging(`ERROR: ${error.message}`);
|
|
130
133
|
if (onError) {
|
|
131
134
|
onError(error);
|
|
132
135
|
} else {
|
|
@@ -152,15 +155,10 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
152
155
|
apiWrapper = new MonacoVscodeApiWrapper(vscodeApiConfig!);
|
|
153
156
|
const globalInitFunc = async () => {
|
|
154
157
|
try {
|
|
155
|
-
debugLogging('GLOBAL INIT', true);
|
|
156
|
-
|
|
157
158
|
if (apiWrapper === undefined) throw new Error('Unexpected error occurred: apiWrapper is not available! Aborting...');
|
|
158
159
|
|
|
159
160
|
await apiWrapper.start();
|
|
160
161
|
onVscodeApiInitDone?.(apiWrapper);
|
|
161
|
-
|
|
162
|
-
debugLogging('GLOBAL INIT DONE', true);
|
|
163
|
-
|
|
164
162
|
runQueueLock = false;
|
|
165
163
|
} catch (error) {
|
|
166
164
|
performErrorHandling(error as Error);
|
|
@@ -176,16 +174,14 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
176
174
|
|
|
177
175
|
const editorInit = async (htmlContainer: HTMLElement | null) => {
|
|
178
176
|
try {
|
|
179
|
-
debugLogging('INIT EDITOR', true);
|
|
180
177
|
// it is possible to run without an editorApp, when the ViewsService or WorkbenchService
|
|
181
178
|
if (haveEditorService()) {
|
|
182
179
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
183
180
|
if (htmlContainer === null || (htmlContainer !== null && htmlContainer.parentElement === null)) {
|
|
184
|
-
debugLogging('INIT EDITOR: Unable to create editor. HTML container or the parent is missing.'
|
|
181
|
+
debugLogging('INIT EDITOR: Unable to create editor. HTML container or the parent is missing.');
|
|
185
182
|
} else {
|
|
186
183
|
if (editorAppRef.current === undefined && !launchingRef.current) {
|
|
187
184
|
launchingRef.current = true;
|
|
188
|
-
debugLogging('INIT EDITOR: Creating editor', true);
|
|
189
185
|
|
|
190
186
|
editorAppRef.current = new EditorApp(editorAppConfigRef.current);
|
|
191
187
|
if (editorAppRef.current.isStarting() === true || editorAppRef.current.isDisposing() === true) {
|
|
@@ -212,14 +208,14 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
212
208
|
|
|
213
209
|
onEditorStartDone?.(editorAppRef.current);
|
|
214
210
|
launchingRef.current = false;
|
|
211
|
+
debugLogging('INIT EDITOR: Editor start was successful.');
|
|
215
212
|
} else {
|
|
216
|
-
debugLogging('INIT EDITOR: Editor already
|
|
213
|
+
debugLogging('INIT EDITOR: Editor was already started.');
|
|
217
214
|
}
|
|
218
215
|
}
|
|
219
216
|
} else {
|
|
220
|
-
debugLogging('INIT EDITOR: Do nothing: Using ViewsService'
|
|
217
|
+
debugLogging('INIT EDITOR: Do nothing: Using ViewsService');
|
|
221
218
|
}
|
|
222
|
-
debugLogging('INIT EDITOR: Done', true);
|
|
223
219
|
} catch (error) {
|
|
224
220
|
performErrorHandling(error as Error);
|
|
225
221
|
}
|
|
@@ -227,15 +223,15 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
227
223
|
|
|
228
224
|
const updateEditorModel = async () => {
|
|
229
225
|
try {
|
|
230
|
-
debugLogging('UPDATE EDITOR MODEL', true);
|
|
231
226
|
if (!launchingRef.current && editorAppRef.current) {
|
|
232
227
|
editorAppRef.current.updateCodeResources(editorAppConfigRef.current?.codeResources);
|
|
233
228
|
updateModelRelatedRefs();
|
|
234
|
-
onConfigProcessed?.(editorAppRef.current);
|
|
229
|
+
onConfigProcessed?.({modelUpdated: true, textUpdated: true}, editorAppRef.current);
|
|
230
|
+
debugLogging('UPDATE EDITOR MODEL: Model was updated.');
|
|
235
231
|
} else {
|
|
236
|
-
|
|
232
|
+
onConfigProcessed?.({modelUpdated: false, textUpdated: false}, editorAppRef.current);
|
|
233
|
+
debugLogging('UPDATE EDITOR MODEL: No editor is avilable. Model update was not possible.');
|
|
237
234
|
}
|
|
238
|
-
debugLogging('UPDATE EDITOR MODEL: Done', true);
|
|
239
235
|
} catch (error) {
|
|
240
236
|
performErrorHandling(error as Error);
|
|
241
237
|
}
|
|
@@ -251,25 +247,24 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
251
247
|
const disposeEditor = async () => {
|
|
252
248
|
try {
|
|
253
249
|
// dispose editor if used
|
|
254
|
-
debugLogging('DISPOSE', true);
|
|
255
|
-
|
|
256
250
|
if (editorAppRef.current !== undefined) {
|
|
257
251
|
await editorAppRef.current.dispose();
|
|
258
252
|
editorAppRef.current = undefined;
|
|
259
253
|
onDisposeEditor?.();
|
|
254
|
+
debugLogging('DISPOSE: EditorApp was disposed');
|
|
260
255
|
} else {
|
|
261
|
-
debugLogging('DISPOSE: EditorApp is not disposed'
|
|
256
|
+
debugLogging('DISPOSE: EditorApp is not disposed');
|
|
262
257
|
}
|
|
263
|
-
debugLogging('DISPOSE DONE', true);
|
|
264
258
|
} catch (error) {
|
|
265
259
|
performErrorHandling(error as Error);
|
|
266
260
|
}
|
|
267
261
|
};
|
|
268
262
|
|
|
269
263
|
const processConfig = () => {
|
|
270
|
-
let
|
|
264
|
+
let modelUpdated = false;
|
|
265
|
+
let textUpdated = false;
|
|
271
266
|
try {
|
|
272
|
-
debugLogging('CONFIG PROCESSED'
|
|
267
|
+
debugLogging('CONFIG PROCESSED: Started');
|
|
273
268
|
if (!launchingRef.current && editorAppRef.current) {
|
|
274
269
|
if (editorAppConfigRef.current?.codeResources !== undefined) {
|
|
275
270
|
const newModifiedCodeUri = editorAppConfigRef.current.codeResources.modified?.uri;
|
|
@@ -279,13 +274,14 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
279
274
|
const originalUri = originalCodeUriRef.current !== newOriginalCodeUri ? newOriginalCodeUri : undefined;
|
|
280
275
|
// re-create the editor if the URIs have changed
|
|
281
276
|
if (modifiedUri !== undefined || originalUri !== undefined) {
|
|
282
|
-
|
|
277
|
+
modelUpdated = true;
|
|
283
278
|
} else {
|
|
284
279
|
const newModifiedCode = editorAppConfigRef.current.codeResources.modified?.text;
|
|
285
280
|
const newOriginalCode = editorAppConfigRef.current.codeResources.original?.text;
|
|
286
281
|
const modified = modifiedCodeRef.current !== newModifiedCode ? newModifiedCode : undefined;
|
|
287
282
|
const original = originalCodeRef.current !== newOriginalCode ? newOriginalCode : undefined;
|
|
288
283
|
if (modified !== undefined || original !== undefined) {
|
|
284
|
+
textUpdated = true;
|
|
289
285
|
editorAppRef.current.updateCode({ modified, original });
|
|
290
286
|
}
|
|
291
287
|
}
|
|
@@ -301,14 +297,15 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
301
297
|
}
|
|
302
298
|
}
|
|
303
299
|
}
|
|
304
|
-
if
|
|
305
|
-
|
|
300
|
+
// notitfy now if no async model update was necessary
|
|
301
|
+
if (!modelUpdated) {
|
|
302
|
+
onConfigProcessed?.({modelUpdated, textUpdated}, editorAppRef.current);
|
|
306
303
|
}
|
|
307
|
-
debugLogging('CONFIG PROCESSED: Done'
|
|
304
|
+
debugLogging('CONFIG PROCESSED: Done');
|
|
308
305
|
} catch (error) {
|
|
309
306
|
performErrorHandling(error as Error);
|
|
310
307
|
}
|
|
311
|
-
return
|
|
308
|
+
return modelUpdated;
|
|
312
309
|
};
|
|
313
310
|
|
|
314
311
|
useEffect(() => {
|
|
@@ -321,21 +318,29 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
321
318
|
editorAppConfigRef.current = editorAppConfig;
|
|
322
319
|
// it is possible to run without an editorApp, when the ViewsService or WorkbenchService
|
|
323
320
|
if (haveEditorService()) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
addQueue({ id: 'model update', func: updateEditorModel, currentContainer: containerRef.current});
|
|
321
|
+
if (editorAppRef.current === undefined) {
|
|
322
|
+
addQueue({ id: 'editorInit', func: editorInit, currentContainer: containerRef.current});
|
|
327
323
|
} else {
|
|
328
|
-
|
|
329
|
-
addQueue({ id: 'editorInit', func: editorInit, currentContainer: containerRef.current});
|
|
330
|
-
} else {
|
|
331
|
-
debugLogging('CHECK EDITOR: Editor already created', true);
|
|
332
|
-
}
|
|
324
|
+
debugLogging('CHECK EDITOR: Editor already created. No queueing necessary.');
|
|
333
325
|
}
|
|
334
326
|
} else {
|
|
335
|
-
debugLogging('INIT EDITOR: Do nothing: Using ViewsService'
|
|
327
|
+
debugLogging('INIT EDITOR: Do nothing: Using ViewsService');
|
|
336
328
|
}
|
|
337
329
|
}, [editorAppConfig]);
|
|
338
330
|
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
if (flipReprocessConfigRef.current !== (toggleReprocessConfig === true)) {
|
|
333
|
+
debugLogging('REPROCESS CONFIG: Triggered');
|
|
334
|
+
const updateModel = processConfig();
|
|
335
|
+
if (updateModel) {
|
|
336
|
+
addQueue({ id: 'modelUpdate', func: updateEditorModel, currentContainer: containerRef.current});
|
|
337
|
+
}
|
|
338
|
+
flipReprocessConfigRef.current = !flipReprocessConfigRef.current;
|
|
339
|
+
} else {
|
|
340
|
+
debugLogging('REPROCESS CONFIG: Denied');
|
|
341
|
+
}
|
|
342
|
+
}, [toggleReprocessConfig]);
|
|
343
|
+
|
|
339
344
|
useEffect(() => {
|
|
340
345
|
// fast-fail
|
|
341
346
|
if (languageClientConfig === undefined) return;
|
|
@@ -343,44 +348,39 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
|
|
|
343
348
|
// always try to perform global init. Reason: we cannot ensure order
|
|
344
349
|
performGlobalInit();
|
|
345
350
|
|
|
346
|
-
|
|
351
|
+
const lcInitFunc = async () => {
|
|
352
|
+
try {
|
|
353
|
+
await lcsManager.start();
|
|
354
|
+
onLanguageClientsStartDone?.(lcsManager);
|
|
355
|
+
} catch (error) {
|
|
356
|
+
performErrorHandling(error as Error);
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
lcsManager.setLogLevel(languageClientConfig.logLevel);
|
|
360
|
+
lcsManager.setConfig(languageClientConfig);
|
|
361
|
+
if (!lcsManager.isStarted()) {
|
|
362
|
+
addQueue({ id:'lcInit', func: lcInitFunc, currentContainer: containerRef.current });
|
|
363
|
+
} else {
|
|
364
|
+
debugLogging('INIT LC: Language client is already running. No need to schedule async start.');
|
|
365
|
+
}
|
|
366
|
+
}, [languageClientConfig]);
|
|
367
|
+
|
|
368
|
+
useEffect(() => {
|
|
369
|
+
if (flipLanguageClientDisposeRef.current !== (enforceLanguageClientDispose === true)) {
|
|
347
370
|
const disposeLCFunc = async () => {
|
|
348
|
-
// dispose editor if used
|
|
349
371
|
try {
|
|
350
|
-
debugLogging('DISPOSE LC ENFORCED', true);
|
|
351
|
-
|
|
352
372
|
await lcsManager.dispose();
|
|
353
373
|
onDisposeLanguageClient?.();
|
|
354
|
-
|
|
355
|
-
debugLogging('DISPOSE LC ENFORCED DONE', true);
|
|
356
374
|
} catch (error) {
|
|
357
375
|
// The language client may throw an error during disposal, but we want to continue anyway
|
|
358
376
|
performErrorHandling(new Error(`Unexpected error occurred during disposal of the language client: ${error}`));
|
|
359
377
|
}
|
|
360
378
|
};
|
|
361
|
-
addQueue({ id:'
|
|
379
|
+
addQueue({ id:'lcDispose', func: disposeLCFunc, currentContainer: containerRef.current });
|
|
362
380
|
} else {
|
|
363
|
-
|
|
364
|
-
try {
|
|
365
|
-
debugLogging('INIT LC', true);
|
|
366
|
-
|
|
367
|
-
await lcsManager.start();
|
|
368
|
-
onLanguageClientsStartDone?.(lcsManager);
|
|
369
|
-
debugLogging('INIT LC: Language client started', true);
|
|
370
|
-
debugLogging('INIT LC DONE', true);
|
|
371
|
-
} catch (error) {
|
|
372
|
-
performErrorHandling(error as Error);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
lcsManager.setLogLevel(languageClientConfig.logLevel);
|
|
376
|
-
lcsManager.setConfig(languageClientConfig);
|
|
377
|
-
if (!lcsManager.isStarted()) {
|
|
378
|
-
addQueue({ id:'lcInit', func: lcInitFunc, currentContainer: containerRef.current });
|
|
379
|
-
} else {
|
|
380
|
-
debugLogging('INIT LC: Language client is already running. No need to schedule async start.', true);
|
|
381
|
-
}
|
|
381
|
+
debugLogging('ENFORCE DISPOSE LC: Denied');
|
|
382
382
|
}
|
|
383
|
-
}, [
|
|
383
|
+
}, [enforceLanguageClientDispose]);
|
|
384
384
|
|
|
385
385
|
useEffect(() => {
|
|
386
386
|
// this part runs on mount (componentDidMount)
|