microsoft / RTVS

R Tools for Visual Studio.
MIT License
390 stars 118 forks source link

str_view output contained to Visual Studio rather than external browser? #4283

Closed sadukie closed 6 years ago

sadukie commented 6 years ago

Please briefly describe what you were doing that led to the issue, if applicable:

As I go through some R lessons on DataCamp, I am keeping notes in an R notebook in Visual Studio. Going through a lesson using stringr, and we're using str_view to preview patterns. Output is currently appearing in an external browser.

Sample R code:

library(stringr)
x <- "Normal(\u03BC = 0, \u03C3 = 1)"
x
str_view(x, pattern="\u03BC")

Output: image

The URL it loads is: http://127.0.0.1:63640/C:/Users/saduk/AppData/Local/Temp/RtmpoNC4Eu/viewhtml369025bd3b21/index.html

Not sure if this is possible (as I don't know the underworkings), but is it possible for str_view() to open within Visual Studio (much like the help window and plots window) rather than an external window?

Other details:

...

Additional information:

OS Information Version: Microsoft Windows NT 10.0.17093.0

RTVS Information: Assembly: Microsoft.VisualStudio.R.Package, Version=1.3.31108.1213, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Active R URI: Microsoft R Server (3.3.3.24): C:\Program Files\Microsoft SQL Server\140\R_SERVER\

MikhailArkhipov commented 6 years ago

Try this option

image

However, remember that VS internal browser is not HTML5 compliant (it is IE11 engine and not Edge). So modern rendering and JavaScript may not work.

sadukie commented 6 years ago

Tried with these settings: image

But still loading in an external browser window: image

This is what my R Interactive shows: image

MikhailArkhipov commented 6 years ago

Try changing R Help browser to external as well. But generally I wouldn't recommend internal VS browser. It is being deprecated from the IDE anyway.

sadukie commented 6 years ago

Changing the R Help browser to External confirmed that str_view is indeed still using an external browser instead of the internal browser. If the internal browser is being deprecated from the IDE, then it doesn't seem worth it to figure this out.

Though this is a rough user experience when I have to keep flipping between VS for the code and the external browser for the output. Is the internal browser the only way of visualizing HTML output in VS?

sadukie commented 6 years ago

Talking with @jflam at MVP Summit, this might have to deal with how the library itself was written. Since the internal browser is going the route of deprecated and since that probably would've been the ideal approach, I'm fine closing this. Thanks, @MikhailArkhipov, for talking with me through this as well!