posit-dev / posit-dev/air

Comment placement in argument lists causes ordering issues

Open
#435 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
446
Forks
32
Avg merge
16h 48m
Merged PRs (30d)
1

Description

This call:

list(
  # comment0
  foo  # comment1
  =1, bar  # comment2
  =  # comment3
  # comment4
  2 #comment5
  #comment6
  , #comment7
  #comment8
)

Is currently formatted as:

list(
  # comment0
  # comment1
  foo = 1,
  # comment3
  # comment4
  # comment2
  bar = 2, #comment5 #comment7
  #comment8
  #comment6
)

We need to fix these issues:

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 in crates/air_r_formatter/src/comments.rs at the referenced logic around line 951, using the issue's R call as the reproduction. Trace how comments around argument nodes and the empty argument are assigned, then verify that comment2, comment6, and comment7 retain the intended order and line placement without combining comments incorrectly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.