From 3f4a0d5370ae6c34afe180df96add3b8522f4af1 Mon Sep 17 00:00:00 2001 From: mattkae Date: Wed, 11 May 2022 09:23:58 -0400 Subject: initial commit --- elpa/js2-mode-20220402.2211/js2-imenu-extras.el | 518 ++++++++++++++++++++++++ 1 file changed, 518 insertions(+) create mode 100644 elpa/js2-mode-20220402.2211/js2-imenu-extras.el (limited to 'elpa/js2-mode-20220402.2211/js2-imenu-extras.el') diff --git a/elpa/js2-mode-20220402.2211/js2-imenu-extras.el b/elpa/js2-mode-20220402.2211/js2-imenu-extras.el new file mode 100644 index 0000000..3ec1ba8 --- /dev/null +++ b/elpa/js2-mode-20220402.2211/js2-imenu-extras.el @@ -0,0 +1,518 @@ +;;; js2-imenu-extras.el --- Imenu support for additional constructs -*- lexical-binding: t; -*- + +;; Copyright (C) 2012-2014 Free Software Foundation, Inc. + +;; Author: Dmitry Gutov +;; Keywords: languages, javascript, imenu + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; This package adds Imenu support for additional framework constructs and +;; structural patterns to `js2-mode'. + +;; Usage: + +;; (add-hook 'js2-mode-hook 'js2-imenu-extras-mode) + +;; To customize how it works: +;; M-x customize-group RET js2-imenu RET + +(require 'cl-lib) +(require 'js2-mode) + +(eval-when-compile + (when (<= emacs-major-version 26) + (require 'subr-x))) + +(defvar js2-imenu-extension-styles + `((:framework jquery + :call-re "\\_<\\(?:jQuery\\|\\$\\|_\\)\\.extend\\s-*(" + :recorder js2-imenu-record-jquery-extend) + + (:framework jquery-ui + :call-re "^\\s-*\\(?:jQuery\\|\\$\\)\\.widget\\s-*(" + :recorder js2-imenu-record-string-declare) + + (:framework dojo + :call-re "^\\s-*dojo.declare\\s-*(" + :recorder js2-imenu-record-string-declare) + + (:framework backbone + :call-re ,(concat "\\_<" js2-mode-identifier-re "\\.extend\\s-*(") + :recorder js2-imenu-record-backbone-extend) + + (:framework enyo + :call-re "\\_