Skip to content

Instantly share code, notes, and snippets.

@ktemkin
Created January 16, 2019 15:24
Show Gist options
  • Save ktemkin/ee616be9bdee4e18920566ca7fe631c3 to your computer and use it in GitHub Desktop.
Save ktemkin/ee616be9bdee4e18920566ca7fe631c3 to your computer and use it in GitHub Desktop.
ccls config for GreatFET
%compile_commands.json
%c %cpp %h %hpp -I/usr/local/Cellar/arm-none-eabi-gcc/20150921/arm-none-eabi/include/
// Use ccls instead of clangd.
"language.c.languageServer.command": "/usr/local/bin/ccls",
"language.cpp.languageServer.command": "/usr/local/bin/ccls",
"language.c.languageServer.rootFiles": [".ccls", ".ccls-root", "compile_commands.json"]
"language.cpp.languageServer.rootFiles": [".ccls", ".ccls-root", "compile_commands.json"],
// allow completion of object members
"language.c.completionTriggerCharacters": [".", ">", ":"],
"language.cpp.completionTriggerCharacters": [".", ">", ":"],
// Use our local resource path for clang.
"language.c.languageServer.arguments": [ `--init={"clang": {"resourceDir": "/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1/"}}` ],
"language.cpp.languageServer.arguments": [ `--init={"clang": {"resourceDir": "/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1/"}}` ],
// richer C/C++ syntax highligting
"editor.textMateHighlighting.enabled": false,
"language.c.textMateGrammar": "/Users/ktemkin/.config/oni/extensions/c/syntaxes/c.tmLanguage.json",
"language.cpp.textMateGrammar": "/Users/ktemkin/.config/oni/extensions/cpp/syntaxes/cpp.tmLanguage.json",
- tap that has ccls: `brew tap twlz0ne/homebrew-ccls`
- build from head; possibly don't use system clang (`brew install ccls --without-system-clang --HEAD`)
- provide resource path to make sure we get the right things
- run cmake with the option to export compile commands (-DCMAKE_EXPORT_COMPILE_COMMANDS=YES)
- symlink compile commands to the project root (`ln -sfr compile_commands.json ~/Projects/greatfet`)
- put the project root file in the right place (`.ccls`)
- it may help to have TextMate Grammars (`https://raw.githubusercontent.com/theia-ide/theia/master/packages/cpp/data/c.tmLanguage.json`)
- make sure the oni config is right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment