diff options
| author | fmdkdd <fmdkdd@gmail.com> | 2016-05-14 13:21:02 +0200 |
|---|---|---|
| committer | fmdkdd <fmdkdd@gmail.com> | 2016-05-14 13:33:59 +0200 |
| commit | e6eceea8c7f30fbd847106f3a59d54c3ca8739a7 (patch) | |
| tree | 6e6ba03618122e4c64a41e528d3779ccce008867 /rust-mode.el | |
| parent | e3c545ec266721075e6d6e136759d95f4bb798da (diff) | |
| download | rust-mode-e6eceea8c7f30fbd847106f3a59d54c3ca8739a7.tar.gz | |
Add macro_rules names to imenu
imenu did not register macros previously.
We must add `!` to the `word` syntax category for imenu since we reuse
the `rust-re-item-def-imenu` regexp which use word boundaries.
Diffstat (limited to 'rust-mode.el')
| -rw-r--r-- | rust-mode.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el index 2e783a0..65fc1fd 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1196,7 +1196,7 @@ the desired identifiers), but does not match type annotations \"foo::<\"." (defvar rust-imenu-generic-expression (append (mapcar #'(lambda (x) (list nil (rust-re-item-def-imenu x) 1)) - '("enum" "struct" "type" "mod" "fn" "trait")) + '("enum" "struct" "type" "mod" "fn" "trait" "macro_rules!")) `(("Impl" ,(rust-re-item-def-imenu "impl") 1))) "Value for `imenu-generic-expression' in Rust mode. @@ -1340,6 +1340,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust." (setq-local comment-multi-line t) (setq-local comment-line-break-function 'rust-comment-indent-new-line) (setq-local imenu-generic-expression rust-imenu-generic-expression) + (setq-local imenu-syntax-alist '((?! . "w"))) ; For macro_rules! (setq-local beginning-of-defun-function 'rust-beginning-of-defun) (setq-local end-of-defun-function 'rust-end-of-defun) (setq-local parse-sexp-lookup-properties t) |
