[gnome-builder] clang: add CXTranslationUnit_DetailedPreprocessingRecord



commit b679f1270e5e92dc84067963200a535ec52fdb48
Author: Christian Hergert <christian hergert me>
Date:   Thu Mar 26 17:32:16 2015 -0700

    clang: add CXTranslationUnit_DetailedPreprocessingRecord
    
    I'm not totally sure we want to have this enabled, but it does need to
    be on so that we can get macro information (so we can highlight things
    like "GTK_WIDGET" appropriately).

 libide/clang/ide-clang-service.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libide/clang/ide-clang-service.c b/libide/clang/ide-clang-service.c
index 700666d..aaa8a2a 100644
--- a/libide/clang/ide-clang-service.c
+++ b/libide/clang/ide-clang-service.c
@@ -369,7 +369,16 @@ ide_clang_service_get_translation_unit_async (IdeClangService     *self,
   request->command_line_args = NULL;
   request->unsaved_files = ide_unsaved_files_get_unsaved_files (unsaved_files);
   request->sequence = ide_unsaved_files_get_sequence (unsaved_files);
-  request->options = clang_defaultEditingTranslationUnitOptions ();
+  /*
+   * NOTE:
+   *
+   * I'm torn on this one. It requires a bunch of extra memory, but without it
+   * we don't get information about macros.  And since we need that to provide
+   * quality highlighting, I'm going try try enabling it for now and see how
+   * things go.
+   */
+  request->options = (clang_defaultEditingTranslationUnitOptions () |
+                      CXTranslationUnit_DetailedPreprocessingRecord);
 
   g_task_set_task_data (task, request, parse_request_free);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]