[gnome-builder/wip/libide: 125/153] libide: add text to diagnostic



commit 03ff21daa9f63ec64b1be7b935cdd2539be2c38e
Author: Christian Hergert <christian hergert me>
Date:   Wed Feb 11 23:36:29 2015 -0800

    libide: add text to diagnostic

 libide/clang/ide-clang-translation-unit.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libide/clang/ide-clang-translation-unit.c b/libide/clang/ide-clang-translation-unit.c
index 756eeb1..2d72c97 100644
--- a/libide/clang/ide-clang-translation-unit.c
+++ b/libide/clang/ide-clang-translation-unit.c
@@ -97,6 +97,8 @@ create_diagnostic (IdeClangTranslationUnit *self,
 {
   enum CXDiagnosticSeverity cxseverity;
   IdeDiagnosticSeverity severity;
+  g_autoptr(gchar) spelling = NULL;
+  CXString cxstr;
 
   g_return_val_if_fail (IDE_IS_CLANG_TRANSLATION_UNIT (self), NULL);
   g_return_val_if_fail (cxdiag, NULL);
@@ -104,7 +106,11 @@ create_diagnostic (IdeClangTranslationUnit *self,
   cxseverity = clang_getDiagnosticSeverity (cxdiag);
   severity = translate_severity (cxseverity);
 
-  return _ide_diagnostic_new (severity);
+  cxstr = clang_getDiagnosticSpelling (cxdiag);
+  spelling = g_strdup (clang_getCString (cxstr));
+  clang_disposeString (cxstr);
+
+  return _ide_diagnostic_new (severity, spelling);
 }
 
 /**


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