I am using neovim (lunarvim ide layer), I want to work with ‘openFrameworks’ library. To not get linter warning on header file includes (look at example below), I am adding all possible header files to my $CPLUS_INCLUDE_PATH
and $LIBRARY_PATH
(code shown below).
Is there a better way I can achieve my LSP knowing the header file contents? vs-Code somehow achieves all that.
I want to achieve this in neovim. In this temporary fix, whenever a new header is not in path, I have to find
it in the library folder and add to my ~/.bashrc
, so I am struggling.
Please help.
The warnings:
![warnings-on-neovim-linter-header-files-includes][https://i.stack.imgur.com/jKZ2K.png]
The annoying temporary fix, is there anything better that I can do?
# ~/.bashrc
# openFrameworks
openFrameworks="/opt/homebrew/Caskroom/openframeworks/0.12.0/of_v0.12.0_osx_release"
include_dirs=(
"/libs/openFrameworks/"
"/libs/openFrameworks/math"
"/libs/openFrameworks/utils"
...
"/libs/uriparser/include"
"/libs/glm/include"
"/libs/FreeImage/include"
)
include_path=""
for dir in "${include_dirs[@]}"; do
include_path+=":${openFrameworks}/${dir}"
done
export LIBRARY_PATH="$include_path:$LIBRARY_PATH"
export CPLUS_INCLUDE_PATH="$include_path:$CPLUS_INCLUDE_PATH"
I had tried bear
, but I am getting the following error:
RPC[Error] code_name = UnknownErrorCode, message = "Failed to parse includes"
Edit1: Also, although the linter errors on header includes have gone away, the LSP features like autocompletion etc, are not working. How do I let my editor (neovim - lunarvim) know about those header files, or should I give and switch to an IDE?
Edit2: related: (not fixed) Lsp RPC error codes printed at neovim exit (starting from 0.8.0 ?)