Editor in DockWidget


I am trying to write an extension and again hitting really hard wall.

I’ve managed to register command that opens dock panel with two editors inside. Everything is fine until I start writing in editors. They additionally show up on main tab bar. And when I close them from main bar all contents are gone from dockpanel as well.
Editors are only for in memory edits. I want to have first editor as input for REST call, and second one should be response (I’ve figured out how to do call and write response into editor executing edits).
Preferably I would like second editor to be not editable by user.
Removing code minimap would be a bonus as well.

I am creating editors with their widgets using EditorWidgetFactory

Would appreciate some hints, since I tried already glimpsing through a lot of code.
I’ve tried to take diff editor as an example, but I am completely lost there.

I’ve changed approach and was able to achieve what I needed.

For reference:
I’ve added WidgetOpenHandler since I wanted to tie my widget with specific file type.
I’ve implemented my own MonacoEditorFactory (with intention of providing my own options) and MonacoEditorModelFactory (with intention of overriding setDirty) with own Resource and ResourceResolver - all bound under common scheme. Not sure if this is best way to go, but was able to achieve what I needed :slight_smile:

1 Like