question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implementation provider not found for current document, although definition is found

See original GitHub issue

I have been looking for info on this everywhere, without much success so far, so I am opening this issue.

I just installed coc, clangd and coc-clangd on a fresh nvim install and configured keybinds, etc. and I have the following keybinds in my init.vim: nmap <silent> gd <Plug>(coc-definition) nmap <silent> gy <Plug>(coc-type-definition) nmap <silent> gi <Plug>(coc-implementation) nmap <silent> gr <Plug>(coc-references) I am able to go to the definition of any function, be it my own or one in a library. However, I am unable go to the function’s implementation. Whenever I do, I get the error message “Implementation provider not found for current document” (it looks like this if that is any useful). I feel like when I’m able to find the definition of the function, I should also be able to find its implementation.

Logs I wasn’t able to get any meaningful information from either coc or clangd log.

System information Clangd version : 10.0.1 coc.nvim version: 0.0.78-9f9d8a32c4 Operating system: linux

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
tao-guocommented, Sep 22, 2020

I found out that if both Foo.cpp and Foo.h are parsed, “gd” will go back and forth between implementation and declaration among the two files. Since Foo.h is usually included in Foo.cpp, there is no issue if Foo.cpp is being opened. However, if only Foo.h is being opened, you will not find the implementation from coc-definition.

Right now, I can manually switch to Foo.cpp by using clangd.switchSourceHeader and go back to search again to find the implementation. It is kind of annoying however. Is there a way to activate the Foo.cpp parsing automatically or ask coc-clangd to do it in the background?

3reactions
bneradtcommented, Jan 7, 2022

Just to emphasize this in case it’s helpful to others: @tao-guo 's comment is extremely helpful. I hope that a lot of people trying to jump to the implementation find this, because it wasn’t obvious to me that gi wouldn’t work but multiple calls gd would shift between declaration and implementation:

I found out that if both Foo.cpp and Foo.h are parsed, “gd” will go back and forth between implementation and declaration among the two files. Since Foo.h is usually included in Foo.cpp, there is no issue if Foo.cpp is being opened. However, if only Foo.h is being opened, you will not find the implementation from coc-definition.

Read more comments on GitHub >

github_iconTop Results From Across the Web

coc-nvim empty actions, implementation and type definition ...
Output in a vue file with vetur is similiar, I get type definition provider not found, implementation provider not found. I also find...
Read more >
neoclide/coc.nvim - Gitter
[coc.nvim] Definition provider not found for current document. Any suggestions on how to fix this, or thoughts on what I'm doing incorrectly?
Read more >
coc.nvim with pyright - Vi and Vim Stack Exchange
Pyright doesn't support coc-implementation yet. ... A simple way to find your implementations of a class is to use coc-references instead.
Read more >
FileSystems (Java Platform SE 7 ) - Oracle Help Center
The providers are loaded and instantiated in the order they are listed in the property. If this process fails or a provider's scheme...
Read more >
RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1
However, HTTP/1.0 does not sufficiently take into consideration the effects of ... are allowed, but do not contribute to the count of elements...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found