1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rtags, vim-lsp with clangd で C++ の reference 箇所を参照する際のメモ

Last updated at Posted at 2019-10-09

何が原因なのかよく分かっていないが、Vim で C++ を開いているとき、rtags や vim-lsp with clangd を使って reference を見る際に、一筋縄ではいかないのでうまくいくときのポイントをメモ。

rtags

関数の定義箇所で <Leader>rf (rtags#FindRefs) してもうまくいかなくて、宣言箇所だとうまくいく。
なので <Leader>rj -> <Leader>rf の順に飛んだほうがよさそう。

vim-lsp with clangd

関数の定義箇所や宣言箇所で :LspReferences してもうまくいかない。
どこか実際に reference している箇所からだとうまくいく。

int foobar();  // ここで :LspReferences してもだめ

int foobar() {  // ここで :LspReferences してもだめ
    return 0;
}

int main() {
    foobar();  // ここで :LspReferences するとうまくいく
    return 0;
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?