@typefox/monaco-editor-react 7.3.0-next.4 → 7.3.0-next.6

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 CHANGED
@@ -2,10 +2,10 @@
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.3.0-next.4] - 2025-11-13
5
+ ## [7.3.0-next.6] - 2025-11-13
6
6
 
7
7
  - Fixed re-rendering issues with React StrictMode [#986](https://github.com/TypeFox/monaco-languageclient/pull/986).
8
- - Updated to `monaco-languageclient@10.3.0-next.4`.
8
+ - Updated to `monaco-languageclient@10.3.0-next.6`.
9
9
  - Updated all `@codingame/monaco-vscode` packages to `22.1.9`.
10
10
 
11
11
  ## [7.2.0] - 2025-10-20
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,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,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AAC,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,CAAC;IACpD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAChC,CAAA;AAmED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkT7D,CAAC"}
package/lib/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  * Licensed under the MIT License. See LICENSE in the package root for license information.
4
4
  * ------------------------------------------------------------------------------------------ */
5
5
  import { LogLevel } from '@codingame/monaco-vscode-api';
6
- import * as monaco from '@codingame/monaco-vscode-editor-api';
7
6
  import { ConsoleLogger } from 'monaco-languageclient/common';
8
7
  import { EditorApp } from 'monaco-languageclient/editorApp';
9
8
  import { LanguageClientManager } from 'monaco-languageclient/lcwrapper';
@@ -17,8 +16,9 @@ const haveEditorService = () => {
17
16
  };
18
17
  const logger = new ConsoleLogger(LogLevel.Debug);
19
18
  const runQueue = [];
20
- let queueLock = true;
19
+ let runQueueLock = true;
21
20
  let intervalId = undefined;
21
+ const queueIntervalMs = 25;
22
22
  const addQueue = (id, func) => {
23
23
  debugLogging('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
24
24
  debugLogging(`Adding to queue: ${id}: QUEUE SIZE before: ${runQueue.length}`);
@@ -28,34 +28,27 @@ const addQueue = (id, func) => {
28
28
  const executeQueue = async () => {
29
29
  console.log(`Queue size: ${runQueue.length}`);
30
30
  if (runQueue.length > 0) {
31
- queueLock = true;
31
+ runQueueLock = true;
32
32
  while (runQueue.length > 0) {
33
33
  const lengthBefore = runQueue.length;
34
34
  const queueObj = runQueue.shift();
35
35
  debugLogging('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');
36
36
  debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}`, true);
37
- try {
38
- await queueObj?.func();
39
- }
40
- catch (error) {
41
- queueLock = false;
42
- debugLogging(`QUEUE ${queueObj?.id} ERROR: SIZE after: ${runQueue.length}`);
43
- throw error;
44
- }
37
+ await queueObj?.func();
45
38
  debugLogging(`QUEUE ${queueObj?.id} end: SIZE after: ${runQueue.length}`);
46
39
  }
47
- queueLock = false;
40
+ runQueueLock = false;
48
41
  }
49
42
  };
50
43
  const kickQueue = () => {
51
44
  if (intervalId === undefined && runQueue.length > 0) {
52
45
  intervalId = setInterval(async () => {
53
- debugLogging('Checking queue...' + queueLock);
54
- if (!queueLock) {
46
+ debugLogging('Checking queue...' + runQueueLock);
47
+ if (!runQueueLock) {
55
48
  await executeQueue();
56
49
  stopQueue();
57
50
  }
58
- }, 50);
51
+ }, queueIntervalMs);
59
52
  }
60
53
  };
61
54
  const stopQueue = () => {
@@ -77,6 +70,10 @@ export const MonacoEditorReactComp = (props) => {
77
70
  const { style, className, vscodeApiConfig, editorAppConfig, languageClientConfig, onVscodeApiInitDone, onEditorStartDone, onLanguageClientsStartDone, onTextChanged, onConfigProcessed, onError, onDisposeEditor, onDisposeLanguageClient, logLevel } = props;
78
71
  const editorAppRef = useRef(undefined);
79
72
  const containerRef = useRef(null);
73
+ const modifiedCodeUriRef = useRef(undefined);
74
+ const modifiedCodeRef = useRef(undefined);
75
+ const originalCodeUriRef = useRef(undefined);
76
+ const originalCodeRef = useRef(undefined);
80
77
  const onTextChangedRef = useRef(onTextChanged);
81
78
  const launchingRef = useRef(false);
82
79
  const editorAppConfigRef = useRef(undefined);
@@ -86,6 +83,8 @@ export const MonacoEditorReactComp = (props) => {
86
83
  onError(error);
87
84
  }
88
85
  else {
86
+ debugLogging(`INTERCEPTED Error: ${error}. Stopping queue...`);
87
+ runQueueLock = false;
89
88
  throw error;
90
89
  }
91
90
  };
@@ -115,7 +114,7 @@ export const MonacoEditorReactComp = (props) => {
115
114
  await apiWrapper.start();
116
115
  onVscodeApiInitDone?.(apiWrapper);
117
116
  debugLogging('GLOBAL INIT DONE', true);
118
- queueLock = false;
117
+ runQueueLock = false;
119
118
  }
120
119
  catch (error) {
121
120
  performErrorHandling(error);
@@ -123,8 +122,13 @@ export const MonacoEditorReactComp = (props) => {
123
122
  };
124
123
  globalInitFunc();
125
124
  }
125
+ else if (envEnhanced.vscodeApiInitialised === true) {
126
+ if (runQueueLock && intervalId !== undefined) {
127
+ runQueueLock = false;
128
+ }
129
+ }
126
130
  };
127
- const editorInitFunc = async () => {
131
+ const editorInit = async () => {
128
132
  try {
129
133
  debugLogging('INIT EDITOR', true);
130
134
  // it is possible to run without an editorApp, when the ViewsService or WorkbenchService
@@ -139,7 +143,17 @@ export const MonacoEditorReactComp = (props) => {
139
143
  editorAppRef.current.getDisposingAwait()
140
144
  ]);
141
145
  }
146
+ modifiedCodeRef.current = editorAppConfigRef.current?.codeResources?.modified?.text;
147
+ originalCodeRef.current = editorAppConfigRef.current?.codeResources?.original?.text;
148
+ modifiedCodeUriRef.current = editorAppConfigRef.current?.codeResources?.modified?.uri;
149
+ originalCodeUriRef.current = editorAppConfigRef.current?.codeResources?.original?.uri;
142
150
  editorAppRef.current.registerOnTextChangedCallback((textChanges) => {
151
+ if (textChanges.modified !== undefined) {
152
+ modifiedCodeRef.current = textChanges.modified;
153
+ }
154
+ if (textChanges.original !== undefined) {
155
+ originalCodeRef.current = textChanges.original;
156
+ }
143
157
  if (onTextChangedRef.current !== undefined) {
144
158
  onTextChangedRef.current(textChanges);
145
159
  }
@@ -161,29 +175,84 @@ export const MonacoEditorReactComp = (props) => {
161
175
  performErrorHandling(error);
162
176
  }
163
177
  };
164
- const configProcessedFunc = () => {
165
- debugLogging('CONFIG PROCESSED', true);
166
- if (!launchingRef.current) {
167
- if (editorAppConfigRef.current?.codeResources !== undefined && editorAppRef.current) {
168
- editorAppRef.current.updateCodeResources(editorAppConfigRef.current.codeResources);
169
- editorAppRef.current.updateCode({
170
- modified: editorAppConfigRef.current.codeResources.modified?.text,
171
- original: editorAppConfigRef.current.codeResources.original?.text
172
- });
178
+ const updateEditorModel = async () => {
179
+ try {
180
+ debugLogging('UPDATE EDITOR MODEL', true);
181
+ if (!launchingRef.current && editorAppRef.current) {
182
+ editorAppRef.current.updateCodeResources(editorAppConfigRef.current?.codeResources);
183
+ onConfigProcessed?.(editorAppRef.current);
173
184
  }
174
- if (editorAppConfigRef.current?.editorOptions !== undefined && editorAppRef.current) {
175
- if (!editorAppRef.current.isDiffEditor()) {
176
- editorAppRef.current.getEditor()?.updateOptions(editorAppConfigRef.current.editorOptions);
177
- }
185
+ else {
186
+ debugLogging('UPDATE EDITOR MODEL: Not Possible: No editor', true);
187
+ }
188
+ debugLogging('UPDATE EDITOR MODEL: Done', true);
189
+ }
190
+ catch (error) {
191
+ performErrorHandling(error);
192
+ }
193
+ };
194
+ const disposeEditor = async () => {
195
+ try {
196
+ // dispose editor if used
197
+ debugLogging('DISPOSE', true);
198
+ if (editorAppRef.current !== undefined) {
199
+ await editorAppRef.current.dispose();
200
+ editorAppRef.current = undefined;
201
+ onDisposeEditor?.();
202
+ }
203
+ else {
204
+ debugLogging('DISPOSE: EditorApp is not disposed', true);
178
205
  }
179
- if (editorAppConfigRef.current?.diffEditorOptions !== undefined && editorAppRef.current) {
180
- if (editorAppRef.current.isDiffEditor()) {
181
- editorAppRef.current.getDiffEditor()?.updateOptions(editorAppConfigRef.current.diffEditorOptions);
206
+ debugLogging('DISPOSE DONE', true);
207
+ }
208
+ catch (error) {
209
+ performErrorHandling(error);
210
+ }
211
+ };
212
+ const processConfig = () => {
213
+ let updateModel = false;
214
+ try {
215
+ debugLogging('CONFIG PROCESSED', true);
216
+ if (!launchingRef.current && editorAppRef.current) {
217
+ if (editorAppConfigRef.current?.codeResources !== undefined) {
218
+ const newModifiedCodeUri = editorAppConfigRef.current.codeResources.modified?.uri;
219
+ const newOriginalCodeUri = editorAppConfigRef.current.codeResources.original?.uri;
220
+ const modifiedUri = modifiedCodeUriRef.current !== newModifiedCodeUri ? newModifiedCodeUri : undefined;
221
+ const originalUri = originalCodeUriRef.current !== newOriginalCodeUri ? newOriginalCodeUri : undefined;
222
+ // re-create the editor if the URIs have changed
223
+ if (modifiedUri !== undefined || originalUri !== undefined) {
224
+ updateModel = true;
225
+ }
226
+ else {
227
+ const newModifiedCode = editorAppConfigRef.current.codeResources.modified?.text;
228
+ const newOriginalCode = editorAppConfigRef.current.codeResources.original?.text;
229
+ const modified = modifiedCodeRef.current !== newModifiedCode ? newModifiedCode : undefined;
230
+ const original = originalCodeRef.current !== newOriginalCode ? newOriginalCode : undefined;
231
+ if (modified !== undefined || original !== undefined) {
232
+ editorAppRef.current.updateCode({ modified, original });
233
+ }
234
+ }
235
+ }
236
+ if (editorAppConfigRef.current?.editorOptions !== undefined) {
237
+ if (!editorAppRef.current.isDiffEditor()) {
238
+ editorAppRef.current.getEditor()?.updateOptions(editorAppConfigRef.current.editorOptions);
239
+ }
182
240
  }
241
+ if (editorAppConfigRef.current?.diffEditorOptions !== undefined) {
242
+ if (editorAppRef.current.isDiffEditor()) {
243
+ editorAppRef.current.getDiffEditor()?.updateOptions(editorAppConfigRef.current.diffEditorOptions);
244
+ }
245
+ }
246
+ }
247
+ if (!updateModel) {
248
+ onConfigProcessed?.(editorAppRef.current);
183
249
  }
250
+ debugLogging('CONFIG PROCESSED: Done', true);
251
+ }
252
+ catch (error) {
253
+ performErrorHandling(error);
184
254
  }
185
- onConfigProcessed?.(editorAppRef.current);
186
- debugLogging('CONFIG PROCESSED: Done', true);
255
+ return updateModel;
187
256
  };
188
257
  useEffect(() => {
189
258
  // fast-fail
@@ -192,12 +261,23 @@ export const MonacoEditorReactComp = (props) => {
192
261
  // always try to perform global init. Reason: we cannot ensure order
193
262
  performGlobalInit();
194
263
  editorAppConfigRef.current = editorAppConfig;
195
- addQueue('editorInit', editorInitFunc);
196
264
  // it is possible to run without an editorApp, when the ViewsService or WorkbenchService
197
265
  if (haveEditorService()) {
198
- if (editorAppRef.current !== undefined && !launchingRef.current) {
199
- configProcessedFunc();
266
+ const updateModel = processConfig();
267
+ if (updateModel) {
268
+ addQueue('model update', updateEditorModel);
200
269
  }
270
+ else {
271
+ if (editorAppRef.current === undefined) {
272
+ addQueue('editorInit', editorInit);
273
+ }
274
+ else {
275
+ debugLogging('CHECK EDITOR: Editor already created', true);
276
+ }
277
+ }
278
+ }
279
+ else {
280
+ debugLogging('INIT EDITOR: Do nothing: Using ViewsService', true);
201
281
  }
202
282
  }, [editorAppConfig]);
203
283
  useEffect(() => {
@@ -227,7 +307,7 @@ export const MonacoEditorReactComp = (props) => {
227
307
  try {
228
308
  debugLogging('INIT LC', true);
229
309
  lcsManager.setLogLevel(languageClientConfig.logLevel);
230
- await lcsManager.setConfig(languageClientConfig);
310
+ lcsManager.setConfig(languageClientConfig);
231
311
  if (!lcsManager.isStarted()) {
232
312
  await lcsManager.start();
233
313
  onLanguageClientsStartDone?.(lcsManager);
@@ -251,20 +331,7 @@ export const MonacoEditorReactComp = (props) => {
251
331
  performGlobalInit();
252
332
  // this part runs on unmount (componentWillUnmount)
253
333
  return () => {
254
- const disposeFunc = async () => {
255
- // dispose editor if used
256
- debugLogging('DISPOSE', true);
257
- if (editorAppRef.current !== undefined) {
258
- await editorAppRef.current.dispose();
259
- editorAppRef.current = undefined;
260
- onDisposeEditor?.();
261
- }
262
- else {
263
- debugLogging('DISPOSE: EditorApp is not disposed', true);
264
- }
265
- debugLogging('DISPOSE DONE', true);
266
- };
267
- addQueue('dispose', disposeFunc);
334
+ addQueue('disposeEditor', disposeEditor);
268
335
  };
269
336
  }, []);
270
337
  useEffect(() => {
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,KAAK,MAAM,MAAM,qCAAqC,CAAC;AAC9D,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,CAAC;AAC1I,OAAO,KAAK,EAAE,EAAsB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAqBrE,2GAA2G;AAC3G,IAAI,UAA8C,CAAC;AACnD,MAAM,UAAU,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAC/C,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC;IAC5B,OAAO,4BAA4B,EAAE,CAAC,eAAe,KAAK,eAAe,CAAC;AAAA,CAC7E,CAAC;AACF,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEjD,MAAM,QAAQ,GAAmD,EAAE,CAAC;AACpE,IAAI,SAAS,GAAG,IAAI,CAAC;AACrB,IAAI,UAAU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AC;QAAA,CAC7C,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.0-next.4",
3
+ "version": "7.3.0-next.6",
4
4
  "license": "MIT",
5
5
  "description": "React component for Monaco-Editor and Monaco Languageclient",
6
6
  "keywords": [
package/src/index.tsx CHANGED
@@ -4,7 +4,6 @@
4
4
  * ------------------------------------------------------------------------------------------ */
5
5
 
6
6
  import { LogLevel } from '@codingame/monaco-vscode-api';
7
- import * as monaco from '@codingame/monaco-vscode-editor-api';
8
7
  import { ConsoleLogger } from 'monaco-languageclient/common';
9
8
  import { EditorApp, type EditorAppConfig, type TextContents } from 'monaco-languageclient/editorApp';
10
9
  import { type LanguageClientConfig, LanguageClientManager } from 'monaco-languageclient/lcwrapper';
@@ -39,8 +38,9 @@ const haveEditorService = () => {
39
38
  const logger = new ConsoleLogger(LogLevel.Debug);
40
39
 
41
40
  const runQueue: Array<{id: string, func: () => Promise<void>}> = [];
42
- let queueLock = true;
41
+ let runQueueLock = true;
43
42
  let intervalId: number | unknown | undefined = undefined;
43
+ const queueIntervalMs = 25;
44
44
 
45
45
  const addQueue = (id: string, func: () => Promise<void>) => {
46
46
  debugLogging('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
@@ -53,34 +53,28 @@ const executeQueue = async () => {
53
53
  console.log(`Queue size: ${runQueue.length}`);
54
54
 
55
55
  if (runQueue.length > 0) {
56
- queueLock = true;
56
+ runQueueLock = true;
57
57
  while (runQueue.length > 0) {
58
58
  const lengthBefore = runQueue.length;
59
59
  const queueObj = runQueue.shift();
60
60
  debugLogging('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');
61
61
  debugLogging(`QUEUE ${queueObj?.id} start: SIZE before: ${lengthBefore}`, true);
62
- try {
63
- await queueObj?.func();
64
- } catch (error) {
65
- queueLock = false;
66
- debugLogging(`QUEUE ${queueObj?.id} ERROR: SIZE after: ${runQueue.length}`);
67
- throw error;
68
- }
62
+ await queueObj?.func();
69
63
  debugLogging(`QUEUE ${queueObj?.id} end: SIZE after: ${runQueue.length}`);
70
64
  }
71
- queueLock = false;
65
+ runQueueLock = false;
72
66
  }
73
67
  };
74
68
 
75
69
  const kickQueue = () => {
76
70
  if (intervalId === undefined && runQueue.length > 0) {
77
71
  intervalId = setInterval(async () => {
78
- debugLogging('Checking queue...' + queueLock);
79
- if (!queueLock) {
72
+ debugLogging('Checking queue...' + runQueueLock);
73
+ if (!runQueueLock) {
80
74
  await executeQueue();
81
75
  stopQueue();
82
76
  }
83
- }, 50);
77
+ }, queueIntervalMs);
84
78
  }
85
79
  };
86
80
 
@@ -120,6 +114,10 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
120
114
 
121
115
  const editorAppRef = useRef<EditorApp>(undefined);
122
116
  const containerRef = useRef<HTMLDivElement>(null);
117
+ const modifiedCodeUriRef = useRef<string>(undefined);
118
+ const modifiedCodeRef = useRef<string>(undefined);
119
+ const originalCodeUriRef = useRef<string>(undefined);
120
+ const originalCodeRef = useRef<string>(undefined);
123
121
  const onTextChangedRef = useRef(onTextChanged);
124
122
  const launchingRef = useRef<boolean>(false);
125
123
  const editorAppConfigRef = useRef<EditorAppConfig>(undefined);
@@ -129,6 +127,8 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
129
127
  if (onError) {
130
128
  onError(error);
131
129
  } else {
130
+ debugLogging(`INTERCEPTED Error: ${error}. Stopping queue...`);
131
+ runQueueLock = false;
132
132
  throw error;
133
133
  }
134
134
  };
@@ -165,16 +165,20 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
165
165
 
166
166
  debugLogging('GLOBAL INIT DONE', true);
167
167
 
168
- queueLock = false;
168
+ runQueueLock = false;
169
169
  } catch (error) {
170
170
  performErrorHandling(error as Error);
171
171
  }
172
172
  };
173
173
  globalInitFunc();
174
+ } else if (envEnhanced.vscodeApiInitialised === true) {
175
+ if (runQueueLock && intervalId !== undefined) {
176
+ runQueueLock = false;
177
+ }
174
178
  }
175
179
  };
176
180
 
177
- const editorInitFunc = async () => {
181
+ const editorInit = async () => {
178
182
  try {
179
183
  debugLogging('INIT EDITOR', true);
180
184
  // it is possible to run without an editorApp, when the ViewsService or WorkbenchService
@@ -190,8 +194,18 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
190
194
  editorAppRef.current.getDisposingAwait()
191
195
  ]);
192
196
  }
197
+ modifiedCodeRef.current = editorAppConfigRef.current?.codeResources?.modified?.text;
198
+ originalCodeRef.current = editorAppConfigRef.current?.codeResources?.original?.text;
199
+ modifiedCodeUriRef.current = editorAppConfigRef.current?.codeResources?.modified?.uri;
200
+ originalCodeUriRef.current = editorAppConfigRef.current?.codeResources?.original?.uri;
193
201
 
194
202
  editorAppRef.current.registerOnTextChangedCallback((textChanges) => {
203
+ if (textChanges.modified !== undefined) {
204
+ modifiedCodeRef.current = textChanges.modified;
205
+ }
206
+ if (textChanges.original !== undefined) {
207
+ originalCodeRef.current = textChanges.original;
208
+ }
195
209
  if (onTextChangedRef.current !== undefined) {
196
210
  onTextChangedRef.current(textChanges);
197
211
  }
@@ -212,29 +226,82 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
212
226
  }
213
227
  };
214
228
 
215
- const configProcessedFunc = () => {
216
- debugLogging('CONFIG PROCESSED', true);
217
- if (!launchingRef.current) {
218
- if (editorAppConfigRef.current?.codeResources !== undefined && editorAppRef.current) {
219
- editorAppRef.current.updateCodeResources(editorAppConfigRef.current.codeResources);
220
- editorAppRef.current.updateCode({
221
- modified: editorAppConfigRef.current.codeResources.modified?.text,
222
- original: editorAppConfigRef.current.codeResources.original?.text
223
- });
229
+ const updateEditorModel = async () => {
230
+ try {
231
+ debugLogging('UPDATE EDITOR MODEL', true);
232
+ if (!launchingRef.current && editorAppRef.current) {
233
+ editorAppRef.current.updateCodeResources(editorAppConfigRef.current?.codeResources);
234
+ onConfigProcessed?.(editorAppRef.current);
235
+ } else {
236
+ debugLogging('UPDATE EDITOR MODEL: Not Possible: No editor', true);
224
237
  }
225
- if (editorAppConfigRef.current?.editorOptions !== undefined && editorAppRef.current) {
226
- if (!editorAppRef.current.isDiffEditor()) {
227
- editorAppRef.current.getEditor()?.updateOptions(editorAppConfigRef.current.editorOptions as monaco.editor.IEditorOptions);
228
- }
238
+ debugLogging('UPDATE EDITOR MODEL: Done', true);
239
+ } catch (error) {
240
+ performErrorHandling(error as Error);
241
+ }
242
+ };
243
+
244
+ const disposeEditor = async () => {
245
+ try {
246
+ // dispose editor if used
247
+ debugLogging('DISPOSE', true);
248
+
249
+ if (editorAppRef.current !== undefined) {
250
+ await editorAppRef.current.dispose();
251
+ editorAppRef.current = undefined;
252
+ onDisposeEditor?.();
253
+ } else {
254
+ debugLogging('DISPOSE: EditorApp is not disposed', true);
229
255
  }
230
- if (editorAppConfigRef.current?.diffEditorOptions !== undefined && editorAppRef.current) {
231
- if (editorAppRef.current.isDiffEditor()) {
232
- editorAppRef.current.getDiffEditor()?.updateOptions(editorAppConfigRef.current.diffEditorOptions as monaco.editor.IDiffEditorOptions);
256
+ debugLogging('DISPOSE DONE', true);
257
+ } catch (error) {
258
+ performErrorHandling(error as Error);
259
+ }
260
+ };
261
+
262
+ const processConfig = () => {
263
+ let updateModel = false;
264
+ try {
265
+ debugLogging('CONFIG PROCESSED', true);
266
+ if (!launchingRef.current && editorAppRef.current) {
267
+ if (editorAppConfigRef.current?.codeResources !== undefined) {
268
+ const newModifiedCodeUri = editorAppConfigRef.current.codeResources.modified?.uri;
269
+ const newOriginalCodeUri = editorAppConfigRef.current.codeResources.original?.uri;
270
+
271
+ const modifiedUri = modifiedCodeUriRef.current !== newModifiedCodeUri ? newModifiedCodeUri : undefined;
272
+ const originalUri = originalCodeUriRef.current !== newOriginalCodeUri ? newOriginalCodeUri : undefined;
273
+ // re-create the editor if the URIs have changed
274
+ if (modifiedUri !== undefined || originalUri !== undefined) {
275
+ updateModel = true;
276
+ } else {
277
+ const newModifiedCode = editorAppConfigRef.current.codeResources.modified?.text;
278
+ const newOriginalCode = editorAppConfigRef.current.codeResources.original?.text;
279
+ const modified = modifiedCodeRef.current !== newModifiedCode ? newModifiedCode : undefined;
280
+ const original = originalCodeRef.current !== newOriginalCode ? newOriginalCode : undefined;
281
+ if (modified !== undefined || original !== undefined) {
282
+ editorAppRef.current.updateCode({ modified, original });
283
+ }
284
+ }
285
+ }
286
+ if (editorAppConfigRef.current?.editorOptions !== undefined) {
287
+ if (!editorAppRef.current.isDiffEditor()) {
288
+ editorAppRef.current.getEditor()?.updateOptions(editorAppConfigRef.current.editorOptions);
289
+ }
290
+ }
291
+ if (editorAppConfigRef.current?.diffEditorOptions !== undefined) {
292
+ if (editorAppRef.current.isDiffEditor()) {
293
+ editorAppRef.current.getDiffEditor()?.updateOptions(editorAppConfigRef.current.diffEditorOptions);
294
+ }
233
295
  }
234
296
  }
297
+ if (!updateModel) {
298
+ onConfigProcessed?.(editorAppRef.current);
299
+ }
300
+ debugLogging('CONFIG PROCESSED: Done', true);
301
+ } catch (error) {
302
+ performErrorHandling(error as Error);
235
303
  }
236
- onConfigProcessed?.(editorAppRef.current);
237
- debugLogging('CONFIG PROCESSED: Done', true);
304
+ return updateModel;
238
305
  };
239
306
 
240
307
  useEffect(() => {
@@ -245,12 +312,20 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
245
312
  performGlobalInit();
246
313
 
247
314
  editorAppConfigRef.current = editorAppConfig;
248
- addQueue('editorInit', editorInitFunc);
249
315
  // it is possible to run without an editorApp, when the ViewsService or WorkbenchService
250
316
  if (haveEditorService()) {
251
- if (editorAppRef.current !== undefined && !launchingRef.current) {
252
- configProcessedFunc();
317
+ const updateModel = processConfig();
318
+ if (updateModel) {
319
+ addQueue('model update', updateEditorModel);
320
+ } else {
321
+ if (editorAppRef.current === undefined) {
322
+ addQueue('editorInit', editorInit);
323
+ } else {
324
+ debugLogging('CHECK EDITOR: Editor already created', true);
325
+ }
253
326
  }
327
+ } else {
328
+ debugLogging('INIT EDITOR: Do nothing: Using ViewsService', true);
254
329
  }
255
330
  }, [editorAppConfig]);
256
331
 
@@ -283,7 +358,7 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
283
358
  debugLogging('INIT LC', true);
284
359
 
285
360
  lcsManager.setLogLevel(languageClientConfig.logLevel);
286
- await lcsManager.setConfig(languageClientConfig);
361
+ lcsManager.setConfig(languageClientConfig);
287
362
  if (!lcsManager.isStarted()) {
288
363
  await lcsManager.start();
289
364
  onLanguageClientsStartDone?.(lcsManager);
@@ -308,20 +383,7 @@ export const MonacoEditorReactComp: React.FC<MonacoEditorProps> = (props) => {
308
383
 
309
384
  // this part runs on unmount (componentWillUnmount)
310
385
  return () => {
311
- const disposeFunc = async () => {
312
- // dispose editor if used
313
- debugLogging('DISPOSE', true);
314
-
315
- if (editorAppRef.current !== undefined) {
316
- await editorAppRef.current.dispose();
317
- editorAppRef.current = undefined;
318
- onDisposeEditor?.();
319
- } else {
320
- debugLogging('DISPOSE: EditorApp is not disposed', true);
321
- }
322
- debugLogging('DISPOSE DONE', true);
323
- };
324
- addQueue('dispose', disposeFunc);
386
+ addQueue ('disposeEditor', disposeEditor);
325
387
  };
326
388
  }, []);
327
389