Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] support CustomEditor API #6636

Closed
tolusha opened this issue Nov 26, 2019 · 25 comments · Fixed by #8910
Closed

[vscode] support CustomEditor API #6636

tolusha opened this issue Nov 26, 2019 · 25 comments · Fixed by #8910
Assignees
Labels
plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility webviews issues related to webviews

Comments

@tolusha
Copy link
Contributor

tolusha commented Nov 26, 2019

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)
@tolusha tolusha added bug bugs found in the application vscode issues related to VSCode compatibility labels Nov 26, 2019
@akosyakov
Copy link
Member

akosyakov commented Nov 26, 2019

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

@akosyakov
Copy link
Member

akosyakov commented Nov 26, 2019

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.

@akosyakov akosyakov changed the title @theia/vscode-builtin-image-preview@latest does not work [vscode] support webview editors Nov 26, 2019
@akosyakov akosyakov added the webviews issues related to webviews label Nov 26, 2019
@vince-fugnitto
Copy link
Member

Adding a link to the proposed API (at the time of writing this comment it looks to be planned for their February 2020 release): microsoft/vscode#77131 (comment)

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

@akosyakov
Copy link
Member

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

@vince-fugnitto
Copy link
Member

@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.

@akosyakov
Copy link
Member

@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
Copy link
Member

@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.

@akosyakov
Copy link
Member

akosyakov commented Jan 29, 2020

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.

@vince-fugnitto
Copy link
Member

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 🙈

@akosyakov
Copy link
Member

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

@akosyakov
Copy link
Member

This API was finalised in VS Code: https://code.visualstudio.com/api/extension-guides/custom-editors

@cbos
Copy link

cbos commented Jun 17, 2020

@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.

@akosyakov
Copy link
Member

akosyakov commented Jun 17, 2020

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.

@akosyakov akosyakov added the help wanted issues meant to be picked up, require help label Jun 18, 2020
@azatsarynnyy azatsarynnyy added Team: Che-Editors issues regarding the che-editors team and removed bug bugs found in the application help wanted issues meant to be picked up, require help labels Jun 22, 2020
@azatsarynnyy
Copy link
Member

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.

@azatsarynnyy
Copy link
Member

fyi: we have to postpone this work for some time

@amiramw
Copy link
Member

amiramw commented Oct 28, 2020

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

@azatsarynnyy
Copy link
Member

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

@azatsarynnyy azatsarynnyy added plug-in system issues related to the plug-in system and removed Team: Che-Editors issues regarding the che-editors team labels Oct 28, 2020
@amiramw amiramw self-assigned this Oct 29, 2020
@marcdumais-work
Copy link
Contributor

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

@hansbank
Copy link

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

@EstherPerelman
Copy link
Contributor

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

Yes, It will

@azatsarynnyy azatsarynnyy removed this from the 1.9.0 milestone Dec 2, 2020
@hansbank
Copy link

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

@amiramw
Copy link
Member

amiramw commented Dec 23, 2020

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

@danarad05
Copy link
Contributor

@tolusha @akosyakov @vince-fugnitto @hansbank @azatsarynnyy @amiramw @marcdumais-work @benoitf @cbos @hallvard

FYI, created PR for this issue. Anyone interested in reviewing is welcome.

@hansbank
Copy link

Hi @danarad05 ,
We have tried the custom editor api for our own editor, and that works as expected. Thank you!
When can we expect this to be merged into theia master?

@danarad05
Copy link
Contributor

Hi @hansbank
Thanks for testing it out. If you are a reviewer then you can review it.
Currently no one has yet to review this PR so I cannot estimate when it will be merged.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility webviews issues related to webviews
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants