Kalcifer
Kalcifer

Reputation: 1620

How do you allow Neovim CoC to see include directories

Coc in Neovim seems to be unable to see #include <avr/io.h> since I'm guessing that it's include path isn't known by coc. How can I allow coc to see this include path?

Upvotes: 0

Views: 4957

Answers (1)

Kalcifer
Kalcifer

Reputation: 1620

A solution was found to be the following:

  1. In the root of your project directory (the base of compilation) add a file called compile_flags.txt.
  2. To the compile_flags.txt file, for the AVR includes, add -I/usr/avr/include.

NOTE: The compile_flags.txt file only accepts a single argument per line, so the actual contents of this file should be

-I
/usr/avr/include

References: JSON Compilation Database Format Specification

Upvotes: 3

Related Questions