Skip to content

Conversation

@ElianHugh
Copy link
Collaborator

Make knitting sessions use the current workspace folder as cwd, so that .Rprofile is respected. Closes #800.

How can I check this pull request?

  1. Create a project with renv.
  2. Try (and fail) to preview/knit a document.
  3. Install rmarkdown
  4. Successfully preview/knit the document

...scriptArgs
}
},
cwd: vscode.workspace.workspaceFolders[0].uri.fsPath
Copy link
Member

@renkun-ken renkun-ken Sep 30, 2021

Choose a reason for hiding this comment

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

Maybe we should use the workspace folder of the rmd file (workspace.getWorkspaceFolder(document.uri)) to knit so that multi-root workspace is supported?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right! Thanks!

@renkun-ken renkun-ken marked this pull request as ready for review October 7, 2021 02:39
@renkun-ken renkun-ken merged commit 587bc53 into REditorSupport:master Oct 7, 2021
ElianHugh added a commit to ElianHugh/vscode-R that referenced this pull request May 12, 2022
* Respect cwd

* Start knit process from knitWorkingDirectory

* Refine getKnitDir

Co-authored-by: Kun Ren <[email protected]>
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

Successfully merging this pull request may close these issues.

Smart Knit does not respect .RProfile / {renv}

2 participants