💾 Archived View for bbs.geminispace.org › u › Addison › 4036 captured on 2024-05-10 at 13:28:35. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-03-21)

➡️ Next capture (2024-05-26)

🚧 View Differences

-=-=-=-=-=-=-

Comment by 🐝 Addison

Re: "I want to have completion for my custom C language headers,..."

In: s/vim

@Arkaeriit I'm assuming that @Odintsoff is asking about code-completion for things declared in headers.

I only know how to do this with CMake, so YMMV but I know that YCM has other ways of configuring this.

If in your CMakeLists.txt you enable CMAKE_EXPORT_COMPILE_COMMANDS, CMake will create a file called compile_commands.json in your build directory. If you copy that JSON file to the root of your source tree, YCM will read the flags it contains and use them for completions.

So if my CMake config contains something like

include_directories(./include)

then compile_commands.json will contain

-I./include ...

And YCM will provide completions for that header.

🐝 Addison

2023-08-10 · 9 months ago

2 Later Comments ↓

🐦 Arkaeriit · 2023-08-11 at 18:08:

@Addison Thanks for the tip. It will be a good starting point.

🌲 Odintsoff [OP] · 2023-08-22 at 00:09:

Thanks all! I will try the tips provided and give some feedback. Thanks again!

Original Post

🌒 s/vim

I want to have completion for my custom C language headers, but I cannot see how to add it. I use CoC and it does help with the language headers, but not the ones in my project folder. How can I add them?

💬 Odintsoff · 9 comments · 2023-08-07 · 9 months ago