Code Monkey home page Code Monkey logo

quarto-vscode's People

Contributors

coatless avatar cscheid avatar dragonstyle avatar eitsupi avatar gvelasq avatar jjallaire avatar jooyoungseo avatar kevinushey avatar lightbridge-ks avatar mcanouil avatar pitmonticone avatar renkun-ken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quarto-vscode's Issues

"Toggle code" shortcut silently conflicts with "Add Selection to Next Find Match"

It looks like the Quarto extension may have recently introduced a "Toggle Code" command (quarto.toggleCode) that is bound to Ctrl+D (or Cmd+D on macOS). This conflicts with an existing command, "Add Selection to Next Find Match", and that command is silently lost.

I can't speak to how many people generally use Ctrl+D to do multiple selections (I personally use constantly!), and I know that it's possible for users to remap commands themselves, but I think silently overwriting an existing base VSCode command is not ideal (recognising, of course, that there are quite a few of them!).

Behaviour of quarto.runSelection

In *.R and *.Rmd files, I can place the cursor anywhere in a multiline statement, when hitting Ctrl+Enter VSCode will "send the 'minimum bit of runnable code' to the console" (see REditorSupport/vscode-R#437 (comment)).

So I can add this code to an *.R and *.Rmd file and no matter if I place the cursor on line 1 or 2 and hit Ctrl+Enter evaluate head(mtcars) correctly.

mtcars  |>
    head()

However, this does not work with *.qmd files. Ctrl+Enter only sends a single (the current) line to the terminal. Either line 1, whereas the terminal waits for further input, or line 2, where R complains that there is no default value to x in head().

Copying text from Quarto Preview window?

I just tried to select and copy text from a Quarto Preview window (โŒ˜c), but it seems like this doesn't work. Is this an intentional decision? If not, I think it would be very useful!

`quarto` is not started at root directory, thus no `renv`

Related to quarto-dev/quarto-cli#855

It appears, the extension for VSCode executes quarto from the directory of the .qmd file thus renv is not accessed since at project's root.
The same behaviour might also be in RStudio, but I dit not check.

Setup project

R -q -e 'renv::init()'
See output
#> * Initializing project ...
#> * Discovering package dependencies ... Done!
#> * Copying packages into the cache ... Done!
#> The following package(s) will be updated in the lockfile:
#> 
#> # CRAN ===============================
#> - renv   [* -> 0.15.4]
#> 
#> * Lockfile written to '~/Projects/misc/renv.lock'.
#> * Project '~/Projects/misc' loaded. [renv 0.15.4]
R -q -e 'renv::install("ggdist")'
See output
#> Installing HDInterval [0.2.2] ...
#>         OK [linked cache]
#> Installing numDeriv [2016.8-1.1] ...
#>         OK [linked cache]
#> Installing distributional [0.3.0] ...
#>         OK [linked cache]
#> Installing ggdist [3.1.1] ...
#>         OK [linked cache]
Rscript -q -e 'writeLines("---\nformat:\n  html:\n    self-contained: true\n---\n\n```{r}\nlibrary(ggdist)\n```\n", "test.qmd")'ined: true)
mkdir subdir
Rscript -e 'writeLines("---\nformat:\n  html:\n    self-contained: true\n---\n\n```{r}\nlibrary(ggdist)\n```\n", "subdir/test.qmd")'

Render with quarto cli from project's root

[Success] Render qmd in project's root

quarto render test.qmd
See output
#> processing file: test.rmarkdown
#>   |.......................                                               |  33%
#>   ordinary text without R code
#> 
#>   |...............................................                       |  67%
#> label: unnamed-chunk-1
#>   |......................................................................| 100%
#>   ordinary text without R code
#> 
#> 
#> output file: test.knit.md
#> 
#> pandoc 
#>   to: html
#>   output-file: test.html
#>   standalone: true
#>   self-contained: true
#>   section-divs: true
#>   html-math-method: mathjax
#>   wrap: none
#>   default-image-extension: png
#>   filters:
#>     - crossref
#>   
#> metadata
#>   document-css: false
#>   link-citations: true
#>   date-format: long
#>   lang: en
#>   
#> Output created: test.html

[Success] Render qmd in a subdirectory of project's root

quarto render subdir/test.qmd
See output
#> processing file: test.rmarkdown
#>   |.......................                                               |  33%
#>   ordinary text without R code
#> 
#>   |...............................................                       |  67%
#> label: unnamed-chunk-1
#>   |......................................................................| 100%
#>   ordinary text without R code
#> 
#> 
#> output file: test.knit.md
#> 
#> pandoc 
#>   to: html
#>   output-file: test.html
#>   standalone: true
#>   self-contained: true
#>   section-divs: true
#>   html-math-method: mathjax
#>   wrap: none
#>   default-image-extension: png
#>   filters:
#>     - crossref
#>   
#> metadata
#>   document-css: false
#>   link-citations: true
#>   date-format: long
#>   lang: en
#>   
#> Output created: test.html
#> 

Render using quarto-vscode

code .

[Success] Render "test.qmd" via quarto-vscode extension "button".

See output

#> /Applications/quarto/bin/quarto preview test.qmd --no-browser --no-watch-inputs
#>
#>
#> processing file: test.rmarkdown
#> |....................... | 33%
#> ordinary text without R code
#>
#> |............................................... | 67%
#> label: unnamed-chunk-1
#> |......................................................................| 100%
#> ordinary text without R code
#>
#>
#> output file: test.knit.md
#>
#> pandoc
#> to: html
#> output-file: test.html
#> standalone: true
#> self-contained: true
#> section-divs: true
#> html-math-method: mathjax
#> wrap: none
#> default-image-extension: png
#> filters:
#> - crossref
#>
#> metadata
#> document-css: false
#> link-citations: true
#> date-format: long
#> lang: en
#>
#> Output created: test.html
#>
#> Watching files for changes
#> Browse at http://localhost:5728/

[Failure] Render "subdir/test.qmd" via quarto-vscode extension "button".

See output

#> /Applications/quarto/bin/quarto preview test.qmd --no-browser --no-watch-inputs
#>
#>
#> processing file: test.rmarkdown
#> |....................... | 33%
#> ordinary text without R code
#>
#> |............................................... | 67%
#> label: unnamed-chunk-1
#> Quitting from lines 8-9 (test.rmarkdown)
#> Error in library(ggdist) : there is no package called 'ggdist'
#> Calls: .main ... withVisible -> eval_with_user_handlers -> eval -> eval -> library
#>
#> Execution halted

quarto

quarto --version
#> 0.9.399

Cross-references auto-completion

It would be great if @ sign could trigger auto-suggestion for bibliography citation keys, and other prefixes, such as @fig-, @tab-, @sec-, etc, could contextually suggest available labels within the current document or project.

Markdown shortcuts in qmd

Is it possible to support shortcuts as vscode plugin "markdown all in one"?
For example, Ctrl+B to get bold environment ****

Render working directory

When I try to render a qmd file using the "Render" button, the terminal window doesn't start in the project folder but in my home directory.

Hence the file to render is not found.

I guess there is something wrong with my settings. Any idea ?

Nested div blocks don't fold correctly.

Quarto supports nested div blocks, described in https://pandoc.org/MANUAL.html#divs-and-spans

For example the following renders as expected:

# Nested callout

:::{.callout-note}

:::{.callout-note}

:::

:::{.callout-note}

:::

:::

image

However, in vscode, folding the top level div block doesn't hide both inner div blocks.

image

I think if possible it should look like the following when the top level div is folded.

image

When no jupyter kernel is specified random kernel is tried when rendered

I have a document (ticks for code where removed)

---
title: "Untitled"
format: html
---

{python}
#| echo: fenced
import numpy

When I tried to render it, it uses it tries to run a specific kernel in my case 'cognitive-reserve-3.9.10`, this kernel doesn't exist, error is thrown

[Errno 2] No such file or directory: '/Users/daniel/.pyenv/versions/cognitive-reserve-3.9.10/bin/python'

I specified existing kernel in yaml

jupyter: cognitive-reserve-3.10.4

I sucesfully rendered the code.
Then I removed the kernel specification from the yaml.

