Skip to content

Support textDocument/documentHighlight message for definitions of types #5446

@gavinmorrow

Description

@gavinmorrow

When triggering the message over the definition of a type in a file, highlight all instances of that type.

For example:

// Cursor here (for example)
//    ↓
type Foobar {
//   ^^^^^^
  Foo
  Bar
}

type Qux(a) {
  Qux(Foobar, a)
  //  ^^^^^^
}

const foo: Foobar = Foo
//         ^^^^^^

fn baz(foo: Foobar) -> Foobar {
//          ^^^^^^     ^^^^^^
  let quux: Foobar = foo
  //        ^^^^^^
  let qux: Qux(Foobar) = Qux(quux, foo)
  //           ^^^^^^
  case qux {
    Qux(Foo, Foo) -> Bar
    Qux(Bar, Bar) -> Foo
    _ → Foo
  }
}

See #5427.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions