-
Notifications
You must be signed in to change notification settings - Fork 91
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
Every new line in an R script automatically indents by one space #5258
Comments
Hi, thank you for using Positron! Unfortunately, we are not able to reproduce this issue locally so we are hoping you can provide some more diagnostic information. Is it correct to assume that you tried to repro with all user installed extensions disabled (and it still repros)? Could you perhaps capture your settings.json as a file and share it? Here is an image showing where the button is to go from the visual editor to the file view: If you want to try it, you can also cut out all your settings, save the json elsewhere, and retest with all default settings. Then you would be able to paste back in your settings from the saved location after the test. |
Hi Christopher, Thanks for getting back.
Yes, that's right.
My settings seem quite lightweight: {
"rstudio.keymap.enable": true,
"git.confirmSync": false,
"python.defaultInterpreterPath": "C:\\Users\\JD38\\AppData\\Local\\Programs\\Python\\Python312\\python.exe"
} I've deleted these and the situation persists: |
I'll also note a fresh install doesn't fix it. If I'm quick, when Positron first loads it doesn't have this issue, but after a second or so it kicks in, which makes me think its an extension problem. |
@jack-davison if you disable the extensions, then click one of the Restart Extensions buttons, wait for the reload and try again, are you still seeing the issue? The Extensions Host needs to be restarted for the extension disable to take. If the issue still persists after disabling and reloading extensions, then something else could be the culprit. If the issue is gone after disabling and reloading extensions, we could try a bit of a tedious task of disabling individual extensions and checking which one is resulting in this issue. Additionally, if you're willing to share the output of running |
Could you please shut down the R session that automatically starts and see if the issue persists? The problem might come from the LSP running in the R session. |
I also see this issue, but it I couldn't figure out a systematic reason - sometimes, it happens, sometimes not, is my impression. insert_space.mp4Setup:
Here's my setup: |
Same issue here on a fresh install with no extra extensions installed. Issue also persists even after running 'Reload With Extensions Disabled' from the command palette. |
It's definitely tough to debug something like this that we ourselves can't reproduce! For a first step, can you all try turning off the R session. You can do this by clicking this button: After that, your R session will be shut down (do not restart it!): With no R running, do you still see the behavior with the additional space being added? Do you see this behavior in a |
Hi @juliasilge, When I disable the R session via the console, the error stops and the indents do not occur. When I turn it back on, the issue reoccurs. The issue doesn't happen in Cheers, |
Yes same here, error goes away if R is not running, and does not occur in .qmd .Rmd or any python related files regardless of whether R is running or not. Thanks for looking into this, I understand its difficult when you cannot replicate it on your end. Cheers, |
Could y'all please open a new positron session, trigger the wrong indents a few times, and give us your R logs? You can find them by following the steps in https://positron.posit.co/troubleshooting.html#python-and-r-logs. I'm especially interested in the logs for the language server but also the runtime. |
I managed to reproduce on a windows vm based on these comments. It's a tree-sitter-r issue, tracking here r-lib/tree-sitter-r#151, thanks all! |
### Positron Release Notes #### New Features - N/A #### Bug Fixes - On Windows, indents of size 1 are no longer randomly added in R scripts (#5258).
Hello @jack-davison, would you mind trying out the new release |
Hi @testlabauto - seems to be working now! Thanks for everyone's help here! |
System details:
Positron and OS details:
Positron Version: 2024.11.0 (user setup) build 140
Code - OSS Version: 1.93.0
Commit: e0d844b
Date: 2024-10-31T14:22:13.808Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631
Interpreter details:
R 4.4.3
Describe the issue:
Whenever I go to a new line in a .R file a space is automatically added.
I have tried to disable and re-enable extensions, but it's still happening.
Steps to reproduce the issue:
Expected or desired behavior:
I would imagine there would not be any indentation.
Were there any error messages in the UI, Output panel, or Developer Tools console?
N/A
The text was updated successfully, but these errors were encountered: