Theia: [vscode] support CustomEditor API

Created on 26 Nov 2019  路  22Comments  路  Source: eclipse-theia/theia

Description

It can be tested with @theia/vscode-builtin-image-preview@latest.

Allows to preview images of such formats:

  • *.jpg, *.jpe, *.jpeg
  • *.png
  • *.bmp
  • *.gif
  • *.ico
  • *.tga
  • *.webp
root ERROR [hosted-plugin: 5438] Unsupported activation events: onWebviewEditor:imagePreview.previewEditor, please open an issue: https://github.com/eclipse-theia/theia/issues/new
root ERROR [hosted-plugin: 5438] vscode.image-preview extension will be activated eagerly.
root INFO [hosted-plugin: 5438] PLUGIN_HOST(5438): PluginManagerExtImpl/loadPlugin(/home/tolusha/projects/theia-ide/theia/plugins/dir_vscode-builtin-image-preview-0.3.0-next.db32534bf1.tgz/dist/extension)
root ERROR [hosted-plugin: 5438] Error on activation of image-preview TypeError: s.window.registerWebviewEditorProvider is not a function
    at t.activate (/home/tolusha/projects/theia-ide/theia/plugins/dir_vscode-builtin-image-preview-0.3.0-next.db32534bf1.tgz/dist/extension.js:1:7770)
    at PluginManagerExtImpl.<anonymous> (/home/tolusha/projects/theia-ide/theia/packages/plugin-ext/lib/plugin/plugin-manager.js:460:87)
    at step (/home/tolusha/projects/theia-ide/theia/packages/plugin-ext/lib/plugin/plugin-manager.js:47:23)
    at Object.next (/home/tolusha/projects/theia-ide/theia/packages/plugin-ext/lib/plugin/plugin-manager.js:28:53)
    at fulfilled (/home/tolusha/projects/theia-ide/theia/packages/plugin-ext/lib/plugin/plugin-manager.js:19:58)
plug-in system vscode webviews

Most helpful comment

@hansbank we are working on it. Hopefully @danarad05 can create initial PR for review next week.

All 22 comments

VS Code team is working on new API: Webview Editor. But it is very raw, unstable and not completely implemented. I would prefer to wait till it is stabilized and complete, and only after align with it. Before it we have to find a version of extension which does not use registerWebviewEditorProvider

Before it we have to find a version of extension which does not use registerWebviewEditorProvider

Ah, this extension was added to prototype webview editors. So there is no such version which we can use.

Adding a link to the proposed API (at the time of writing this comment it looks to be planned for their February 2020 release): https://github.com/microsoft/vscode/issues/77131#issuecomment-567743066

I'm wondering if we should stub the API for the moment, until the proposed API has been approved.

@vince-fugnitto would it make an extension work? I doubt

@vince-fugnitto would it make an extension work? I doubt

I doubt it too, I was wondering if we should stub only so that we can add such builtins (latest) without the worry it may have some side-effects.

@vince-fugnitto not sure what you mean by side effects, if a built-in does not work we should not add it without fixing

@vince-fugnitto not sure what you mean by side effects, if a built-in does not work we should not add it without fixing

I may just be overthinking it but I was thinking that perhaps a builtin might work partially (everything besides WebviewEditor functionality) and may be useful to add (external extensions may use or refer to such builtins). I thought maybe stubbing those areas until the proposed API is approved might be a workaround.

We should try for sure and see, but i don't want to port each bug and experiment from VS Code to Theia just to support 1-2 extensions each month. Don't think it is an effort well spent.

But generally yes we should try which latest builtins work and migrate to them and if not collect bugs and reevaluate after each release whether we should take actions on already on them.

We should try for sure and see, but i don't want to port each bug and experiment from VS Code to Theia just to support 1-2 extensions each month. Don't think it is an effort well spent.

But generally yes we should try which latest builtins work and migrate to them and if not collect bugs and reevaluate after each release whether we should take actions on already on them.

Sounds good! I was likely just thinking out loud 馃檲

Not urgent yet, but the python extension already has a mode in which it makes use of custom editors.

@akosyakov @vince-fugnitto
Any idea when this will be implemented in Theia, are the plans for that already?
Markdown and python plugin face issues now.
We faced the same issue as well with another custom plugin.

We have not planed anything yet. But this issue indeed become important. The current goal is to get proper VS Code fs API support and simplify integration of new Monaco editor. That's enough work till August, so maybe in Autumn given the summer break.

Python extension uses CustomEditor API for rendering Jupyter Notebooks.

Some related references:

We'll start working on it most likely by the end of June.

fyi: we have to postpone this work for some time

@azatsarynnyy is someone working on this item or we can take it?

@amiramw you can take it as we won't be able to look at it for the next 1-2 month

Thanks @amiramw for picking-up this one - I hope we're able to include your merged PR in next month's release.

@amiramw , will your work also include the implementation of registerCustomEditorProvider ?

@amiramw , will your work also include the implementation of registerCustomEditorProvider ?

Yes, It will

Hi @azatsarynnyy , I see this topic has been removed from 1.9.0 milestone. Is there a new milestone set when we can expect this? Is there probably already a version available we can try?
Thank you

@hansbank we are working on it. Hopefully @danarad05 can create initial PR for review next week.

Was this page helpful?
0 / 5 - 0 ratings