-5

I am using neovim for a while now and lately coding a bit more in C++.
When I use a function in the code that I realize I haven't yet declared/defined clangd gives the typical Use of undeclared identifier ... error in nvim. However I'd like to know whether there is a plugin or smth builtin that provides a quick fix for this. I.e. as I already typed out the name of the (still missing) function that then auto generates the declaration and definition in the header and cpp file. I know that depends a bit on context what is typically desirable, but often I find this is quite repetitive for me and would save me some time.

3
  • Possibly not quite what you're looking for, but have you seen this issue? Commented Nov 14 at 12:13
  • Depends on whether 1) clangd supports such a thing, and 2) Neovim has mappings for these (gra looks promising). If not, you need to come up with something yourself. Having said that, "which shortcut does X?" questions are usually not well-received. Take the tour, read How to Ask. Commented Nov 14 at 12:16
  • github.com/clangd/clangd/issues/467 is an open clangd issue about a proposed code action that's a closer fit for what you're asking for Commented 18 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.