posit-dev / positron

Positron, a next-generation data science IDE
Other
2.53k stars 79 forks source link

Editor settings for indentation are not followed in R files #3691

Open david-cortes opened 3 months ago

david-cortes commented 3 months ago

Positron Version:

Positron Version: 2024.06.1 build 27 Code - OSS Version: 1.90.0 Commit: a893e5b282612ccb2200102957ac38d3c14e5196 Date: 2024-06-26T01:22:29.024Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.1.0-21-amd64

Steps to reproduce the issue:

  1. Go to Settings -> Text Editor , and select:
    • Editor: Insert Spaces -> yes
    • Editor: Tab Size -> 4
    • Editor: Indent Size -> Edit in settings.json -> select the default "tabSize" that it offers
  2. Create a new R source file.
  3. Write the following:
    function() {<position here>}

    (without the <position here> part)

  4. Put the focus where is says <position here> and press Enter.
  5. Alternatively, just look at the bottom indicators where it says how many spaces per tab it is using.

What did you expect to happen?

Should follow the settings: 4 spaces per tab.

Actual behavior

Uses 2 spaces per tab for R files, contrary to what the non-language-specific settings dictate.

Were there any error messages in the output or Developer Tools console?

No

ntluong95 commented 3 months ago

Yes it is a nuisace. This problem inherits from VSCode

juliasilge commented 3 months ago

Related to https://github.com/posit-dev/positron/pull/2173

You can configure the tab size for R specifically to override this config we set based on norms in the R community, but we can gather more feedback on whether we should change the default behavior.