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.previewHtml depricated #17

Closed
sarabkohli29 opened this issue Apr 11, 2019 · 12 comments
Closed

vscode.previewHtml depricated #17

sarabkohli29 opened this issue Apr 11, 2019 · 12 comments
Labels

Comments

@sarabkohli29
Copy link

sarabkohli29 commented Apr 11, 2019

While trying to open annotater from the vscode command prompt on vscode Version 1.33.0 (1.33.0), the annotater is not able to open the diff file and ends upthrowing a console error
Screen Shot 2019-04-10 at 8 54 05 PM

Reading the vscode docs, it mentions that the vscode.previewHtml has been completely been depricated here microsoft/vscode#62630 in the March/April release and instead the webview api should be used. https://code.visualstudio.com/api/extension-guides/webview

I am on MacOS Mojave version 10.14.4 MBP-15 2018 version

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 12, 2019

Thanks @sarabkohli29 for reporting it and sorry for the inconvenience.
I guess Annotator is not very popular Git blame plugin anymore and people are using other options. Maybe you want to check them on Code's marketplace.

https://marketplace.visualstudio.com/search?term=git%20blame&target=VSCode&category=All%20categories&sortBy=Relevance

Meanwhile, I'll fix this issue when I find a time.

@ryu1kn ryu1kn added the bug label Apr 12, 2019
@timwaddell
Copy link

This is my favourite blame tool .. nothing else gives a complete file overview
Would be great if this was fixed :)

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 24, 2019

I need to do something like this change I made for my other extension.

ryu1kn/vscode-extension-update-reporter@2d80e7e

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 24, 2019

When I hit Annotator command, it doesn't show an error popup dialog, it just gets logged on the dev-tool console as @sarabkohli29 kindly posted the screenshot... If there's no error popup, it's confusing :(

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 24, 2019

Does WebView panel not support command: link like below? Do I have to replace this with other mechanism? 😑

<a href="command:annotator.takeDiff?%5B%7B...">12  2018-12-24 Ryuichi Inagaki</a>

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 24, 2019

@sarabkohli29
Copy link
Author

Wow, it's coming together. Seems like you already got most of the things. Thank you for fixing this. I was about try my first open source PR to make those changes, but since I am new to this, I wasn't able to fully grasp the API. Seems you've figured out all the things needed. Just to mention, webview api should be able to support HTML, so the <a> links should technically work if the panel.webview.html contains those links, but after looking at your comment above, I think it might have some issues.

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 25, 2019

Hi @sarabkohli29 ! Wow, I didn't know that you were considering to fix this, thank you 😊 I've already started this one, but if there are other things, your help is much appreciated!

Re webview panel, yes, that's what I thought too. I played with <a> last night for a while. If I put a link to google website, I could open the site by clicking annotation, but it didn't work if I put a command:annotator.takeDiff command as I was doing in previewHtml.

@ryu1kn
Copy link
Owner

ryu1kn commented Apr 25, 2019

Oops, my bad! It's actually I just have to pass enableCommandUris: true on creating a WebView panel!

https://code.visualstudio.com/api/references/vscode-api#WebviewOptions

ryu1kn added a commit that referenced this issue Apr 25, 2019
This reverts following commits:

cdfe8c7: "[#17] Invoke a command on receiving it from the webview"
cec97cc: "[#17] WIP. Passing command back to the extension"
@ryu1kn
Copy link
Owner

ryu1kn commented Apr 25, 2019

Thank you @sarabkohli29 and @timwaddell for reporting this! and sorry for the inconvenience caused! The fix is released as v0.11.1 🎉

@ryu1kn ryu1kn closed this as completed Apr 25, 2019
@sarabkohli29
Copy link
Author

Actually, thank you @ryu1kn for fixing this! :)

ryu1kn added a commit that referenced this issue Apr 25, 2019
This reverts commit ea79f28.

Use WebView's postMessage to send control back to extension
@timwaddell
Copy link

thank you :)

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

No branches or pull requests

3 participants