Skip to content

NamedIndexedPropertySet with two SynLongIdent remove space #3273

Closed

Description

@nojaf

Issue created from fantomas-online

Code

a.B c.DE <- 0
a.B c <- 0
B c.DE <- 0
a.B c <- 0

Result

a.Bc.DE <- 0 // notice the missing space
a.B c <- 0
B c.DE <- 0
a.B c <- 0

Problem description

Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 2025-09-08T06:57:30Z - 31029b1

    { config with
                MaxLineLength = 80 }

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

Activity

  1. github-actions commented on Mar 11, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    I've investigated this bug and submitted a fix: see PR #3275 (pending creation).

    Root cause: In CodePrinter.fs, the sep logic for Expr.NamedIndexedPropertySet only adds a separating space for Expr.Constant and Expr.Ident index expressions. A multi-segment identifier like c.DE maps to SynExpr.LongIdent → Expr.OptVar in the Oak representation, which was not in the sepSpace case. So the space was omitted, merging a.B and c.DE into a.Bc.DE.

    Fix: Add Expr.OptVar _ to the sepSpace case — a one-line change in CodePrinter.fs. All 2737 tests pass.

    Generated by Repo Assist · ◷

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f
    
  2. added a commit that references this issue on Mar 11, 2026
    0e371ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions