;;
;; Copyright (C) 2009 Nikolaj Schumacher
;;
-;; This file is part of company 0.3.
+;; This file is part of company 0.4.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
:group 'company
:type 'function)
-(defvar company-semantic-context-regexp
- "\\(->\\|\\.\\|\\_<\\)\\(\\(\\s_\\|\\sw\\)+\\_>\\=\\)")
-
(defun company-semantic-doc-or-summary (tag)
(or (semantic-documentation-for-tag tag)
(funcall semantic-idle-summary-function tag nil t)))
(context (semantic-analyze-current-context)))
(all-completions prefix (semantic-ia-get-completions context (point))))))
+(defun company-semantic-completions-raw (prefix)
+ (let (candidates)
+ (dolist (tag (semantic-analyze-find-tags-by-prefix prefix))
+ (unless (eq (semantic-tag-class tag) 'include)
+ (push (semantic-tag-name tag) candidates)))
+ (delete "" candidates)))
+
;;;###autoload
(defun company-semantic (command &optional arg &rest ignored)
"A `company-mode' completion back-end using CEDET Semantic."
('prefix (and (memq major-mode '(c-mode c++-mode jde-mode java-mode))
(semantic-active-p)
(not (company-in-string-or-comment))
- (or (company-grab company-semantic-context-regexp 2) "")))
+ (or (company-grab-symbol) 'stop)))
('candidates (or (company-semantic-completions arg)
- (mapcar 'semantic-tag-name
- (semantic-analyze-find-tags-by-prefix arg))))
+ (company-semantic-completions-raw arg)))
('meta (funcall company-semantic-metadata-function
(semantic-analyze-find-tag arg)))
('doc-buffer (company-semantic-doc-buffer (semantic-analyze-find-tag arg)))