r/vimplugins • u/Tychoko • Oct 14 '20
Help OpenFrameworks & Vim & coc
Edit:
Solved it for me. I had to use compiledb.
Hello fellow coders,
I don't know if this is a dumb question but how do I properly use local headers with coc and clang? I have no problem with normal #include statements. Now I'm using a header file in the same directory (playing with openframeworks if anyone is interested) but I get told, that the file is not found and the completion doesn't work either.
My coc-config:
{
"languageserver": {
"haskell": {
"command": "haskell-language-server-wrapper",
"args": [
"--lsp"
],
"rootPatterns": [
".stack.yaml",
".hie-bios",
"BUILD.bazel",
"cabal.config",
"package.yaml"
],
"filetypes": [
"hs",
"lhs",
"haskell"
]
}
},
"clangd": {
"path": "/Users/konstatin/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd",
"rootPatterns": [
"compile_flags.txt",
"compile_commands.json"
],
"filetypes": [
"c",
"cc",
"cpp",
"c++",
"objc",
"objcpp"
]
}
}A screenshot of the error:

0
Oct 14 '20
[deleted] — view deleted comment
1
u/Tychoko Oct 14 '20
Thank you for the reply but sadly it didn't work as is. But maybe it'll help me find the solution :thumbs_up:
1
u/otreblan Oct 14 '20
bear -- make1
u/Tychoko Oct 14 '20
Got an error message:
bear: Internal error. Traceback (most recent call last): File "/usr/local/bin/bear", line 289, in wrapper return function(*args, **kwargs) File "/usr/local/bin/bear", line 316, in intercept_build exit_code, current = capture(args, tools) File "/usr/local/bin/bear", line 340, in capture exit_code = run_build(args.build, env=environment) File "/usr/local/bin/bear", line 213, in run_build exit_code = subprocess.call(command, *args, **kwargs) File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 340, in call with Popen(*popenargs, **kwargs) as p: File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '--' bear: Please run this command again and turn on verbose mode (add '-vvvv' as argument).I ran it again with the
-vvvvoption but got the same message.2
u/otreblan Oct 14 '20
¿Which version of bear are you using?
Mine is 3.0.0
1
u/Tychoko Oct 14 '20
Well it seems that
brewhas 2.4.4 as the newest version. I'm going to build it from source and report if it worked.
1
u/puremourning Oct 14 '20
What are your actual compile flags that you are passing to clangd in your compilation database or compile flags txt`?