[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 34/46: Add imenu support for the Sencha framework
From: |
Dmitry Gutov |
Subject: |
[elpa] 34/46: Add imenu support for the Sencha framework |
Date: |
Sat, 15 Nov 2014 20:58:09 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 852ed2e7109742af04edbad342753d14767eefea
Author: Lele Gaifax <address@hidden>
Date: Sat Nov 1 20:34:15 2014 +0100
Add imenu support for the Sencha framework
This implements issue #172.
---
js2-imenu-extras.el | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/js2-imenu-extras.el b/js2-imenu-extras.el
index fc6b005..e3a2c97 100644
--- a/js2-imenu-extras.el
+++ b/js2-imenu-extras.el
@@ -60,7 +60,11 @@
(:framework react
:call-re "\\_<React\\.createClass\\s-*("
- :recorder js2-imenu-record-react-class))
+ :recorder js2-imenu-record-react-class)
+
+ (:framework sencha
+ :call-re "^\\s-*Ext\\.define\\s-*("
+ :recorder js2-imenu-record-sencha-class))
"List of JavaScript class definition or extension styles.
:framework is a valid value in `js2-imenu-enabled-frameworks'.
@@ -206,6 +210,19 @@ Currently used for jQuery widgets, Dojo and Enyo
declarations."
(list name-value))
(js2-node-abs-pos options)))))))
+(defun js2-imenu-record-sencha-class ()
+ (let* ((node (js2-node-at-point (1- (point))))
+ (args (js2-call-node-args node))
+ (name (first args))
+ (methods (second args)))
+ (when (and (js2-string-node-p name) (js2-object-node-p methods))
+ (let ((name-value (js2-string-node-value name)))
+ (js2-record-object-literal methods
+ (if js2-imenu-split-string-identifiers
+ (split-string name-value "\\." t)
+ (list name-value))
+ (js2-node-abs-pos methods))))))
+
(defun js2-imenu-walk-ast ()
(js2-visit-ast
js2-mode-ast
- [elpa] 27/46: Fix parsing of let expressions, (continued)
- [elpa] 27/46: Fix parsing of let expressions, Dmitry Gutov, 2014/11/15
- [elpa] 18/46: Merge pull request #149 from lewang/dont-parse-killed-buffer, Dmitry Gutov, 2014/11/15
- [elpa] 28/46: js2-parse-let: Simplify, Dmitry Gutov, 2014/11/15
- [elpa] 22/46: Support ES6 number literals, Dmitry Gutov, 2014/11/15
- [elpa] 21/46: js2-get-token-internal-1: add a FIXME, Dmitry Gutov, 2014/11/15
- [elpa] 20/46: js2-read-unicode-escape: use a stricter regexp, Dmitry Gutov, 2014/11/15
- [elpa] 29/46: Fontify negation operator, Dmitry Gutov, 2014/11/15
- [elpa] 32/46: Fix #171, Dmitry Gutov, 2014/11/15
- [elpa] 31/46: js2-mode-find-enclosing-node: Make docstring and impl consistent with name, Dmitry Gutov, 2014/11/15
- [elpa] 33/46: js2-parse-primary-expr: Make some vars "more" local, Dmitry Gutov, 2014/11/15
- [elpa] 34/46: Add imenu support for the Sencha framework,
Dmitry Gutov <=
- [elpa] 36/46: Indent before inequality operator at bol, Dmitry Gutov, 2014/11/15
- [elpa] 38/46: Indent after `+=', Dmitry Gutov, 2014/11/15
- [elpa] 37/46: Support object destructuring inside arrow function args, Dmitry Gutov, 2014/11/15
- [elpa] 30/46: js2-imenu-extras.el: Use Unix-style EOL, Dmitry Gutov, 2014/11/15
- [elpa] 42/46: js2-imenu-walk-ast: Look up js2-imenu-show-module-pattern in v-i-n case, too, Dmitry Gutov, 2014/11/15
- [elpa] 40/46: Support orphan functions on the right side of assignments, Dmitry Gutov, 2014/11/15
- [elpa] 35/46: Merge pull request #173 from lelit/master, Dmitry Gutov, 2014/11/15
- [elpa] 43/46: Fix toggling single-line comments, Dmitry Gutov, 2014/11/15
- [elpa] 41/46: js2-imenu-record-module-pattern: Support `js2-var-init-node', Dmitry Gutov, 2014/11/15
- [elpa] 46/46: Merge commit '2c744815cf9e4653625dd25f2e7f8b59c152782d' from js2-mode, Dmitry Gutov, 2014/11/15