[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode b445737 376/486: imenu: handle lifetimes in impl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode b445737 376/486: imenu: handle lifetimes in impl blocks. |
Date: |
Sat, 7 Aug 2021 09:25:56 -0400 (EDT) |
branch: elpa/rust-mode
commit b44573743ed9146aea0470910ee073792ab46e66
Author: Nathan Moreau <nathan.moreau@m4x.org>
Commit: Nathan Moreau <nathan.moreau@m4x.org>
imenu: handle lifetimes in impl blocks.
---
rust-mode-tests.el | 14 ++++++++++++++
rust-mode.el | 6 +++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 64d65c4..9d87960 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3061,6 +3061,20 @@ extern \"rust-intrinsic\" fn five() {
"four"
"five"))))
+(ert-deftest rust-test-imenu-impl-with-lifetime ()
+ (test-imenu
+ "
+impl<'a> One<'a> {
+ fn one() {}
+}
+
+impl Two<'a> {
+ fn two() {}
+}
+"
+ '(("Impl" "One" "Two")
+ ("Fn" "one" "two"))))
+
(when (executable-find rust-cargo-bin)
(ert-deftest rust-test-project-located ()
(lexical-let* ((test-dir (expand-file-name "test-project"
default-directory))
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:]]+")) "?"
- [nongnu] elpa/rust-mode 6bcb82b 350/486: Merge pull request #249 from brotzeit/rust--format-call, (continued)
- [nongnu] elpa/rust-mode 6bcb82b 350/486: Merge pull request #249 from brotzeit/rust--format-call, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 705f3e4 352/486: Improved font-locking for print macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2fe1f9d 355/486: add dyn to keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0d408d5 357/486: Merge pull request #253 from jjwest/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 42c98bb 362/486: Merge pull request #263 from nikomatsakis/tweak-compilation-regexp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3613551 365/486: throw error in after-save-hook instead of before-save-hook, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 64b4a24 368/486: Merge pull request #272 from tromey/let-ref-font-lock, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 106aeab 369/486: Merge pull request #267 from jthemphill/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 256db76 371/486: Merge pull request #281 from ksqsf/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5d0406f 374/486: adjust docstring formatting, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b445737 376/486: imenu: handle lifetimes in impl blocks.,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 72f795d 378/486: Add rust-run and rust-test interactive function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e2e713e 384/486: refer to (point-min) instead of 1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 497d476 388/486: Reverted back to font-lock-fontify-buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d432409 391/486: Don't insert string delimiter inside strings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 63deaf3 382/486: Remove old comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 55e6cd9 392/486: Add test for word boundaries for string ending with r., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e53dc8a 394/486: Don't call syntax-ppss twice for raw strings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode fe02536 395/486: Add `await` to list of keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c62185a 397/486: Merge pull request #304 from kurnevsky/raw-string-propertize, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 295e234 404/486: rust-compile, rust-run, rust-test: respect rust-cargo-bin. (#321), ELPA Syncer, 2021/08/07