It looks like the way `code-link: true` works is through this R script
https://github.com/quarto-dev/quarto-cli/blob/f30845bb322ec9bbfcb4b5e6e12887aa902f5fcc/src/resources/rmd/rmd.R

If I uninstall one of the dependencies you use there, say, jsonlite, and try and run `quarto render` then I get:

```r
[ 1/15] posts/2022-03-11-using-vs-code-to-debug-r-packages-with-c-code/index.qmd
Error in loadNamespace(x) : there is no package called ‘jsonlite’
Calls: .main ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
WARNING: Unable to perform code-link (code-link requires R and the downlit package)
```

So the error message from R is right but the warning from quarto is a little off.

Maybe there should be some kind of up front check for all of the dependencies required to run that script? Like xfun, knitr, rmarkdown, htmltools, etc.

Run with quarto 0.9.344
jjallaire
2022-06-09T20:03:45Z
DavisVaughan
bug
1.0
closed
`quarto render` with `code-link: true` can report an incorrect warning about package requirements
https://github.com/quarto-dev/quarto-cli/issues/1121