REditorSupport / REditorSupport/vscode-R

Reindent Lines commands don't work

Open
#435 9 comments 2 reactions 1 assignee View on GitHub

@andycraig is already working on this.

Since Nov 3, 2020.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug

Commands Reindent Lines, Reindent Selected Lines do nothing.

To Reproduce

  1. Create a file temp.R with the following content:
    for(i in 1:2) {
    print(i)
    }
    
  2. Use command Reindent Lines; nothing happens
  3. Select all lines
  4. Use command Reindent Selected Lines; nothing happens

Contrast with JavaScript:

  1. Create a file temp.js with the following content:
    for (let index = 0; index < array.length; index++) {
    const element = array[index];   
    }
    
  2. Use command Reindent Lines; middle line is indented as expected

EDIT: For Javascript, it also works if only lines 2-3 are selected and the Reindent Selected Lines command is used.

Notes

Not sure if this is a vscode-R bug or a VS Code bug, as there seem to be quite a few VS Code issues related to reindenting, e.g., https://github.com/microsoft/vscode/issues/19847

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.