mirror of
https://github.com/MaskRay/ccls.git
synced 2025-08-17 20:22:23 +00:00
Build llvm-project ``` ninja -C out/stable clang clangFormat clangIndex clangTooling ``` Then build ccls against the just-built llvm-project. ``` cmake -S. -Bout/debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=$HOME/Stable/bin/clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DCMAKE_PREFIX_PATH="$HOME/llvm/out/stable;$HOME/llvm/out/stable/tools/clang" -DCLANG_EXECUTABLE=$HOME/Stable/bin/clang++ ``` Finally, run `ccls -test-index`
85 lines
1.9 KiB
C++
85 lines
1.9 KiB
C++
namespace hello {
|
|
void foo(int a, int b);
|
|
}
|
|
|
|
/*
|
|
OUTPUT:
|
|
{
|
|
"includes": [],
|
|
"skipped_ranges": [],
|
|
"usr2func": [{
|
|
"usr": 18343102288837190527,
|
|
"detailed_name": "void hello::foo(int a, int b)",
|
|
"qual_name_offset": 5,
|
|
"short_name": "foo",
|
|
"bases": [],
|
|
"vars": [11261617957951052010, 6927976078246688450],
|
|
"callees": [],
|
|
"kind": 12,
|
|
"parent_kind": 0,
|
|
"storage": 0,
|
|
"declarations": ["2:6-2:9|2:1-2:23|1025|-1"],
|
|
"derived": [],
|
|
"uses": []
|
|
}],
|
|
"usr2type": [{
|
|
"usr": 452,
|
|
"detailed_name": "",
|
|
"qual_name_offset": 0,
|
|
"short_name": "",
|
|
"bases": [],
|
|
"funcs": [],
|
|
"types": [],
|
|
"vars": [],
|
|
"alias_of": 0,
|
|
"kind": 0,
|
|
"parent_kind": 0,
|
|
"declarations": [],
|
|
"derived": [],
|
|
"instances": [11261617957951052010, 6927976078246688450],
|
|
"uses": []
|
|
}, {
|
|
"usr": 2029211996748007610,
|
|
"detailed_name": "namespace hello {}",
|
|
"qual_name_offset": 10,
|
|
"short_name": "hello",
|
|
"bases": [],
|
|
"funcs": [18343102288837190527],
|
|
"types": [],
|
|
"vars": [],
|
|
"alias_of": 0,
|
|
"kind": 3,
|
|
"parent_kind": 0,
|
|
"declarations": ["1:11-1:16|1:1-3:2|1|-1"],
|
|
"derived": [],
|
|
"instances": [],
|
|
"uses": []
|
|
}],
|
|
"usr2var": [{
|
|
"usr": 6927976078246688450,
|
|
"detailed_name": "int b",
|
|
"qual_name_offset": 4,
|
|
"short_name": "b",
|
|
"spell": "2:21-2:22|2:17-2:22|1026|-1",
|
|
"type": 452,
|
|
"kind": 253,
|
|
"parent_kind": 12,
|
|
"storage": 0,
|
|
"declarations": [],
|
|
"uses": []
|
|
}, {
|
|
"usr": 11261617957951052010,
|
|
"detailed_name": "int a",
|
|
"qual_name_offset": 4,
|
|
"short_name": "a",
|
|
"spell": "2:14-2:15|2:10-2:15|1026|-1",
|
|
"type": 452,
|
|
"kind": 253,
|
|
"parent_kind": 12,
|
|
"storage": 0,
|
|
"declarations": [],
|
|
"uses": []
|
|
}]
|
|
}
|
|
*/
|