gleam-lang/gleam

Support `textDocument/documentHighlight` message for usages of values

Closed

#5,441 建立於 2026年3月10日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Rust (21,417 star) (960 fork)batch import
help wanted

描述

When triggering the message over the usage of a variable in a scope, highlight all instances of that variable.

For example:

fn foo() {
  let bar = 5
  //  ^^^
  let baz = bar * 2
  //        ^^^
  // Cursor here ↓ (for example)
  let qux = case bar {
  //             ^^^
    a if bar == 2 -> a
    //   ^^^
    b if baz == 3 -> b
    _ -> 5
  }
  baz + quux(bar) + qux
  //         ^^^
}

fn quux(a) { todo }

See #5427.

貢獻者指南

Support `textDocument/documentHighlight` message for usages of values · gleam-lang/gleam#5441 | Good First Issue