When I tried to render code again, the cognitive-reserve-3.9.10 was tried to run.
The cognitive-reserve-3.9.10 was deleted a few weeks ago by me before I installed quarto.

Expectation:

  • Either run the kernel that was last used (if the plugin stores such data), in that case, cognitive-reserve-3.10.4
  • Or throw an error that kernel isn't specified in YAML

Autcomplete citations

Autocompletion of citations (and other references) after hitting @ would be a great feature for the extension.

Pandoc Citer does the similar thing for regular .md documents but it currently does not support .qmd and requires that bib file is specified between squred brackets in YAML (bibliography: [path/to/.bib])

"No TeX installation was detected" even after "quarto install tool tinytex"

This issue for quarto-vscode (installed today, Saturday 2022.08.27) is identical to issue #1116 for quarto-cli: Even after executing quarto install tool tinytex, attempting to Render PDF fails. The error message is as follows.

running xelatex - 1

No TeX installation was detected.

Please run 'quarto install tool tinytex' to install TinyTex.
If you prefer, you may install TexLive or another TeX distribution.

Per the instructions given in response to issue #1116 for quarto-cli, I un-installed and then re-installed tinytex, but the problem remains. Attempting to run quarto install tool tinytex again yields the message tinytex is already installed and up to date.

Spell checking

I am using Quarto in VSCode. How can I implement the spell-checking facility? I have a spell checker installed (Code Spell Checker v2.2.5), but apparently, Quarto does not recognize it.
Thanks

Cell Magics

Consider the following cell with cell magic %%javascript in the following example:

