[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 18/52: extended gtags functionality #90 showing annotations and m
From: |
Dmitry Gutov |
Subject: |
[elpa] 18/52: extended gtags functionality #90 showing annotations and meta |
Date: |
Tue, 01 Jul 2014 11:53:13 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit aceed8442c66081dd5b49cd2b16398ac61cd39cb
Author: ksjogo <address@hidden>
Date: Sun Apr 6 23:57:35 2014 +0200
extended gtags functionality #90
showing annotations and meta
---
company-gtags.el | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/company-gtags.el b/company-gtags.el
index 0ae98d7..41a8172 100644
--- a/company-gtags.el
+++ b/company-gtags.el
@@ -56,20 +56,23 @@
(with-temp-buffer
(let (tags)
(when (= 0 (call-process company-gtags-executable nil
- (list (current-buffer) nil) nil "-c" prefix))
+ (list (current-buffer) nil) nil "-xGq" (concat
"^" prefix)))
(goto-char (point-min))
- (split-string (buffer-string) "\n" t)))))
-
-(defun company-gtags-location (tag)
- (with-temp-buffer
- (when (= 0 (call-process company-gtags-executable nil
- (list (current-buffer) nil) nil "-x" tag))
- (goto-char (point-min))
- (when (looking-at (concat (regexp-quote tag)
- "[ \t]+\\([[:digit:]]+\\)"
- "[ \t]+\\([^ \t]+\\)"))
- (cons (expand-file-name (match-string 2))
- (string-to-number (match-string 1)))))))
+ (cl-loop while
+ (re-search-forward (concat
+ "^"
+ "\\([^ ]*\\)" ;; completion
+ "[ \t]+\\([[:digit:]]+\\)" ;; linum
+ "[ \t]+\\([^ \t]+\\)" ;; file
+ "[ \t]+\\(.*\\)" ;; definition
+ "$"
+ ) nil t)
+ collect
+ (propertize (match-string 1)
+ 'meta (match-string 4)
+ 'location (cons (expand-file-name (match-string
3))
+ (string-to-number (match-string
2)))
+ ))))))
;;;###autoload
(defun company-gtags (command &optional arg &rest ignored)
@@ -84,7 +87,12 @@
(or (company-grab-symbol) 'stop)))
(candidates (company-gtags-fetch-tags arg))
(sorted t)
- (location (company-gtags-location arg))))
+ (duplicates t)
+ (annotation (let (annotation)
+ (when (string-match (concat arg "\\((.*)\\).*")
(get-text-property 0 'meta arg))
+ (match-string 1 (get-text-property 0 'meta arg)))))
+ (meta (get-text-property 0 'meta arg))
+ (location (get-text-property 0 'location arg))))
(provide 'company-gtags)
;;; company-gtags.el ends here
- [elpa] 09/52: company-sort-by-occurrence: include words on the same line, too, (continued)
- [elpa] 09/52: company-sort-by-occurrence: include words on the same line, too, Dmitry Gutov, 2014/07/01
- [elpa] 06/52: Merge pull request #106 from proofit404/master, Dmitry Gutov, 2014/07/01
- [elpa] 11/52: company-clang--build-complete-args: don't call -cc1 directly, Dmitry Gutov, 2014/07/01
- [elpa] 10/52: company--multi-backend-adapter-candidates: compare string values of prefix, Dmitry Gutov, 2014/07/01
- [elpa] 12/52: company-clang--annotation: include method qualifiers in the annotation, Dmitry Gutov, 2014/07/01
- [elpa] 13/52: NEWS: document the change in clang invocation, Dmitry Gutov, 2014/07/01
- [elpa] 14/52: company--continue: don't pass the new prefix to `company-cancel', Dmitry Gutov, 2014/07/01
- [elpa] 15/52: company-files-complete: move files in subdirs to the end, Dmitry Gutov, 2014/07/01
- [elpa] 16/52: Introduce company-tooltip-flip-when-above, Dmitry Gutov, 2014/07/01
- [elpa] 17/52: Fix typo, Dmitry Gutov, 2014/07/01
- [elpa] 18/52: extended gtags functionality #90 showing annotations and meta,
Dmitry Gutov <=
- [elpa] 21/52: Merge pull request #126 from ksjogo/gtags, Dmitry Gutov, 2014/07/01
- [elpa] 19/52: fixing let in gtags annotation, Dmitry Gutov, 2014/07/01
- [elpa] 20/52: Add new possible value to `company-dabbrev-code-other-buffers', Dmitry Gutov, 2014/07/01
- [elpa] 03/52: company-clang: don't mistake scoping operator for objc args, Dmitry Gutov, 2014/07/01
- [elpa] 24/52: Merge pull request #127 from bbatsov/doc-fixes, Dmitry Gutov, 2014/07/01
- [elpa] 23/52: Small fixes, Dmitry Gutov, 2014/07/01
- [elpa] 25/52: Some indentation fixes, Dmitry Gutov, 2014/07/01
- [elpa] 27/52: Merge pull request #128 from bbatsov/defvar-local, Dmitry Gutov, 2014/07/01
- [elpa] 30/52: Merge pull request #129 from bbatsov/c-h, Dmitry Gutov, 2014/07/01
- [elpa] 22/52: Update NEWS, Dmitry Gutov, 2014/07/01