ccls/index_tests/enums/enum_usage.cc

73 lines
1.6 KiB
C++
Raw Normal View History

2018-03-31 03:16:33 +00:00
enum class Foo {
A,
B = 20
};
Foo x = Foo::A;
/*
OUTPUT:
{
"includes": [],
2018-07-07 23:56:47 +00:00
"skipped_ranges": [],
2018-07-08 19:49:27 +00:00
"usr2func": [],
2018-07-07 23:56:47 +00:00
"usr2type": [{
"usr": 16985894625255407295,
"detailed_name": "enum class Foo : int {}",
2018-07-07 23:56:47 +00:00
"qual_name_offset": 11,
2018-03-31 03:16:33 +00:00
"short_name": "Foo",
"spell": "1:12-1:15|1:1-4:2|2|-1",
2018-03-31 03:16:33 +00:00
"bases": [],
"funcs": [],
"types": [],
2018-03-31 03:16:33 +00:00
"vars": [],
"alias_of": 0,
"kind": 10,
"parent_kind": 0,
"declarations": [],
"derived": [],
"instances": [10677751717622394455],
"uses": ["6:1-6:4|4|-1", "6:9-6:12|4|-1"]
2018-03-31 03:16:33 +00:00
}],
"usr2var": [{
2018-03-31 03:16:33 +00:00
"usr": 439339022761937396,
"detailed_name": "Foo::A",
"qual_name_offset": 0,
2018-03-31 03:16:33 +00:00
"short_name": "A",
"hover": "Foo::A = 0",
"spell": "2:3-2:4|2:3-2:4|1026|-1",
2018-07-07 23:56:47 +00:00
"type": 0,
2018-03-31 03:16:33 +00:00
"kind": 22,
"parent_kind": 10,
"storage": 0,
"declarations": [],
"uses": ["6:14-6:15|4|-1"]
2018-03-31 03:16:33 +00:00
}, {
"usr": 10677751717622394455,
"detailed_name": "Foo x",
"qual_name_offset": 4,
2018-03-31 03:16:33 +00:00
"short_name": "x",
"hover": "Foo x = Foo::A",
"spell": "6:5-6:6|6:1-6:15|2|-1",
"type": 16985894625255407295,
2018-03-31 03:16:33 +00:00
"kind": 13,
"parent_kind": 0,
"storage": 0,
"declarations": [],
"uses": []
}, {
"usr": 15962370213938840720,
2018-07-07 23:56:47 +00:00
"detailed_name": "Foo::B = 20",
"qual_name_offset": 0,
"short_name": "B",
"spell": "3:3-3:4|3:3-3:9|1026|-1",
2018-07-07 23:56:47 +00:00
"type": 0,
"kind": 22,
"parent_kind": 10,
"storage": 0,
"declarations": [],
"uses": []
2018-03-31 03:16:33 +00:00
}]
}
*/