DescriptionAs mentioned in other discussions, I have code formatting settings in VSCode like these: "[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
},
"[quarto]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "quarto.quarto",
},
"[r]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "Posit.air-vscode",
},I really like Air and have no issues with it for my normal R files. However, for my QMD files (R and CSS chunks only, rendered with knitr), formatting is incredibly slow. When I save my file, I usually need to stare at the "Running Code Actions and Formatters..." notification in VSCode for about 1 minute, which is extremely frustrating (for context, my QMD file has about 1600 lines across ~160 chunks). Furthermore, my environment gets polluted with dozens of Is anybody else experiencing these issue? What did you do about it? It's also hard to find resources on code formatting in Quarto because neither Google nor the search in the Quarto docs can distinguish between "document formats" (e.g. HTML, PDF, ...) and code formatting. Edit: |
Replies: 2 comments 4 replies
|
The "quarto" extension basically extracts the code to give to the formatter from other extensions, that's why there are "virtual docs", i.e., vdoc. Those files stick around only when something wrong happens like the process is interrupted for various reasons (no disk space left, CPU on high load, etc.). Note that even in a terrible environment I never got "dozens" of .vdoc" files. Nearly all formatters cannot run on Quarto document and figure out by themselves what is what inside it. This is likely to improve with q2 the next major iteration of Quarto, but the team is heavily working on it and it isn't quite ready. In the meantime, in the community, Johan Larsson took a stab at this tricky issue and created a tool which comes with an extension for VSCode. |
Be sure to update latest version of Quarto Extensions regularly. And if you found issues in Positron or VSCODE, you can open a report with some information for us and others to investigate at https://github.com/quarto-dev/quarto This is where the Quarto Extension for VSCODE lives. Thank you. |
The "quarto" extension basically extracts the code to give to the formatter from other extensions, that's why there are "virtual docs", i.e., vdoc. Those files stick around only when something wrong happens like the process is interrupted for various reasons (no disk space left, CPU on high load, etc.).
Note that even in a terrible environment I never got "dozens" of .vdoc" files.
This could be related to the size of your document or something specific to your environment (extensions conflicts, etc.)
Nearly all formatters cannot run on Quarto document and figure out by themselves what is what inside it.
This is likely to improve with q2 the next major iteration of Quarto, but the team is …