Skip to content

[1.9.x] Missing range in BSP diagnostic #7297

@adpi2

Description

@adpi2

Since sbt 1.9.0

steps

  1. In an sbt project
package example 

class A {
  def foo: String = ""
}

class AA extends A {
  val foo: String = ""
}
  1. Import the project in Metals using sbt as the build server

problem

The missing override error is reported at the very top of the file (range 0, 0).

package example
// ^^^^
// overriding method foo in class A of type => String;
//   value foo needs `override' modifier

expectation

The error should be reported on def foo:

class AA extends A {
  def foo: String = ""
// ^^^^^^^^^^^^^^^^^
// overriding method foo in class A of type => String;
//  method foo needs `override' modifiersbt
}

notes

The bug was introduced in sbt 1.9.0, it works as expected in sbt 1.8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions