Open DavisVaughan opened 3 months ago
Hey look I also reported the highlighting problem in May https://github.com/quarto-dev/quarto/issues/447
This new issue is more severe because the actual code sent to the console is completely broken. Practically this came up in the cpp11 motivations.Rmd
(which I am going to patch to avoid this, so don't use that as a test case)
That syntax isn't valid in Quarto and well, you see, this is a Quarto editing extension, not an RMarkdown editing extension :)
I'm only like 95% joking, too. My understanding is that the extension takes over .rmd files to provide a reasonable experience in RMarkdown documents under Positron, but I'm not sure it's feasible for us to adapt to every .rmd vs .qmd difference faithfully. In the limit, that means recreating the RMarkdown editing experience from RStudio into Positron. That is a valid goal for Positron, but I think it's we should have a long conversation about whether that makes sense for quarto-dev/quarto
.
That syntax isn't valid in Quarto
Is there some technical reason for this that I'm not aware of? It seems like an extremely easy thing to type in a Quarto document. You don't get any feedback about the fact that it's invalid, but it completely borks the document
Also in https://github.com/quarto-dev/quarto/issues/447#issuecomment-2125090923 you say that the highlighting part is a bug. But the highlighting being off was actually the only way I was able to figure out what was broken!
So if you fix the highlighting but don't fix this, then I would have been completely out of luck!
Is there some technical reason for this that I'm not aware of?
It's the Markdown variant from Pandoc that we use. FWIW I can't even get VS Code to let me save a file with that syntax - it adds the line break in .md (!)
As I write this, I (predictably) can't make Pandoc dislike that line break. (That is, I no longer can produce direct evidence that this is something we shouldn't support.)
And even if we don't support it, it is something we should add to our quarto-cli planned linter at the very least!
I was just curious to understand two things on this
So I have tried with a .qmd in Positron and I get the exact same error. So it seems to about executable cell
detection in both Rmd or Qmd document.
I pass on the discussion about the syntax. To me this is valid syntax for Rmd and Qmd as we render it correctly when doing quarto render
. the intermediate .md passed to Pandoc will have new lines anyway, and Pandoc itself does not need empty line between paragraph and codeblock.
Pandoc is unfortunately not consistent on Block parsing - it does require empty line before and after a Fenced Divs with :::
.
So I tried the same doc in VSCODE, and I can't reproduce. Doing the exact same thing, it sends only x <- 1
in the R terminal when doing control enter.
So it seems related to executable code cell detection in Positron only, which somehow differ from VS Code it seems...
Just wanted to share this if it can help
So I tried the same doc in VSCODE, and I can't reproduce
Do you see the bad highlighting in VS Code? Like in my original image above
Update: I do see the bad highlighting in VS Code:
So maybe there really are 2 places this is going wrong.
Yes I see the highlighting problem too. So probably two different problems yes.
Another report of folks running into this here: https://github.com/posit-dev/positron/discussions/4531
See https://github.com/posit-dev/positron/issues/4155
Create an
Rmd
with the following in itIf you modify
y
, R will first copy the values ofx
to a new position, then pointy
to the new location and only after the copy modifyy
.If you modify
y, R will first copy the values of
xto a new position, then point
yto the new location and only after the copy modify
y`.