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

Use of WebviewEditorInset #3

Closed
marisancans opened this issue Jun 14, 2020 · 2 comments
Closed

Use of WebviewEditorInset #3

marisancans opened this issue Jun 14, 2020 · 2 comments

Comments

@marisancans
Copy link
Contributor

Hey there. For the last few days I have been experimenting with something called WebView. It essentially allows HTML rendering inside vscode.
There have been many requests over the years for vscode community to allow inline WebView render into editor.
Here is something similar to what we want: microsoft/vscode#41775
VScode has added and merged a code inset feature here: microsoft/vscode#66418
And here is their progress for WebviewEditorInset API: microsoft/vscode#85682

There is however a drawback at this moment:

  1. WebviewEditorInset is a proposed API, meaning that I don't know if this can be used is its not officially into vscode. It is like an experimental feature. But i'm pretty sure they will implement this after half a year or year (yeah, that a lot), but this has been a really requested feature and they also need it for julia lanuguage extension and jupyter notebooks.
  2. Current solution requires to copy a vscode.proposed.d.ts file for this to work
  3. VS Code insiders edition is also required for this

Heres a demo that I have managed to get working:
simplescreenrecorder-2020-06-14
There are a lot of work to be done here, but I think it looks cool.

Also, you mentioned that you have to create a /tmp directory for this, check out what storagePath is in vscode.ExtensionContext in https://code.visualstudio.com/api/references/vscode-api#ExtensionContext
I am using this directory instead of /tmp, it looks like this: /home/maris/.config/Code - Insiders/User/workspaceStorage/RANDOM-HASH/johnguo.simply-view-image-for-python-opencv-debugging/

Is this the direction we can shift instead of opening images into a new pane? We can also try to combine them, or make this as a separate experimental branch.

@marisancans
Copy link
Contributor Author

Can you create a new branch called 'inline-render' so I can put the demo there?

@john-guo
Copy link
Owner

The purpose of this extension is every using python-OpenCV vscode user could watch image quickly and simply. It's for every vscode user not only experiment user.

About the temporary files, I think it's ok to use the storage path. But in my system, the temporary path is mapping to a memory driver, It's much faster than any other path. I will add an option to choose which path (temp or storage) to save later.

And last I will create a branch called 'inline-render'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants