File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed
Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,30 @@ if (!requireNamespace("rmarkdown", quietly = TRUE)) {
44}
55
66# get values from extension-set env values
7+ # Hiding values is necessary to prevent their accidental removal
8+ # See: https://github.com/REditorSupport/vscode-R/issues/860
9+ attach(
10+ local({
11+ .vsc.knit_dir <- Sys.getenv(" VSCR_KNIT_DIR" )
12+ .vsc.knit_lim <- Sys.getenv(" VSCR_LIM" )
13+ .vsc.knit_command <- Sys.getenv(" VSCR_KNIT_COMMAND" )
14+ environment()
15+ }),
16+ name = " tools:vscode" ,
17+ warn.conflicts = FALSE
18+ )
719
8- knit_dir <- Sys.getenv(" VSCR_KNIT_DIR" )
9- lim <- Sys.getenv(" VSCR_LIM" )
10- knit_command <- Sys.getenv(" VSCR_KNIT_COMMAND" )
1120
1221# set the knitr chunk eval directory
1322# mainly affects source calls
14- if (nzchar(knit_dir )) {
15- knitr :: opts_knit [[" set" ]](root.dir = knit_dir )
23+ if (nzchar(.vsc. knit_dir )) {
24+ knitr :: opts_knit [[" set" ]](root.dir = .vsc. knit_dir )
1625}
1726
1827# render and get file output location for use in extension
1928cat(
20- lim ,
21- eval(parse(text = knit_command )),
22- lim ,
29+ .vsc.knit_lim ,
30+ eval(parse(text = .vsc. knit_command )),
31+ .vsc.knit_lim ,
2332 sep = " "
2433)
You can’t perform that action at this time.
0 commit comments