[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:
parent
817060db2c
commit
2268dfc27a
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue