branch: elpa/d-mode
commit 1407db27599cd01a729ecc1a0399d68606920ff9
Author: Vladimir Panteleev <[email protected]>
Commit: Vladimir Panteleev <[email protected]>
Add enums to imenu
---
d-mode.el | 18 +++++++++++++++++-
tests/imenu.d | 7 ++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index e35392e..4eba223 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <[email protected]>
;; Vladimir Panteleev <[email protected]>
;; Created: March 2007
-;; Version: 201610111931
+;; Version: 201610111943
;; Keywords: D programming language emacs cc-mode
;;;; NB Version number is date and time yyyymmddhhMM UTC.
@@ -619,6 +619,22 @@ The expression is added to
`compilation-error-regexp-alist' and
(?A . ?Z)
(?a . ?z)))))
1)
+ ("*Enums*"
+ ,(rx
+ line-start
+ (zero-or-more (syntax whitespace))
+ word-start
+ "enum"
+ (one-or-more (syntax whitespace))
+ (submatch
+ (one-or-more
+ (any ?_
+ (?0 . ?9)
+ (?A . ?Z)
+ (?a . ?z))))
+ (zero-or-more (any " \t\n"))
+ (or ":" "{"))
+ 1)
(nil d-imenu-method-index-function 2)))
;;----------------------------------------------------------------------------
diff --git a/tests/imenu.d b/tests/imenu.d
index 44d997c..7325796 100644
--- a/tests/imenu.d
+++ b/tests/imenu.d
@@ -1,5 +1,5 @@
// #run: (d-test-get-imenu-lines)
-// #out: (4 6 11 14 17 19 22 25 33 34)
+// #out: (4 6 11 14 17 19 22 25 33 34 37 40)
void foo(int x) {}
@@ -34,3 +34,8 @@ version(StdDdoc) string readLink(C)(const(C)[] link) @safe;
else version(Posix) string readLink(C)(const(C)[] link) @safe
{}
+enum ClockType
+{}
+
+enum Foo : int
+{}