Replies: 0 comments 3 replies
-
@cdietrich sorry, I forgot to answer this. Didn't do it immediately and zoom a week passed by. First, I would look at the problem without considering react and think about how it could be realized directly. You could create a A good source of inspiration what actually can be done with the underlying monaco-vscode-api you get here: https://codingame.github.io/monaco-vscode-api/ |
Beta Was this translation helpful? Give feedback.
-
hmmm i still cant wiggle my head around this. isnt the RegisteredFileSystemProvider a pure client thing?
does this mean i have to i also wonder why the onLoad callback does not have a callback paramter to e.g. the wrapper or the component itself |
Beta Was this translation helpful? Give feedback.
-
in my current approach the https://github.com/cdietrich/my-monaco-editor-react-example/tree/cd_referencingOtherFiles |
Beta Was this translation helpful? Give feedback.
-
Considerations on having more that one document in workspace in react/wrapper usecase
We have the following usecase:
Right now we do the following
This works fine until we want to exchange the to be edited file along with its other files in react.
If the component is not remounted, then the componentDidUpdate call wont reinit monaco as before and after we just have a worker
thus we cannot plugin a new worker
we currently circumvent this problem by passing a key to the component to force remount
i am thinking about what could be done to make this nicer or more generic
instead of using workspaceMgr and builtin files we could use lsp didOpen calls to open multiple files. if the protocol works fine they all should end up in the same ws and visibile to each other (did not test that yet), but this also would require a hook in the component or a prop to pass multiple resources
we at least could make the current approach more robust by adding a prop to force remount on componentDidUpdate
do you have more ideas or hints? Thanks
Beta Was this translation helpful? Give feedback.
All reactions