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

lintr session does not load init file #40

Closed
adamaltmejd opened this issue Dec 28, 2017 · 4 comments
Closed

lintr session does not load init file #40

adamaltmejd opened this issue Dec 28, 2017 · 4 comments

Comments

@adamaltmejd
Copy link

Hey,

I have a ~/.Rprofile file that among other things contains .libPaths("~/.R/packages"). Saving all packages in a user-defined library. This is useful for many reasons, and most things in vscode-R work well as long as I change the main startup settings to not include "vanilla":

"r.rterm.option": ["--no-save"]

But it seems that the R session that lints code is still loaded using the vanilla option since vscode-R keeps nagging me about the linter not being installed each time I save an .R file, even if the lintr library is loaded in the console. Trying to install things in the default directory doesn't work properly when R is installed with Homebrew (probably due to this issue: Homebrew/homebrew-core#17098). But even if it would, the "install lintr" command executes install.packages("lintr") to my own library so after a successful install, it still cannot find the package.

According to man R:

       --vanilla
              Combine  --no-save, --no-restore, --no-site-file, --no-init-file
              and --no-environ

Why do you need to run --no-site-file, --no-init-file and --no-environ? My suggestion would be to default to only --no-save and --no-restore, for both the lintr session and the console session.

  • VSCode Version: Code 1.19.1 (0759f77bb8d86658bc935a10a64f6182c5a1eeba, 2017-12-19T09:35:14.671Z)
  • OS Version: Darwin x64 17.3.0
  • Extensions:
Extension Author (truncated) Version
bracket-pair-colorizer Coe 0.10.14
vscode-markdownlint Dav 0.12.0
vsc-material-theme Equ 1.1.2
gc-excelviewer Gra 2.0.16
r Iku 0.5.2
latex-workshop Jam 3.10.1
code-settings-sync Sha 2.8.7
path-intellisense chr 1.4.2
python ms- 0.9.1
sublime-keybindings ms- 3.0.3
vscode-icons rob 7.19.0
markdown-preview-enhanced shd 0.3.1
code-spell-checker str 1.6.2
code-spell-checker-swedish str 0.1.1

@Ikuyadeu
Copy link
Member

Ikuyadeu commented Dec 31, 2017

@adamaltmejd Thank you for your good idea!
Before the change is not for many R users.
First, I'll try to"r.rterm.option": [--no-site-file, --no-init-file, --no-environ].
Is it OK?

@adamaltmejd
Copy link
Author

Hi! Thanks!

I would let r.term.option default to "r.rterm.option": ["--no-save", "--no-restore", "--no-site-file"] to allow for environmental variables and user Rprofile to influence the session. But this option does not affect the session in which the lintr is loded is it? Either one could let r.term.option also govern the startup options for the lintr session, or you could just hardcode the startup of the lintr to not use R --no-save --no-restore --no-site-file.

Thanks for your great work, almost wanting to drop iTerm for this extension :).

@Ikuyadeu
Copy link
Member

@adamaltmejd Thank you and sorry my late reply.
Now version is used for your recommended settings

@adamaltmejd
Copy link
Author

Excellent, thanks!

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

No branches or pull requests

2 participants