1
0
Fork 0

[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).
This commit is contained in:
Tom Willemse 2023-05-25 00:14:46 -07:00
parent 817060db2c
commit 2268dfc27a

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2022.0926.132722 ;; Version: 2023.0505.164419
;; Package-Requires: (groovy-mode oni-embrace oni-smartparens groovy-imports rainbow-delimiters jenkinsfile-mode) ;; 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 ;; This program is free software; you can redistribute it and/or modify
@ -88,5 +88,13 @@
(with-eval-after-load 'grep (with-eval-after-load 'grep
(add-to-list 'grep-files-aliases '("groovy" . "*.groovy *.pipeline Jenkinsfile"))) (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) (provide 'oni-groovy)
;;; oni-groovy.el ends here ;;; oni-groovy.el ends here