REditorSupport / REditorSupport/languageserver

"Format Document" does not observe `"files.insertFinalNewline": true`

Open
#528 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

Using the current dev version of styler, devtools::install_github("rlib/styler"), and having "files.insertFinalNewline": true in the R-specific settings, saving a file formats it fine, adding a trailing newline.

However, manually selecting "Format Document" on that same file removes that newline again.

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the difference between saving an R file and manually selecting “Format Document” with files.insertFinalNewline set to true. Trace the two formatting entry points and compare how they handle the trailing newline. Done means manual formatting preserves the final newline, matching save behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.