quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
280 stars 19 forks source link

No R completions on VSCode extension #437

Open PauloCampana opened 1 month ago

PauloCampana commented 1 month ago

Related: https://github.com/quarto-dev/quarto/issues/329 https://github.com/quarto-dev/quarto/issues/190 https://github.com/quarto-dev/quarto-cli/discussions/4269

Can't get R code completions/suggestions to work inside an {r} chunk of a .qmd file.

It looks like the quarto VSCode extension creates a .intellisense.r file (sometimes a .vdoc.r?), grabs completions from there through the REditorSupport extension then serve them in the current active quarto editor, creating then trashing the file on every request.

From the discussion in quarto-cli linked above, it seems like this file should be created in a nearby directory, but mine is being created at /tmp/tmp-*-*/r/ directory, and with no write permission to that root folder, the temporary file can't be deleted.

This means that I get 1 code completion right and after that no more until it decides to create the file in another tmp directory which happens when VSCode is restarted. Here is the debug logs from Output -> Window:

2024-05-10 20:09:25.502 [debug] _performFileEdits [{"oldResource":{"$mid":1,"fsPath":"/tmp/tmp-26098-KsrUF66R9pC5/r/.intellisense.r","external":"file:///tmp/tmp-26098-KsrUF66R9pC5/r/.intellisense.r","path":"/tmp/tmp-26098-KsrUF66R9pC5/r/.intellisense.r","scheme":"file"},"options":{}}]
2024-05-10 20:09:25.517 [error] Unknown (FileSystemError): Failed to move '.intellisense.r' to the trash (Failed to move item to trash)
    at $.create (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:56:3584)
    at P (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:56:3698)
    at b.y (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:61:40216)
2024-05-10 20:09:25.517 [warning] IGNORING workspace edit: Unknown (FileSystemError): Failed to move '.intellisense.r' to the trash (Failed to move item to trash)

Quarto extension: v1.111.0 R extension: v2.8.3 languageserver package: v0.3.16 VSCode: v1.89.1-1715060508 Linux Mint: v21.3