Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible conflict between Quarto extension and Dropbox causing corruption #538

Open
aaronschiff opened this issue Sep 12, 2024 · 5 comments

Comments

@aaronschiff
Copy link

aaronschiff commented Sep 12, 2024

I'm experiencing a frustrating issue where certain actions cause unwanted changes to my Quarto documents in VSCode. Sometimes when I paste code into an R code block in qmd file or save the file, parts of the document will get changed or corrupted. This appears to occur only when both the Quarto and REditorSupport extensions are enabled. If just one of those two is enabled, I don't see the issue. It does not occur on every paste or save and I can't figure out what is the trigger aside from those actions. I presume it is related to code formatting.

As an example, here is a screenshot of a freshly created qmd file:

Screenshot 2024-09-13 at 09 49 23

And here is how it looks after pasting one line of code into the R code block:

Screenshot 2024-09-13 at 09 48 43

My setup:

  • VSCode 1.93.1
  • Quarto extension 1.114.0
  • R extension 2.8.4
  • Quarto 1.5.57
  • MacOS 14.6.1
@aaronschiff
Copy link
Author

Also noting that I have tested after reverting to default settings for both the Quarto extension and R extension and still see this issue. Previously I had changed R extension settings to use the radian terminal, but it seems unrelated to that.

@aaronschiff aaronschiff changed the title Possible conflict between Quarto extension and REditorSupport extension causing corruption Possible conflict between Quarto extension and R extension causing corruption Sep 12, 2024
@aaronschiff
Copy link
Author

Here's some steps that reliably cause this issue for me every time:

  1. Create a new qmd file
  2. Type an R code block with one line of code
  3. Copy the line of code
  4. Delete the line of code
  5. Paste the line of code
  6. Save the file

After saving, the line of code and closing fence for the code block disappear. See screencap below.

Screen.Recording.2024-09-13.at.12.41.06.mov

@aaronschiff
Copy link
Author

I've noticed that this issue appears to be correlated with the appearance of a .vdoc.r temporary file in my VSCode workspace. Deleting that file whenever it appears seems to stop the corruption from happening to the Quarto document I'm working on, but that's not a very good solution. This is unfortunately making Quarto almost unusable in VSCode for me.

@cscheid
Copy link
Contributor

cscheid commented Sep 24, 2024

I've noticed that this issue appears to be correlated with the appearance of a .vdoc.r temporary

Thank you, this is helpful. This likely points to an issue in apps/vscode/src/vdoc/vdoc-tempfile.ts. See https://github.com/quarto-dev/quarto/blob/main/apps/vscode/src/vdoc/vdoc-tempfile.ts#L45: that's where we'd create a .vdoc.r

@aaronschiff
Copy link
Author

@cscheid thank you. I tried debugging the extension but it's beyond my ability. I also just discovered that this issue is related to the VSCode workspace directory being in Dropbox. Outside Dropbox everything seems to be fine, so I guess Dropbox interferes with .vdoc.r somehow. I'll change the title of the issue to reflect that.

@aaronschiff aaronschiff changed the title Possible conflict between Quarto extension and R extension causing corruption Possible conflict between Quarto extension and Dropbox causing corruption Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants