Skip to content

Force annotations onto their own lines for block expressions and parameter clauses #12

@daniel-trinh

Description

@daniel-trinh

Annotations for expressions in blocks and parameter clauses currently are placed on the same line:

def asdf(
  @annotation one: Int,
  @a @b(c) two: String
)

class A extends B {
  @SomeImportantAnnotation(param = true) override val param: Int = 1

  @NotSoImportantAnnotation(param = false) val description: String = "Not so important"
}

Instead, it should be formatted as..

def asdf(
  @annotation 
  one: Int,
  @a 
  @b(c) 
  two: String
)

class A extends B {
  @SomeImportantAnnotation(param = true) 
  override val param: Int = 1

  @NotSoImportantAnnotation(param = false) 
  val description: String = "Not so important"
}

This would most likely only affect parameters that are already placed on their own line, so
something like this wouldn't be affected:

def asdf(@annotation one: Int, @a @b(c) two: String)

stays as..

def asdf(@annotation one: Int, @a @b(c) two: String)

Implementation details note: this needs to be implemented without breaking the AlignParameters feature

See here for similar issue on original branch: scala-ide#91

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions