## 概要 referencesを参照する[[coc.nvim]]のコマンドは呼び出し元だけでなく定義元も表示されてしまう。たとえば、以下の`main.go`があったとき。 ```go package main import "fmt" func add(x int, y int) int { return x + y } func sub() int { return add(1, 2) } func main() { x := add(10, 20) y := sub() fmt.Printf("%d\n", x+y) } ``` `add`のreferecesを確認すると以下のようになる。 ![[Pasted image 20231121220521.png]] 一番上の結果は定義であり、他の2つは呼び出し元となる。この場合、定義はノイズでしかないので可能なら消したい。 ## 方法 第2引数に`true`を指定する。 ``` CocAction('references', true) ``` ## 参考 ```console :h CocAction('references') ``` ``` "references" [{excludeDeclaration}] *CocAction('references')* Get references location list of symbol under cursor. {excludeDeclaration}: exclude declaration locations when not zero. Return LSP `Location[]` ```