```{python}
#| output: false
%%javascript

// some JS Code

The cell works in qmd as expected. However it doesn't work in the Interactive Console. When you execute it, the interactive console is fed by this:

#| input: false
%%javascript

// some JS Code

I believe that the reason, why it doesn't work, is that comments are not allowed before cell magics. Cell magics need to be on the first line of the cell.

Note: The generated ipynb file also contains this and therefore cannot be executed.

I also encountered a second problem: Commands like "Run All Cells" don't work with Cell magics. It is because when running all cells, Quarto concatenates all code cells and then runs it. This is not viable with cell magic commands. It needs to be interpreted separately.

Render button fails for ipynb file (render works via terminal)

If I select Render from the button/menu at the top of a .qmd file toolbar, then Quarto opens a Terminal and successfully renders the file and shows a preview in a new window as desired.

If I do the same for a .ipynb file, nothing happens. However, I can successfully render and preview the .ipynb file by manually opening a Terminal and executing quarto preview myfile.ipynb, so it appears just the toolbar Render menubutton for .ipynb files is not working correctly.

  • MacOS 12.4
  • VS Code 1.71.0
  • quarto 1.1.189
  • VS Code Quarto Extension 1.38.0

no module named 'nbformat

No success using quarto within VS Code on OS X. I have tried it with python, julia, and R cells, but this makes no difference. In the terminal it opens I confirm that jupyter is installed (I used it all the time), as is the ipykernel 'julia-1.7' that I set in the yaml.
I saw mention of disabling the setting Terminal>Integrated>Shell Integration. I turn off the checkbox (although it still says 'Enabled', the json says false).
Opening an ipynb in VS Code and running julia cells works fine.
the YAML ends with
jupyter: julia-1.7

From the terminal in vscode
% jupyter kernelspec list
Available kernels:
ir /Users/alun/Library/Jupyter/kernels/ir
javascript /Users/alun/Library/Jupyter/kernels/javascript
julia-1.7 /Users/alun/Library/Jupyter/kernels/julia-1.7
python3 /Users/alun/opt/miniconda3/share/jupyter/kernels/python3
...

Autocomplete Python

My R codes have autocomplete but If I write Python code in .qmd format for some reason my codes don't have autocomplete. When I use .ipynb and .py it's okay, is there some configuration that is disabled or maybe can cause conflict?

Example

my configs:
Quarto extension version: 1.12.1
VSCode version: 1.66.2
OS: Ubuntu 20.04.4 LTS
python extension: v2022.4.1

Chunk options on first-line not recognized as executable code chunk

Hi, May I suggest some improvements.

I've found that R code chunk that has options defined on the first line or has space after r can't be recognized as executable code chunk, and the code can't be run (by cmd-enter).

Screen Shot 2565-05-08 at 21 47 05

(This works fine in RStudio, however.)

I've notice that you recommend using the comment-based syntax, however, may be someone (including me) might use in-line option in some chunk, also.

I guess, the problem might located in the regular expression somewhere that matching code chunk.

However, This is a Great extension thus far, Good job ๐Ÿ‘

Thankyou

Attempting to render .qmd with python3 kernel

Hi, when trying to render .qmd file with a python3 kernel, I am getting an error ERROR: NotFound: The system cannot find the file specified. (os error 2).

Ran quarto check and everything seems to be in order (namely, the kernel is being picked up and jupyter rendering seems to check out):
[>] Checking Python 3 installation....OK
Version: 3.10.0 Path: C:/Users/../AppData/Local/Programs/Python/Python310/python.exe
Jupyter: 4.9.1
Kernels: python3

[>] Checking Jupyter engine render....OK

Here is my .qmd:


title: "another_test"
format: html
jupyter: python3

#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"

import numpy as np
import matplotlib.pyplot as plt

r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
  subplot_kw = {'projection': 'polar'} 
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()

I am on v1.33.0 for the vscode extension and v1.0.38 for quarto itself. (and am using a windows machine).
Any help you could provide would be greatly appreciated.

Quarto installation not found when click on render in Visual Studio Code

Error message
"Quarto installation not found"
"Please install Quarto CLI before rendering documents"

When I click on Render button in VS Code (see code below)

  • Windows 10 pro 64 bits
  • Installed quarto-1.0.38-win.msi
  • Installed VS Code extention Quarto v1.32.0
  • Path c:\Program Files\Quarto\bin
  • In c:\Program Files\Quarto\bin there are two files a) quarto.cmd and b) quarto.js

CODE----------------------------------------

title: "Quarto Basics"
format:
html:
code-fold: true
jupyter: python3

For a demonstration of a line plot on a polar axis, see @fig-polar.

#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"

import numpy as np
import matplotlib.pyplot as plt

r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
  subplot_kw = {'projection': 'polar'} 
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()

Not working on Windows VSCode

VSCode giving error "Quarto Installation not found" when trying to render.

I am not sure if the following steps to install Quarto is correct because I did not find detail instructions on installation on Quarto Get Started page

I followed the next sequence to install Quarto:

  1. installed Quarto for Windows
  2. installed Quarto VSCode extension from VSCode extensions menu (left side of screen)
  3. Created Quarto file and render giving error "Quarto Installation not found"

installation errror

Going to the settings of Quarto in VSCode I changed the PATH to point to where Quarto quarto.cmd is located in my PC but still get the same error when trying to render the file.

path to cli

VScode: Quarto Installation Not Found

I trying a lot of things to use Quarto in VSCode, but none worked, Quarto still not working in VScode, but works very well in RStudio.

The problem:
image
But extension is installed:
image
And Quarto too:
image

Some things I've tested/tried:
image
None of that worked in VSCode terminal, but in linusxbash:
image
And works in RStudio terminal too:
image
And rendering works with quarto preview apresentacao.qmd
image

my configs

R version: 4.2.1

os: Pop!_OS 22.04 LTS

system: x86_64, linux-gnu

rstudio: 2022.02.3+492 Prairie Trillium (desktop)

pandoc: 2.17.1.1 @ /usr/lib/rstudio/bin/quarto/bin/ (via rmarkdown)

vscode: 1.68.1

Am I doing something wrong?

Preview not refreshing after file changes

I'm using quarto within my remote containerized VS-Code dev environment, and I cannot get the live preview of an HTML-based format (such as HTML report or revealjs presentation) to refresh after saving file changes to the source .qmd file. I launched the preview by selecting Quarto: Render Document in the command palette.

I also noticed that initially the preview tab in VS-code is blank until I hit the refresh button, and then the rendered slides appear. But the preview will not update when using the built-in preview tab or pop out to a web browser tab.

My repository with the slides and report sources (as well as my dev environment setup) is available at github.com/rpodcast/quartoplay.

Version information:

  • VS-Code 1.66.0
  • quarto 0.9.172
  • R version 4.1.0
  • Quarto extension v1.11.2
  • R extension v2.4.0

Temporary intellisense.py shows up in "Problems" panel

I'm not 100% sure if this is related to the Quarto extension, but this only occurs in my Quarto projects. Sometimes, the "Problems" panel contains linting warnings for a file called "intellisense.py", which is not part of my project but in some /var/... directory. It seems like this is some temporary file used to run code cells, so it should not be part of the project (and therefore, no problems should be reported).

I just wanted to report the actual file location and contents, but the problems disappeared right now. I still wanted to leave this report here just in case someone else has also noticed this. I will come back and add more details when this appears again.

Quarto installation not found on Linux VSCode extension

Hi Quarto team,

I'm trying to use Quarto on Pop!_OS 22.04 LTS on Visual Studio Code 1.67.2. I have Quarto 0.9.505 installed (pasting results from quarto check below). When I try to render in VSCode using the Quarto extension on a .qmd file I get the error box "Please install the Quarto CLI before rendering documents", but it is already installed. I've also gone through a computer reset.

[โœ“] Checking Quarto installation......OK
      Version: 0.9.505
      Path: /opt/quarto/bin

[โœ“] Checking basic markdown render....OK

[โœ“] Checking Python 3 installation....OK
      Version: 3.10.4
      Path: /usr/bin/python3
      Jupyter: 4.10.0
      Kernels: julia-1.7, python3

[โœ“] Checking Jupyter engine render....OK

[โœ“] Checking R installation...........OK
      Version: 4.1.2
      Path: /usr/lib/R
      LibPaths:
        - /home/slwu89/R/x86_64-pc-linux-gnu-library/4.1
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      rmarkdown: 2.14

[โœ“] Checking Knitr engine render......OK

[Feature request] Support markdown syntax in editor (source view) for qmd files

Currently in the editor when writing text there is no support for visual distinction for headings, italics et cetera.
Would be great to have it supported the same way as the .md files have in vscode editor.

It may be a bug as well, I am on quarto v1.21.0 and vscode 1.67.2

My current workaround is to set language mode to markdown but then I am losing the code syntax support.

Integration with code spell checker

For writing, spell checker is a quite useful tool. But Quarto extension in vscode is not integrated with a spell checker.
In #1218 , one has proposed a solution to use code spell checker extension, which eases the problem to some extent but still has some unsatisfactory points. For example, if one specifies .qmd with quarto spell checker, it will check all the contents of .qmd file. But in most cases, one only needs to check markdown cells, which contain contents for publishing.
So it will be good that quarto extension itself can support markdown cell spell checking.

Having trouble rendering Observable cells with the vscode extension

I have copied the example code chunks from the Observable tutorial on Quarto. I have a downloaded palmer-penguin.csv file. But when I try to render command (ctrl + Shift + K ) as explained in the extension details. I get an error that says command 'quarto.render' not found.

I also tried quarto render PenguinExample.qmd from my terminal and I get this error.

quarto : 
The term `quarto` is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path   
is correct and try again.
At line:1 char:1
+ quarto render PenguinExample.qmd
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (quarto:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException```

Feature request: rainbow matching div classes

I have been using Quarto in vs code to make a revealjs presentation that mixes R, Python and javascript (plotly, mermaid) with various html stuff that could not be used in a pdf presentation, e.g. gifs, background iframes. It is awesome.

I love the vscode extension - the syntax highlighting works really well for the main document and all languages. The only thing is that when adding several <div> tags with a class attribute using the ::: notation, it can get a bit confusing. For example:

# Slide title

:::: {.columns}

::: {.column width="50%"}
::: {layout="[[-1], [1], [-1]]"}
::: {.nonincremental}
1. Here is a point.<br>

2. This is another point.<br>

3. I have used the layout tag to make this appear in the centre of the screen [^reference1]<br>
:::
:::
:::

::: {.column width="50%"}
::: {layout="[[-1], [1], [-1]]"}
![](./plots/some-plot.png)
:::
:::

::::
[^reference1]: https://stackoverflow.com/questions/72941210/vertical-align-of-images-in-quarto-presentations

This is how this appears:

image

If these were nested brackets then vs code could highlight which close bracket matches each open bracket. I wondered whether it would be straightforward to add similar functionality for each :::?

Specify the virtual environment in vscode

Hi,

Going from R to Python, I was glad to discover Quarto.

I use vscode to open my jupyter notebooks. I would like to use qmd instead of jupyter but I cannot find a way to specify the virtual environment I am using in the qmd. I could not find in the documentation the way to do it. I see that you can put python3 in the jupyter section of the yaml, I tried to put the name of my virtual env (created with poetry) but it does not work.

How can I tell the qmd file, in vscode, to use a specific venv?

Thanks for your help,
Mathieu

VS Code autocomplete for cross references not working

I noticed that when working in VS code and I try to add a cross-reference the autocomplete fails and I get the following message in the VS code output terminal:

image

Not quite sure if this is an extension problem or a quarto cli problem.

Alignment of "Execute R code" keyboard shortcut with R extension

In the Quarto VSCode extension, [Cmd/Ctrl]+Enter executes the R code on the current selected or positioned lines of the document.

In the R VScode extension, the same shortcut executes the current selected text if a selection is made, or otherwise the current statement (traversing both up and down to find the bounds of the current statement).

It'd be great if the Quarto VScode extensions' behaviour was adjusted to align with the R extension, so that there aren't differences depending on whether a user is editing an R script or a Quarto document. (I personally prefer the R extension's behaviour because it means you can do things like execute pipes while leaving the assignment off for exploration, but I accept that it's largely a matter of taste!).

quarto `execute-dir: file` and renv projects

Hi,

In my opinion, when using renv and quarto as a project within VSCode (and RStudio?), it makes no sense for execute-dir: file, because the R chunks will never have access to renv library.
Is it possible to enforce globally in VSCode extension settings the use of execute-dir: project?

This is related to quarto-dev/quarto-cli#794

Command 'Quarto: New Notebook (ipynb)' when run as a first command after install

I really like the idea of quarto.When try to initialize quarto after installing with new ipbnv notebook I got

Command 'Quarto: New Notebook (ipynb)' resulted in an error (command 'quarto.newNotebook' not found)

However after creating qmd document I was able to create ipynb notebooks normally.
Quarto 1.12.1 vscode 1.66.1

Can render quarto doc in RStudio but not in VSCode

In a .qmd (Quarto) document calling the library(treemapify) works. I can run the code chunk without problem.
However, when rendering the document to html I get the prompt:

Error in library(treemapify) : there is no package called 'treemapify'
Calls: .main ... withCallingHandlers -> withVisible -> eval -> eval -> library
Execution halted

Rendering the same file in RStudio does not produce the error.

To Reproduce
Create the .qmd (Quarto) file with the content below.

library(tidyverse)
library(treemapify)
find.package("tidyverse")
find.package("treemapify")

Assuming that treemapify has been already installed, run the code chunk. (No issue).
Render the document. Error. Issue appears.

Open the same document in RStudio and render it. No error occurs.

I use Quarto, R and VSCode without problem. Only with this package the strange error occurs.

Running R cells inserts additional newline

When I click on "Run Cell" at the top of an R cell, the cell is executed in the interactive R interpreter. However, an additional newline seems to be sent because the console looks like this when I run a cell containing just 1 + 1:

> 1 + 1
[1] 2
> 
>

Shiny does not work in Preview

I tried the Shiny example from the Guide. It worked on RStudio, but not VScode.

Here is the output when rendering to html

image

Python code completion is not working

Code completion is not working on Python chunks.

This is the expected behavior

image

But I got this

image

Completion works just fine in .py scripts

image

My settings for Quarto in settings.json are

  "[quarto]": {
    "editor.suggest.showSnippets": true,
    "editor.wordWrap": "on",
    "editor.quickSuggestions": {
      "comments": "on",
      "strings": "on",
      "other": "on"
    },
    "editor.quickSuggestionsDelay": 250,
    "editor.snippetSuggestions": "top",
    "editor.wordBasedSuggestions": true,
    "editor.suggestOnTriggerCharacters": true,
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "editor.unicodeHighlight.invisibleCharacters": false
  }

Error when rendering - space in filepath

I am trying to use Quarto (v1.0.38) through the Quarto add-in (v1.30.0) in VS Code (v1.70.1) on Windows 10. I installed both Quarto itself and the VS Code add-in, and followed the "Get Started with Quarto" steps that popped up. The first step, "Install Quarto" had a button to verify installation, which completed OK, as did the second step to create a document.

However, the third step "Render a Document" threw the following error:

PS A:\My Documents\quarto_test> cmd /C"C:\Users\First^ Last\AppData\Local\Programs\Quarto\bin\quarto preview walkthrough.qmd --no-browser --no-watch-inputs"
FINDSTR: Cannot open Last
ERROR: NotFound: The system cannot find the path specified. (os error 3)

It appears that the command has an issue with the space between First and Last on the filepath.

Pylance integration

Hello,

The code in cell blocks in qmd file is not checked as it would be in Jupyter notebook cells by Pylance. A simple example is trying to import a library not installed in the virtual env:

  • In a Jupyter notebook it will be underlined to show that the library is not available

Screenshot 2022-06-23 at 16 45 06

  • In a qmd file nothing is displayed

Screenshot 2022-06-23 at 16 45 21

How can I make Pylance (or something else) integrate with the Quarto extension?

Thanks,
Mathieu

Display math highlighting

Issue: to use latex environments (like align or equation) in a Quarto document, the best practice (iiuc) is to use them raw (\begin{align} ... \end{align}), not to enclose them in dollar signs (like $$\begin{align} ... \end{align}$$).

However, the VSCode extension implicitly encourages the latter (see image below; enclosing in dollar signs makes the align environment be nicely highlighted and preview-able when editing, whereas without the dollar signs it just looks like plain text). This is not good, because one shouldn't enclose environments in dollar signs, since this will lead to LaTeX compiling error when rendering (as described below).

Possible solution: Make it so highlight/preview-ing works for such latex environments without enclosing them in dollar signs.


For an example, here is a quarto document example.md:

---
title: Display math highlighting example
format:
  html:
    html-math-method: katex
  pdf:
    documentclass: article
    keep-tex: true
---
Here is some display math using bare `\begin{align} ... \end{align}`:
\begin{align}
C &= \max_{p_X}{I(X;Y)}\\
  &= \max_{p_X}{H(X) - H(X\mid Y)}
\end{align}
It is _not_ highlighted.

Here is some display math using `$$\begin{align} ... \end{align}$$`:

$$
\begin{align}
C &= \max_{p_X}{I(X;Y)}\\
  &= \max_{p_X}{H(X) - H(X\mid Y)}
\end{align}
$$
It _is_ highlighted, but causes issues in pdf/latex output.

This looks like the following, in with quarto-vscode:
Screen Shot 2022-06-08 at 13 30 20


Enclosing the align environment in double dollar signs, like $$\begin{align} ... \end{align}$$ makes the highlighting/previewing work in VSCode, but makes the following (bad) TeX, if converted to PDF or TeX formats. E.g., with quarto render example.md --to pdf, the second example above results in the following tex code:

\[
\begin{align}
 ...
\end{align}
\]

which causes (xe)latex to give the error

compilation failed- error
Package amsmath Error: Erroneous nesting of equation structures;
(amsmath)                trying to recover with `aligned'.

Removing the double dollar signs fixes this issue, but then you can't get nice highlighting in VSCode.

Code blocks not showing or responding to Run commands

When I work with .qmd files in VSCode, code blocks are formatted as such with language-appropriate syntax highlighting, but they do not display Run cell/Run lines commands. If I press Cmd+Enter to run highlighted text, I get an error from the Quarto extension:

Editor selection is not within an executable cell

image

Quarto extension version: 1.9.0
VSCode version: 1.65.2
OS: Darwin arm64 21.3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.