MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.78k stars 260 forks source link

The issue for the file .ccls and compile_commands.json which compiler is tricore-gcc #686

Closed jiangjianshan closed 4 years ago

jiangjianshan commented 4 years ago

**Hello,

System information

the .ccls file I written is here: image

the piece of compile_commands.json is here: image

the piece of coc-settings.json is here: "languageserver": { "ccls": { "command": "ccls", "filetypes": [ "c", "cpp", "objc", "objcpp" ], "rootPatterns": [ ".ccls", "compile_commands.json", ".git/", ".svn/", ".hg/" ], "initializationOptions": { "cache": { "directory": ".ccls-cache" }, "cacheFormat": "json", "clang": { "extraArgs": [ "-nostdinc++" ], "excludeArgs": [] }, "client": { "snippetSupport": true }, "completion": { "placeholder": false, "detailedLabel": false, "filterAndSort": false }, "index": { "onChange": true, "trackDependency": 1 } } } }

I have put .ccls and compile_commands.json into the project root directory, they can't work because if I want to jump to one of definition, it will throw out such kind of error: image

I think there should be something wrong with my .ccls and compile_commands.json which is using C compiler which name is 'tricore-gcc.exe'. What is the correct setting for these two files? I have look through the wiki inside ccls github but can't find the answer.

MaskRay commented 4 years ago

Hello. The first line of .ccls should be %compile_commands.json, instead of %compile_commands.json%

jiangjianshan commented 4 years ago

@MaskRay , sorry for late reply. Why the issue has been closed? I write the issue a long time ago and take some times to see whether there are some reply but don't have them for a long days. I have actually use "%compile_commands.json%" as the picture showing there.

madscientist commented 4 years ago

Please re-read MaskRay's comment. You wrote %compile_commands.json%. That's wrong. It should be %compile_commands.json (no trailing percent sign).

Please check the docs more carefully and you'll see that they do not use a trailing percent (if you find some docs that are wrong please provide a link to said docs).

jiangjianshan commented 4 years ago

@madscientist , thanks for your hint.