REditorSupport / vscode-R

R Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=REditorSupport.r
MIT License
1.08k stars 127 forks source link

Documentation from devtools-loaded package opens in web browser #1170

Open david-cortes opened 2 years ago

david-cortes commented 2 years ago

Steps to reproduce:

Expected behavior: should show me the documentation in the top-right pane, same as it does for documentation of functions from installed packages.

Actual behavior: launches a web browser to view the documentation, and it's not even the default web browser that I have configured in my system.

mihaiconstantin commented 1 year ago

Also experiencing this. For whatever reason, doing a devtools::install() followed by calling ?the_function seems to work.

Also, this is the console output:

?the_function
ℹ Rendering development documentation for "the_function"
VSCode WebView has restricted access to local file.
Opening in external browser...
Browsing file:///private/var/folders/v9/yftkgjms78qdx9vz7mll88mw0000gn/T/RtmpyBFX7Z/.R/doc/html/the_function.html

Could it be that after installing the package, the documentation is loaded from a place that VS Code has access to? Perhaps it doesn't have access to the temporary folders?

Potentially related to the section on Controlling access to local resources and the following lines: https://github.com/REditorSupport/vscode-R/blob/7dbd9338916d61e925cc4177321597a02aa59564/R/session/vsc.R#L702-L715

bguillod commented 1 year ago

I'm also experiencing this issue. Is there any solution?

gowerc commented 1 year ago

Also just wanted to add that I am experiancing this issue:

> ?link_gsf_dsld
ℹ Rendering development documentation for "link_gsf_dsld"
VSCode WebView has restricted access to local file.
Opening in external browser...
Browsing file:///private/var/folders/hs/gyg0q5g94pz917klnkg7tnt80000gq/T/RtmpzzJB9H/.R/doc/html/link_gsf_dsld-class.html

@renkun-ken - Is there any simple solution for this on the user end like being able to grant access to temporary directories ?

yonicd commented 9 months ago

similar issue. is there a way to tell vscode that these types of local files are ok to open in the editor?