[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f8248df 066/110: Record class declarations for IMenu
From: |
Dmitry Gutov |
Subject: |
[elpa] master f8248df 066/110: Record class declarations for IMenu |
Date: |
Thu, 23 Jun 2016 01:12:59 +0000 (UTC) |
branch: master
commit f8248dfdcca2b6c89e88219e49ba682473149dcb
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Record class declarations for IMenu
Closes #303
---
js2-mode.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 739c01e..150f4cd 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -7504,7 +7504,7 @@ For instance, processing a nested scope requires a parent
function node."
(let (result fn parent-qname p elem)
(dolist (entry js2-imenu-recorder)
;; function node goes first
- (cl-destructuring-bind (current-fn &rest (&whole chain head &rest)) entry
+ (cl-destructuring-bind (current-fn &rest (&whole chain head &rest _))
entry
;; Examine head's defining scope:
;; Pre-processed chain, or top-level/external, keep as-is.
(if (or (stringp head) (js2-node-top-level-decl-p head))
@@ -10674,6 +10674,7 @@ If ONLY-OF-P is non-nil, only the 'for (foo of bar)'
form is allowed."
(js2-set-face (js2-node-pos name) (js2-node-end name)
'font-lock-function-name-face 'record)
(let ((node (js2-parse-class pos 'CLASS_STATEMENT name)))
+ (js2-record-imenu-functions node name)
(js2-define-symbol js2-FUNCTION
(js2-name-node-name name)
node)
@@ -10768,7 +10769,7 @@ expression)."
;; Found a property (of any sort)
((member tt (list js2-NAME js2-STRING js2-NUMBER js2-LB))
(setq after-comma nil
- elem (js2-parse-named-prop tt pos previous-token))
+ elem (js2-parse-named-prop tt previous-token))
(if (and (null elem)
(not js2-recover-from-parse-errors))
(setq continue nil)))
@@ -10827,7 +10828,7 @@ expression)."
(js2-must-match js2-RC "msg.no.brace.prop")
(nreverse elems)))
-(defun js2-parse-named-prop (tt pos previous-token)
+(defun js2-parse-named-prop (tt previous-token)
"Parse a name, string, or getter/setter object property.
When `js2-is-in-destructuring' is t, forms like {a, b, c} will be permitted."
(let ((key (js2-parse-prop-name tt))
@@ -10835,8 +10836,10 @@ When `js2-is-in-destructuring' is t, forms like {a, b,
c} will be permitted."
(property-type (when previous-token
(if (= (js2-token-type previous-token) js2-MUL)
"*"
- (js2-token-string previous-token)))))
+ (js2-token-string previous-token))))
+ pos)
(when (member prop '("get" "set" "async"))
+ (setq pos (js2-token-beg previous-token))
(js2-set-face (js2-token-beg previous-token)
(js2-token-end previous-token)
'font-lock-keyword-face 'record)) ; get/set/async
@@ -10968,6 +10971,7 @@ TYPE-STRING is a string `get', `set', `*', or nil,
indicating a found keyword."
(js2-node-set-prop fn 'METHOD_TYPE type) ; for codegen
(when (string= type-string "*")
(setf (js2-function-node-generator-type fn) 'STAR))
+ (unless pos (setq pos (js2-node-pos prop)))
(setq end (js2-node-end fn)
result (make-js2-method-node :pos pos
:len (- end pos)
- [elpa] master 4cd81c7 050/110: Exported decls print a little funny; update tests, (continued)
- [elpa] master 4cd81c7 050/110: Exported decls print a little funny; update tests, Dmitry Gutov, 2016/06/22
- [elpa] master 00a455f 009/110: Merge pull request #266 from jacksonrayhamilton/no-getter-setter-duplicate, Dmitry Gutov, 2016/06/22
- [elpa] master 4894200 056/110: Merge pull request #290 from XeCycle/export-async-fn, Dmitry Gutov, 2016/06/22
- [elpa] master 027d546 051/110: Merge pull request #287 from dgreensp/fix-export-decls, Dmitry Gutov, 2016/06/22
- [elpa] master 13f0ffb 042/110: Fix parsing of param with destructure and default, Dmitry Gutov, 2016/06/22
- [elpa] master e48e862 055/110: Also parse async function statement in export node, Dmitry Gutov, 2016/06/22
- [elpa] master e9227bd 058/110: Fix a byte-compilation warning, Dmitry Gutov, 2016/06/22
- [elpa] master 2a904e0 057/110: Implement object literal rest/spread (...), Dmitry Gutov, 2016/06/22
- [elpa] master 8047d7f 061/110: Recognize for-of and for-in loops with const, Dmitry Gutov, 2016/06/22
- [elpa] master 983f20a 072/110: Fix typo, Dmitry Gutov, 2016/06/22
- [elpa] master f8248df 066/110: Record class declarations for IMenu,
Dmitry Gutov <=
- [elpa] master d92e772 069/110: Fix async parsing, Dmitry Gutov, 2016/06/22
- [elpa] master 5c97dce 002/110: Fix typo; Refs #185, Dmitry Gutov, 2016/06/22
- [elpa] master 97065c8 075/110: Fix compiler warning, Dmitry Gutov, 2016/06/22
- [elpa] master 849e061 081/110: js2-indent-operator-re, js2-declaration-keyword-re: Use symbols boundaries, Dmitry Gutov, 2016/06/22
- [elpa] master b2af331 083/110: Special-case unary + and -, Dmitry Gutov, 2016/06/22
- [elpa] master 7e7b6da 076/110: Simplify await parsing, Dmitry Gutov, 2016/06/22
- [elpa] master b57d129 077/110: Merge pull request #304 from jacksonrayhamilton/fix-void-async-await, Dmitry Gutov, 2016/06/22
- [elpa] master 645d129 078/110: Add support for JSDoc @callback, @func and @method tags, Dmitry Gutov, 2016/06/22
- [elpa] master b576cef 097/110: Declare vars created with renaming destructuring, Dmitry Gutov, 2016/06/22
- [elpa] master 12586e5 098/110: Allow space before global declaration, Dmitry Gutov, 2016/06/22