diff options
| author | Felix S Klock II <pnkfelix@pnkfx.org> | 2018-12-18 12:08:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-18 12:08:31 +0100 |
| commit | d3a70256fe560bcc463ed42e4259e9fce0fdfee3 (patch) | |
| tree | d298fed06b6ac2aaf643f6ec8560106e926eec27 /rust-mode.el | |
| parent | 12cb16964ce01f0e484b082ccc8a3430cc1c4158 (diff) | |
| parent | b44573743ed9146aea0470910ee073792ab46e66 (diff) | |
| download | rust-mode-d3a70256fe560bcc463ed42e4259e9fce0fdfee3.tar.gz | |
Merge pull request #292 from mookid/imenu-impl
imenu: handle lifetimes in impl blocks.
Diffstat (limited to 'rust-mode.el')
| -rw-r--r-- | rust-mode.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el index 8af6610..a8af671 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -39,6 +39,8 @@ (defconst rust-re-vis "pub") (defconst rust-re-unsafe "unsafe") (defconst rust-re-extern "extern") +(defconst rust-re-generic + (concat "<[[:space:]]*'" rust-re-ident "[[:space:]]*>")) (defconst rust-re-union (rx-to-string `(seq @@ -561,7 +563,9 @@ buffer." (defun rust-re-grab (inner) (concat "\\(" inner "\\)")) (defun rust-re-shy (inner) (concat "\\(?:" inner "\\)")) (defun rust-re-item-def (itype) - (concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident))) + (concat (rust-re-word itype) + (rust-re-shy rust-re-generic) "?" + "[[:space:]]+" (rust-re-grab rust-re-ident))) (defun rust-re-item-def-imenu (itype) (concat "^[[:space:]]*" (rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?" |
