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

Extend View #161

Merged
merged 14 commits into from Jan 13, 2020
Merged

Extend View #161

merged 14 commits into from Jan 13, 2020

Conversation

renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Dec 24, 2019

What problem did you solve?

Closes #160
Closes #162
Closes #51
Closes #175

Screenshot

View(globalenv())

image

View(lm)

image

View(rnorm(100))

image

m <- summary(lm(mpg ~ ., data = mtcars))
View(m)

image

?rnorm

image

Use FixedHeader in View(data.frame)

image

@renkun-ken renkun-ken changed the title Support View(environment) Extend View Dec 26, 2019
@renkun-ken renkun-ken changed the title Extend View WIP: Extend View Dec 26, 2019
@renkun-ken renkun-ken changed the title WIP: Extend View Extend View Dec 26, 2019
@vnijs
Copy link

vnijs commented Dec 30, 2019

This is really nice!

Question: Is there a reason why init.R is put into ~/.vscode-R/ and not into ~/.vscode/vscode-R/ ?

@vnijs
Copy link

vnijs commented Dec 30, 2019

Related to View (and shiny apps) in VSCode, if you go another tab (i.e., the WebView is hidden), state information is lost. As an example, open help for ?rnorm, scroll down, switch to another tab, and then back to the WebView. You will see it "reopen" the page and the information about where you were on the page is lot.

I think this could be resolved by setting retainContextWhenHidden (see links below).

https://code.visualstudio.com/api/extension-guides/webview#retaincontextwhenhidden
https://code.visualstudio.com/api/extension-guides/webview#getstate-and-setstate

Recent issue that mentions window.localStorage:

microsoft/vscode#82597 (comment)

@renkun-ken
Copy link
Member Author

renkun-ken commented Dec 30, 2019

@vnijs Yes, now all WebViews are open with retainContextWhenHidden turned on. I was conservative about the resource usage when this is turned on but I test with large WebView and it looks okay.

@renkun-ken
Copy link
Member Author

Question: Is there a reason why init.R is put into ~/.vscode-R/ and not into ~/.vscode/vscode-R/ ?

No specific reason for that. If ~/.vscode/vscode-R looks nicer and is typical for vscode extensions to store file on user machine, we may switch to it too. The only difference at the moment is that it is shorter.

@vnijs
Copy link

vnijs commented Dec 30, 2019

I'm not sure what is typical but it seems like a good idea to try and limit the number of dot files. There are so many in my home directory already :-)

@iainmstott
Copy link

This works really well for me! Great work. Really like the addition of the hover and View() functionality. Awesome!

One thing I'd note is that for whatever reason, I did need to restart VSCode twice to get it working. Don't know why. After the first restart, nothing happened after running the commands. But now it's working exactly as expected.

@renkun-ken
Copy link
Member Author

renkun-ken commented Jan 8, 2020

@Ikuyadeu @andycraig This PR is a LGTM. Please take a look.

@andycraig
Copy link
Collaborator

@renkun-ken @Ikuyadeu This is great! It all works fine for me on Windows 10.

@Ikuyadeu
Copy link
Member

@renkun-ken Thank you for the pull request.
@andycraig Thank you for reviewing.

@Ikuyadeu Ikuyadeu merged commit 458a292 into REditorSupport:master Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants