:safe #'booleanp
:group 'context-coloring)
-(make-obsolete-variable
- 'context-coloring-js-block-scopes
- 'context-coloring-javascript-block-scopes
- "7.0.0")
-
(defsubst context-coloring-js2-scope-level (scope initial)
"Return the level of SCOPE, starting from INITIAL."
(cond ((gethash scope context-coloring-js2-scope-level-hash-table))
"\\)")
"Match a comment body hinting at a Node.js program.")
-;; TODO: Add ES6 module detection.
(defun context-coloring-js2-top-level-local-p ()
"Guess whether top-level variables are local.
For instance, the current file could be a Node.js program."
(t
(context-coloring-js2-colorize-ast))))
-(context-coloring-define-dispatch
+;;;###autoload
+(puthash
'javascript
- :modes '(js2-mode js2-jsx-mode)
- :colorizer #'context-coloring-js2-colorize
- :setup
- (lambda ()
- (add-hook 'js2-post-parse-callbacks #'context-coloring-colorize nil t))
- :teardown
- (lambda ()
- (remove-hook 'js2-post-parse-callbacks #'context-coloring-colorize t)))
+ (list :modes '(js2-mode js2-jsx-mode)
+ :colorizer #'context-coloring-js2-colorize
+ :setup
+ (lambda ()
+ (add-hook 'js2-post-parse-callbacks #'context-coloring-colorize nil t))
+ :teardown
+ (lambda ()
+ (remove-hook 'js2-post-parse-callbacks #'context-coloring-colorize t)))
+ context-coloring-dispatch-hash-table)
(provide 'context-coloring-javascript)