REditorSupport / REditorSupport/vscode-R
r.removeLeadingComments fails when two lines of preceding comments are interrupted by a blank line
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 139
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 5
Description
Describe the bug
r.removeLeadingComments usually removes comments on preceding lines when those lines are submitted to the terminal. But if a line of R code is preceded by three lines that have a specific configuration—a comment, followed by a blank line, followed by another comment—the second comment will be submitted to the terminal even if r.removeLeadingComments is TRUE.
To Reproduce
- In settings, enable
r.removeLeadingComments - Send this code to the terminal:
# comment 1
# comment 2
print("When you submit this line to the terminal, the second comment will be submitted, too.")
You will see that "#comment 2" has been submitted to the terminal, even though it shouldn't be.
Can you fix this issue by yourself? (We appreciate the help)
No, I'm afraid not.
Expected behavior
In the example above, the print line should be submitted to the terminal, but no comment should be submitted.
Environment (please complete the following information):
- OS: Windows 10
- VSCode Version: 1.82.0
- R Version: 4.3.1
- vscode-R version: 2.8.1
Additional context
Related to #1244 and #1245.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of r.removeLeadingComments in the VSCode extension and reproduce the four-line example with a blank line between comments. Done means the print line is submitted without either comment; add or update a regression test for this sequence if the existing test structure supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100