GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve session watcher initialization by renkun-ken · Pull Request #184 · REditorSupport/vscode-R

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Jan 10, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Closes #196.
Related to #177, #179.

In this PR:

  • Use USERPROFILE for Windows according to os: add homedir() nodejs/node#1791: https://github.com/nodejs/node/pull/1791/files#diff-d9bb084c9b6137788ddd0314b2e4df6dR11.
  • Clarify when a local .Rprofile exists.
  • Use R_PROFILE_USER as @randy3k suggests so that there's no need for manual configuration if users starts R session using R: Create R Terminal command.
  • init.R checks TERM_PROGRAM=vscode so that it is only effective in VSCode terminal.
  • Update README.md to cover basic usage, advanced usage and how to disable session watcher.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
andycraig
andycraig reviewed Jan 10, 2020
View reviewed changes

@andycraig andycraig left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for switching it to USERPROFILE!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@renkun-ken
renkun-ken requested review from Ikuyadeu and andycraig January 16, 2020 03:37
@renkun-ken renkun-ken mentioned this pull request Jan 16, 2020
no code highlight in terminal #190
Closed
@randy3k

randy3k commented Jan 19, 2020

Copy link
Copy Markdown
Member

Alternatively, one could make use of the env variable R_PROFILE_USER that points to a vscode generated .Rprofile. For example, vscode-R could generate ~/.vscode-R/.Rprofile and set R_PROFILE_USER to it in the integrated terminal.

# ~/.vscode-R/.Rprofile

if (file.exists(".Rprofile")) {
	source(".Rprofile")
} else if (file.exists(normalizePath("~/.Rprofile"))) {
	source("~/.Rprofile")
}

if (<init.R has not been execuated>) {
	source(file.path(Sys.getenv(if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), ".vscode-R", "init.R"))
}

This approach would require zero configuration for R sessions launched by vscode-R. Only if a user wants to use session watcher in external R processes, they would have to edit the .Rprofile.

renkun-ken reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@randy3k randy3k mentioned this pull request Jan 20, 2020
More robust session watcher initialization #196
Closed
@renkun-ken
renkun-ken force-pushed the update-readme branch from ccb580e to 8963e39 Compare January 21, 2020 04:31
@renkun-ken

renkun-ken commented Jan 21, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Thanks @randy3k for your great suggestion. With this PR, user won't have to do any manual configuration if user only starts R session via R: Create R Terminal command.

Now, only users who want to use R session watcher with self-managed R session will have to do some extra configuration. Let me update the README to reflect all these changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

randy3k
randy3k reviewed Jan 21, 2020
View reviewed changes
Comment thread src/rTerminal.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@renkun-ken renkun-ken changed the title Update session watcher section in README.md Improve session watcher initialization Jan 21, 2020
@andycraig

andycraig commented Jan 24, 2020

Copy link
Copy Markdown
Collaborator

@renkun-ken This PR is now conflicted with master. Would you be able to resolve that and then I'll merge it? Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

renkun-ken added 11 commits January 24, 2020 16:51
@renkun-ken
Update session watcher section in README.md
9107d9b
@renkun-ken
Update README.md
ac91a39
@renkun-ken
Update README.md
9c29090
@renkun-ken
Update README.md
fc13c71
@renkun-ken
Add link and short description of radian
7ed6c06
@renkun-ken
Use R_PROFILE_USER
3f600c1
@renkun-ken
init.R only work with TERM_PROGRAM=vscode
54c5f10
@renkun-ken
Update README.md
c4b1e88
@renkun-ken
Respect existing R_PROFILE_USER
8a07532
@renkun-ken
Update README.md
9bd4ab5
@renkun-ken
Update README.md
75a5edd
@renkun-ken
renkun-ken force-pushed the update-readme branch from 123df40 to 75a5edd Compare January 24, 2020 08:54
@renkun-ken

renkun-ken commented Jan 24, 2020

Copy link
Copy Markdown
Member Author

@andycraig Conflicts resolved. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andycraig
andycraig merged commit 625ae35 into REditorSupport:master Jan 24, 2020
@andycraig

andycraig commented Jan 24, 2020

Copy link
Copy Markdown
Collaborator

@renkun-ken Great, thanks again!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@randy3k randy3k randy3k left review comments
@andycraig andycraig Awaiting requested review from andycraig
@Ikuyadeu Ikuyadeu Awaiting requested review from Ikuyadeu

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

More robust session watcher initialization

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@renkun-ken @randy3k @andycraig
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.