diff --git a/src/indexer.cc b/src/indexer.cc index e6c53b68..00daf3ab 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -848,6 +848,7 @@ clang::VisiterResult VisitMacroDefinitionAndExpansions(clang::Cursor cursor, cla var_def->def.short_name = cursor.get_display_name(); var_def->def.detailed_name = var_def->def.short_name; var_def->def.is_local = false; + var_def->def.is_macro = true; var_def->def.definition_spelling = decl_loc_spelling; var_def->def.definition_extent = ResolveExtent(cursor.cx_cursor);; } diff --git a/tests/macros/complex.cc b/tests/macros/complex.cc index 4ecb2447..c0447a62 100644 --- a/tests/macros/complex.cc +++ b/tests/macros/complex.cc @@ -54,7 +54,7 @@ OUTPUT: "definition_spelling": "1:9-1:12", "definition_extent": "1:9-3:32", "is_local": false, - "is_macro": false, + "is_macro": true, "uses": ["1:9-1:12", "12:1-12:4"] }] } diff --git a/tests/macros/foo.cc b/tests/macros/foo.cc index 55be3ab6..55a5fef0 100644 --- a/tests/macros/foo.cc +++ b/tests/macros/foo.cc @@ -37,7 +37,7 @@ OUTPUT: "definition_spelling": "1:9-1:10", "definition_extent": "1:9-1:12", "is_local": false, - "is_macro": false, + "is_macro": true, "uses": ["1:9-1:10", "8:9-8:10"] }, { "id": 2, @@ -47,7 +47,7 @@ OUTPUT: "definition_spelling": "2:9-2:17", "definition_extent": "2:9-2:46", "is_local": false, - "is_macro": false, + "is_macro": true, "uses": ["2:9-2:17", "5:3-5:11"] }] } diff --git a/tests/preprocessor/include_guard.cc b/tests/preprocessor/include_guard.cc index f66bb71a..7c0621b7 100644 --- a/tests/preprocessor/include_guard.cc +++ b/tests/preprocessor/include_guard.cc @@ -14,7 +14,7 @@ OUTPUT: "definition_spelling": "2:9-2:12", "definition_extent": "2:9-2:12", "is_local": false, - "is_macro": false, + "is_macro": true, "uses": ["2:9-2:12"] }] } diff --git a/tests/usage/func_called_from_macro_argument.cc b/tests/usage/func_called_from_macro_argument.cc index b3f0bd72..99b839a1 100644 --- a/tests/usage/func_called_from_macro_argument.cc +++ b/tests/usage/func_called_from_macro_argument.cc @@ -38,7 +38,7 @@ OUTPUT: "definition_spelling": "1:9-1:19", "definition_extent": "1:9-1:24", "is_local": false, - "is_macro": false, + "is_macro": true, "uses": ["1:9-1:19", "6:3-6:13"] }] }