Is your feature request related to a problem? Please describe.
I find it frustrating to have to continually jump to the R window and type `rmarkdown::render("filename.Rmd") when developing an R markdown file.
Describe the solution you'd like
A command that works like runSource, except it knits the current file.
I don't know anything about developing VS code plugins, but here's a stab at a function that might work? I just copied runSource, changed source and removed setFocus.
function knitSource(echo: boolean) {
const wad = window.activeTextEditor.document;
wad.save();
let rPath = ToRStringLiteral(wad.fileName, '"');
let encodingParam = config.get("source.encoding") as string;
if (encodingParam) {
encodingParam = `encoding = "${encodingParam}"`;
rPath = [rPath, encodingParam].join(", ");
}
if (echo) {
rPath = [rPath, "echo = TRUE"].join(", ");
}
if (!rTerm) {
const success = createRTerm(true);
if (!success) { return; }
}
rTerm.sendText(`rmarkdown::render(${rPath})`);
}
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
I find it frustrating to have to continually jump to the R window and type `rmarkdown::render("filename.Rmd") when developing an R markdown file.
Describe the solution you'd like
A command that works like
runSource, except it knits the current file.I don't know anything about developing VS code plugins, but here's a stab at a function that might work? I just copied
runSource, changedsourceand removedsetFocus.Describe alternatives you've considered
N/A
Additional context
N/A