@@ -377,8 +377,8 @@ class PreviewManager {
377
377
}
378
378
379
379
private usesQuartoServeCommand ( doc ?: TextDocument ) {
380
- return isQuartoShinyKnitrDoc ( this . engine_ , doc ) ||
381
- ( isQuartoShinyDoc ( this . engine_ , doc ) && semver . lte ( this . quartoContext_ . version , "1.4.414" ) ) ;
380
+ return isQuartoShinyKnitrDoc ( this . engine_ , doc ) ||
381
+ ( isQuartoShinyDoc ( this . engine_ , doc ) && semver . lte ( this . quartoContext_ . version , "1.4.414" ) ) ;
382
382
}
383
383
384
384
private previewRenderRequest ( doc : TextDocument , format : string | null ) {
@@ -414,7 +414,7 @@ class PreviewManager {
414
414
}
415
415
416
416
private async killPreview ( ) {
417
- await killTerminal ( kPreviewWindowTitle , async ( ) => await this . previewTerminateRequest ( ) ) ;
417
+ await killTerminal ( kPreviewWindowTitle , async ( ) => await this . previewTerminateRequest ( ) ) ;
418
418
this . progressDismiss ( ) ;
419
419
this . progressCancellationToken_ = undefined ;
420
420
}
@@ -466,7 +466,7 @@ class PreviewManager {
466
466
467
467
// create base terminal command
468
468
const cmd = terminalCommand ( useServeCommand ? "serve" : "preview" , this . quartoContext_ , target ) ;
469
-
469
+
470
470
// extra args for normal docs
471
471
if ( ! useServeCommand ) {
472
472
if ( ! doc ) {
@@ -483,8 +483,17 @@ class PreviewManager {
483
483
484
484
// use temp output-dir for R package
485
485
if ( isRPackageWorkspace && this . previewRPackageDirConfig ( ) ) {
486
- cmd . push ( "--output-dir" , tmp . dirSync ( ) . name ) ;
487
- cmd . push ( "--embed-resources" ) ;
486
+ const rPkgRequiredVersion = "1.5.39" ;
487
+ if ( semver . gte ( this . quartoContext_ . version , rPkgRequiredVersion ) ) {
488
+ cmd . push ( "--output-dir" , tmp . dirSync ( ) . name ) ;
489
+ cmd . push ( "--embed-resources" ) ;
490
+ } else {
491
+ window . showWarningMessage (
492
+ `Rendering requires Quarto version ${ rPkgRequiredVersion } or greater` ,
493
+ { modal : true }
494
+ ) ;
495
+ return ;
496
+ }
488
497
}
489
498
490
499
// send terminal command
@@ -698,7 +707,7 @@ class PreviewManager {
698
707
}
699
708
700
709
private zoomLevel ( uri ?: Uri ) {
701
- if ( uri === undefined || isHtmlContent ( uri . toString ( ) ) ) {
710
+ if ( uri === undefined || isHtmlContent ( uri . toString ( ) ) ) {
702
711
return this . webviewManager_ . getZoomLevelConfig ( ) ;
703
712
} else {
704
713
return undefined ;
0 commit comments