Skip to content

Scalafmt Doesn't Wrap Lines in Comments #1887

@iamrecursion

Description

@iamrecursion
  • Version: 2.4.2
  • Integration: IntelliJ
  • Configuration: The full configuration can be found here.

Steps

Given code like this:

/** This pass implements dataflow analysis for Enso.
  *
  * Dataflow analysis is the processes of determining the dependencies between program expressions.
  *
  * This pass needs to be run after [[AliasAnalysis]], [[DemandAnalysis]], and
  * [[TailCall]]. It also assumes that all members of [[IR.IRKind.Primitive]]
  * have been removed from the IR by the time it runs.
  */

When I run scalafmt by using the "format code" intention in IntelliJ.

Problem

Scalafmt leaves the comment that overflows 80 characters untouched.

Expectation

I would like the formatted output to look like this:

/** This pass implements dataflow analysis for Enso.
  *
  * Dataflow analysis is the processes of determining the dependencies between
  * program expressions.
  *
  * This pass needs to be run after [[AliasAnalysis]], [[DemandAnalysis]], and
  * [[TailCall]]. It also assumes that all members of [[IR.IRKind.Primitive]]
  * have been removed from the IR by the time it runs.
  */

Workaround

No workaround has been found beyond manually formatting comments.

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