Function: semantic-ctxt-current-symbol-js-mode
semantic-ctxt-current-symbol-js-mode is a byte-compiled function
defined in javascript.el.gz.
Signature
(semantic-ctxt-current-symbol-js-mode &optional POINT)
Documentation
Return the current symbol the cursor is on at POINT in a list.
This is a very simple implementation for Javascript symbols. It
will at maximum do one split, so that the first part is seen as
one type. For example: $('#sel').foo.bar will return ("$('sel').foo" "bar").
This is currently needed for the mozrepl omniscient database.
Override semantic-ctxt-current-symbol in js-mode buffers.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/wisent/javascript.el.gz
(define-mode-local-override semantic-ctxt-current-symbol js-mode (&optional point)
"Return the current symbol the cursor is on at POINT in a list.
This is a very simple implementation for Javascript symbols. It
will at maximum do one split, so that the first part is seen as
one type. For example: $('#sel').foo.bar will return (\"$('sel').foo\" \"bar\").
This is currently needed for the mozrepl omniscient database."
(save-excursion
(if point (goto-char point))
(let* ((case-fold-search semantic-case-fold)
tmp end) ;; symlist
(with-syntax-table semantic-lex-syntax-table
(save-excursion
(when (looking-at "\\w\\|\\s_")
(forward-sexp 1))
(setq end (point))
(unless (re-search-backward "\\s-" (line-beginning-position) t)
(beginning-of-line))
(setq tmp (buffer-substring-no-properties (point) end))
;; (setq symlist
(if (string-match "\\(.+\\)\\." tmp)
(list (match-string 1 tmp)
(substring tmp (1+ (match-end 1)) (length tmp)))
(list tmp)))))));; )