[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode 03cfbe4 148/217: Add types to index items.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode 03cfbe4 148/217: Add types to index items. |
Date: |
Sun, 29 Aug 2021 11:31:01 -0400 (EDT) |
branch: elpa/scala-mode
commit 03cfbe43ddba49f86abdc3893a6d21b62b86bd6c
Author: Ivan Malison <IvanMalison@gmail.com>
Commit: Ivan Malison <IvanMalison@gmail.com>
Add types to index items.
---
scala-mode2-imenu.el | 11 +++++++++--
scala-mode2-syntax.el | 9 +++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/scala-mode2-imenu.el b/scala-mode2-imenu.el
index 658e629..d16a896 100644
--- a/scala-mode2-imenu.el
+++ b/scala-mode2-imenu.el
@@ -6,6 +6,8 @@
(defcustom scala-imenu:should-flatten-index nil
"Controls whether or not the imenu index is flattened or hierarchical.")
+(defcustom scala-imenu:should-show-type t
+ "Controls whether or not the imenu index has definition type information.")
(defun scala-imenu:create-index ()
(interactive)
@@ -22,10 +24,15 @@
(if (eq (point) last-point) nil
(progn (save-excursion (re-search-forward scala-syntax:all-definition-re)
- (setq class-name (match-string-no-properties 2)))
+ (setq class-name
(scala-imenu:get-tag-from-last-match)))
`(,class-name . ,(cons `("<class>" . ,(point-marker))
(scala-imenu:class-members)))))))
+(defun scala-imenu:get-tag-from-last-match ()
+ (if scala-imenu:should-show-type (concat (match-string-no-properties 1)
+ ":" (match-string-no-properties 2))
+ (match-string-no-properties 2)))
+
(defun scala-imenu:class-members ()
(interactive)
(let ((start-point (point)))
@@ -39,7 +46,7 @@
(if (< stop-at-point (point))
(let ((member-name (save-excursion
(re-search-forward scala-syntax:all-definition-re)
- (match-string-no-properties 2))))
+ (scala-imenu:get-tag-from-last-match))))
(cons `(,member-name . ,marker)
(scala-imenu:get-class-members stop-at-point)))
nil)))
diff --git a/scala-mode2-syntax.el b/scala-mode2-syntax.el
index be79a8d..ec74d54 100644
--- a/scala-mode2-syntax.el
+++ b/scala-mode2-syntax.el
@@ -908,20 +908,21 @@ not. A list must be either enclosed in parentheses or
start with
(defconst scala-syntax:whitespace-delimeted-modifiers-re
(concat "\\(?:" scala-syntax:modifiers-re "\\(?: *\\)" "\\)*"))
-(defconst scala-syntax:definition-words-re
- (regexp-opt '("class" "object" "trait" "val" "var" "def" "type") 'words))
+(defconst scala-syntax:definition-words-re
+ (mapconcat 'regexp-quote '("class" "object" "trait" "val" "var" "def"
"type") "\\|"))
(defun scala-syntax:build-definition-re (words-re)
(concat " *"
scala-syntax:whitespace-delimeted-modifiers-re
words-re
- "\\(?1: *\\)"
+ "\\(?: *\\)"
"\\(?2:"
scala-syntax:id-re
"\\)"))
(defconst scala-syntax:all-definition-re
- (scala-syntax:build-definition-re scala-syntax:definition-words-re))
+ (scala-syntax:build-definition-re
+ (concat "\\(?1:" scala-syntax:definition-words-re "\\)")))
;; Functions to help with beginning and end of definitions.
- [nongnu] elpa/scala-mode c53742a 122/217: add Marmalade instructions, (continued)
- [nongnu] elpa/scala-mode c53742a 122/217: add Marmalade instructions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3df7da0 133/217: Merge pull request #66 from corruptmemory/improved-syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 69e071e 140/217: scala-syntax:forward-modifiers: Unmatched [ or [^ error, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d8a141b 125/217: Makefile clean-up, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 34888c0 142/217: Update README.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode f03a582 141/217: Merge pull request #83 from ancane/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 461f9a5 134/217: Fix issue #63 and names with _ and reserved word, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode ababc73 151/217: remove interactive, update filename., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 27efa44 019/217: updated README, added LICENSE, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d6f8cee 135/217: scala 2.10 preamble, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 03cfbe4 148/217: Add types to index items.,
ELPA Syncer <=
- [nongnu] elpa/scala-mode ed645d2 153/217: move create index function for imenu to big setq with everything else., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 618f0fb 163/217: remove 'scala-indent:indent-on-parentheses in preference of smartparens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 56cba29 194/217: Fix bad syntax when `*/` is prefixed by an opcode. (#143), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a1ff6f3 202/217: feat: add Scala 3 keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 46bb948 198/217: Fix #155, remove ob-scala.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode a2a1b1d 208/217: compile mode with sbt thin client, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 54fa36f 200/217: Merge pull request #159 from kpbochenek/fix-files-association-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 5058a85 204/217: doc: clarify Scala versions supported, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 0c5ed9e 022/217: deleted example files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 61a511f 021/217: Update README.md, ELPA Syncer, 2021/08/29