aboutsummaryrefslogtreecommitdiffstats
path: root/oni-groovy.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-05-25 00:14:46 -0700
committerGravatar Tom Willemse2023-05-25 00:14:46 -0700
commit2268dfc27a90bc9a9d39046bf7deb20e7b635dcd (patch)
tree579b86c997bc79b3ba349929c1d10689b72ddc82 /oni-groovy.el
parent817060db2c5fb4b65473e13dfddfe1b0760ab464 (diff)
downloademacs-config-2268dfc27a90bc9a9d39046bf7deb20e7b635dcd.tar.gz
emacs-config-2268dfc27a90bc9a9d39046bf7deb20e7b635dcd.zip
[oni-groovy] Add regexp for top-level functions
In the Groovy used with Jenkins it seems quite common for there to be top-level functions that aren't explicitly in classes (they still are implicitly).
Diffstat (limited to 'oni-groovy.el')
-rw-r--r--oni-groovy.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/oni-groovy.el b/oni-groovy.el
index b8f5211..57844a8 100644
--- a/oni-groovy.el
+++ b/oni-groovy.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2022.0926.132722
+;; Version: 2023.0505.164419
;; Package-Requires: (groovy-mode oni-embrace oni-smartparens groovy-imports rainbow-delimiters jenkinsfile-mode)
;; This program is free software; you can redistribute it and/or modify
@@ -88,5 +88,13 @@
(with-eval-after-load 'grep
(add-to-list 'grep-files-aliases '("groovy" . "*.groovy *.pipeline Jenkinsfile")))
+(setf (alist-get "Functions" groovy-imenu-regexp nil nil #'string=)
+ (list (rx line-start "def"
+ (minimal-match (one-or-more whitespace))
+ (group alpha (minimal-match (zero-or-more alphanumeric)))
+ (minimal-match (zero-or-more whitespace))
+ "(")
+ 1))
+
(provide 'oni-groovy)
;;; oni-groovy.el ends here