Copilot commented on code in PR #3291:
URL:
https://github.com/apache/incubator-kie-tools/pull/3291#discussion_r2375642348
##########
packages/runtime-tools-process-enveloped-components/src/formDetails/envelope/components/FormEditor/FormEditorController.tsx:
##########
@@ -74,13 +74,11 @@ export class FormEditorEditorController implements
FormEditorEditorApi {
noImplicitReturns: false,
alwaysStrict: false,
});
- const monacoModelUri = monaco.Uri.parse("file:///main.tsx"); // Ensures
TSX compatibility
- const existingModel = monaco.editor.getModel(monacoModelUri);
-
- if (existingModel) {
- existingModel.dispose(); // Clean up the old model
- }
- this.model = monaco.editor.createModel(content, this.language,
monacoModelUri);
+ this.model = monaco.editor.createModel(
+ content,
+ this.language,
+ monaco.Uri.parse("file:///main.tsx") // Ensures TSX compatibility
+ );
Review Comment:
Creating multiple models with the same URI can cause conflicts. Consider
using a unique URI for each model instance or implementing proper cleanup
before creating a new model with the same URI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]