gleam-lang/gleam

Support `textDocument/documentHighlight` message for usages of values

已关闭

#5,441 创建于 2026年3月10日

 (3 条评论) (0 个反应) (0 位负责人)Rust (960 个派生)batch import
help wanted

仓库指标

星标
 (21,417 个星标)
PR 合并指标
 (平均合并 10天 19小时) (30 天内合并 69 个 PR)

描述

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.

贡献者指南