ccls/tests/foobar.cc

63 lines
1.2 KiB
C++
Raw Normal View History

2017-03-05 22:49:23 +00:00
enum A {};
enum B {};
2017-02-20 00:56:56 +00:00
2017-03-05 22:49:23 +00:00
template<typename T>
struct Foo {
struct Inner {};
};
Foo<A>::Inner a;
Foo<B> b;
2017-02-20 00:56:56 +00:00
/*
OUTPUT:
{
2017-03-05 22:49:23 +00:00
"types": [{
2017-02-20 00:56:56 +00:00
"id": 0,
2017-03-05 22:49:23 +00:00
"usr": "c:@E@A",
"short_name": "A",
"qualified_name": "A",
"definition": "1:1:6",
"uses": ["*1:1:6", "*1:9:5"]
2017-02-20 02:00:58 +00:00
}, {
"id": 1,
2017-03-05 22:49:23 +00:00
"usr": "c:@E@B",
"short_name": "B",
"qualified_name": "B",
"definition": "1:2:6",
"uses": ["*1:2:6", "*1:10:5"]
2017-02-20 06:24:05 +00:00
}, {
"id": 2,
2017-03-05 22:49:23 +00:00
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:5:8",
"uses": ["*1:5:8", "*1:9:1", "*1:10:1"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo@S@Inner",
"short_name": "Inner",
"qualified_name": "Foo::Inner",
"definition": "1:6:10",
"uses": ["*1:6:10", "*1:9:9"]
2017-02-20 00:56:56 +00:00
}],
2017-03-05 22:49:23 +00:00
"functions": [],
"variables": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:9:15",
"variable_type": 3,
"uses": ["1:9:15"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:10:8",
"variable_type": 2,
"uses": ["1:10:8"]
}]
}
2017-03-06 06:34:17 +00:00
*/