emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master b1127da 16/29: Don't show (anonymous) as function annotati


From: Dmitry Gutov
Subject: [elpa] master b1127da 16/29: Don't show (anonymous) as function annotation, or in argument expansions
Date: Tue, 28 Mar 2017 20:50:35 -0400 (EDT)

branch: master
commit b1127da1cbb6e4f0a43a5a9223b5fec515e30818
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Don't show (anonymous) as function annotation, or in argument expansions
    
    Fixes #628
---
 company-clang.el    | 1 +
 test/clang-tests.el | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/company-clang.el b/company-clang.el
index 1cb24c9..599491d 100644
--- a/company-clang.el
+++ b/company-clang.el
@@ -161,6 +161,7 @@ or automatically through a custom 
`company-clang-prefix-guesser'."
      ((null meta) nil)
      ((string-match "[^:]:[^:]" meta)
       (substring meta (1+ (match-beginning 0))))
+     ((string-match "(anonymous)" meta) nil)
      ((string-match "\\((.*)[ a-z]*\\'\\)" meta)
       (let ((paren (match-beginning 1)))
         (if (not (eq (aref meta (1- paren)) ?>))
diff --git a/test/clang-tests.el b/test/clang-tests.el
index 2b8b105..86f7382 100644
--- a/test/clang-tests.el
+++ b/test/clang-tests.el
@@ -43,3 +43,9 @@
 (ert-deftest company-clang-null-annotation ()
   (let ((str "char"))
     (should (null (company-clang 'annotation str)))))
+
+(ert-deftest company-clang-anon-union-annotation ()
+  (let ((u (propertize "u" 'meta "union (anonymous) u"))
+        (s (propertize "s" 'meta "struct (anonymous) s")))
+    (should (null (company-clang 'annotation u)))
+    (should (null (company-clang 'annotation s)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]