TypeFox / monaco-components

Monaco Editor and Language Client Wrapper, plus Monaco Editor React Component
MIT License
42 stars 13 forks source link

Extension `monaco-languageclient-project.langium-example` is already registered #35

Closed cdietrich closed 5 months ago

cdietrich commented 1 year ago

using the react component in vscode mode i am getting this (on 2nd mount of component) any idea what could cause this?

is there some destroy/unregister missing?

kaisalmen commented 1 year ago

It seems the extension is not disposed. Unmount calls dispose on the wrapper, but here the extension is not unregistered. Haven't thought about that. That looks like a bug. Thank you for reporting this.

kaisalmen commented 1 year ago

@cdietrich In the meantime I have added explicit disposal of the extension https://github.com/TypeFox/monaco-components/blob/react-python/packages/monaco-editor-wrapper/src/editorAppVscodeApi.ts#L77-L81 but I wasn't able to reproduce your exact issue. Can you provide an example or repo / source link? Thanks

cdietrich commented 1 year ago

need to check how easily i can factor out an example. we meanwhile use the monaco classic variant

kaisalmen commented 1 year ago

A unit test here on branch that fails is an idea. Don't know how much boiler-plate code that requires, though. But once in place it will be handy for other react component related tests.

This repo started with unit tests, but we are improving. Oh, no test config there yet for the react-comp only for the wrapper package. I will start the ground work.

cdietrich commented 1 year ago

might also be fixed by newer versions already

Bildschirmfoto 2023-08-31 um 11 21 36
kaisalmen commented 1 year ago

TypeFox/monaco-languageclient#622 tracks the creation of unit tests for monaco-editor-react.

kaisalmen commented 5 months ago

@cdietrich should I transfer this to the other repo? Is it still applicable?

kaisalmen commented 5 months ago

Closing this here. Feel free to open a new issue here: https://github.com/TypeFox/monaco-languageclient if required.