Mark macros in index.

This commit is contained in:
Jacob Dufault 2017-06-28 23:28:29 -07:00
parent b5305e14f2
commit 6ab8a27313
5 changed files with 6 additions and 5 deletions

View File

@ -848,6 +848,7 @@ clang::VisiterResult VisitMacroDefinitionAndExpansions(clang::Cursor cursor, cla
var_def->def.short_name = cursor.get_display_name(); var_def->def.short_name = cursor.get_display_name();
var_def->def.detailed_name = var_def->def.short_name; var_def->def.detailed_name = var_def->def.short_name;
var_def->def.is_local = false; var_def->def.is_local = false;
var_def->def.is_macro = true;
var_def->def.definition_spelling = decl_loc_spelling; var_def->def.definition_spelling = decl_loc_spelling;
var_def->def.definition_extent = ResolveExtent(cursor.cx_cursor);; var_def->def.definition_extent = ResolveExtent(cursor.cx_cursor);;
} }

View File

@ -54,7 +54,7 @@ OUTPUT:
"definition_spelling": "1:9-1:12", "definition_spelling": "1:9-1:12",
"definition_extent": "1:9-3:32", "definition_extent": "1:9-3:32",
"is_local": false, "is_local": false,
"is_macro": false, "is_macro": true,
"uses": ["1:9-1:12", "12:1-12:4"] "uses": ["1:9-1:12", "12:1-12:4"]
}] }]
} }

View File

@ -37,7 +37,7 @@ OUTPUT:
"definition_spelling": "1:9-1:10", "definition_spelling": "1:9-1:10",
"definition_extent": "1:9-1:12", "definition_extent": "1:9-1:12",
"is_local": false, "is_local": false,
"is_macro": false, "is_macro": true,
"uses": ["1:9-1:10", "8:9-8:10"] "uses": ["1:9-1:10", "8:9-8:10"]
}, { }, {
"id": 2, "id": 2,
@ -47,7 +47,7 @@ OUTPUT:
"definition_spelling": "2:9-2:17", "definition_spelling": "2:9-2:17",
"definition_extent": "2:9-2:46", "definition_extent": "2:9-2:46",
"is_local": false, "is_local": false,
"is_macro": false, "is_macro": true,
"uses": ["2:9-2:17", "5:3-5:11"] "uses": ["2:9-2:17", "5:3-5:11"]
}] }]
} }

View File

@ -14,7 +14,7 @@ OUTPUT:
"definition_spelling": "2:9-2:12", "definition_spelling": "2:9-2:12",
"definition_extent": "2:9-2:12", "definition_extent": "2:9-2:12",
"is_local": false, "is_local": false,
"is_macro": false, "is_macro": true,
"uses": ["2:9-2:12"] "uses": ["2:9-2:12"]
}] }]
} }

View File

@ -38,7 +38,7 @@ OUTPUT:
"definition_spelling": "1:9-1:19", "definition_spelling": "1:9-1:19",
"definition_extent": "1:9-1:24", "definition_extent": "1:9-1:24",
"is_local": false, "is_local": false,
"is_macro": false, "is_macro": true,
"uses": ["1:9-1:19", "6:3-6:13"] "uses": ["1:9-1:19", "6:3-6:13"]
}] }]
} }