REditorSupport / REditorSupport/vscode-R

Missing terminal newline lint is not reported in VSCode Problem Pane

Open
#1,670 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Missing terminal newline lint is not reported in VSCode Problem Pane

To Reproduce

  1. Create a new file (Ctrl+N)
  2. Select the R language (Ctrl+K M and select R)
  3. Write x <- 1 in the editor
  4. Do not insert a terminal newline
  5. Save the file as test.R (Ctrl+S)
  6. The Problems Pane (Ctrl+Shift+M) reports that No problems have been detected in the workspace
  7. lintr::lint() reports the lint as expected:
lintr::lint(
  filename = "test.R",
  linters = lintr::trailing_blank_lines_linter(),
  parse_settings = FALSE
)
# xxx/test.R:1:7: style: [trailing_blank_lines_linter] Add a terminal newline.
# x <- 1
#       ^

Can you fix this issue by yourself? (We appreciate the help)

No

Expected behavior

The lint should be reported in VSCode Problem Pane.

Environment (please complete the following information):

  • OS: Windows 11
  • VSCode Version: VSCodium 1.107.18627
  • R Version: 4.4.0
  • vscode-R version: 2.86

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.

Research direction

Start by reproducing the missing terminal-newline case with lintr::lint() and trailing_blank_lines_linter(), then compare its result with the VSCode Problems Pane output. Trace the VSCode extension's lint integration to determine why this diagnostic is omitted; done means the lint is reported in the Problems Pane for the provided test.R scenario.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.