Coder Social home page Coder Social logo

helm-gtags's Introduction

melpa badge melpa stable badge

helm-gtags.el

CI travis badge

Introduction

helm-gtags.el is GNU GLOBAL helm interface.

Screenshot

helm-gtags

Requirements

  • Emacs 24 or higher.
  • helm 1.7.7 or higher
  • GNU Global 6.2.3 or higher

helm-gtags.el does not require gtags.el.

Installation

helm-gtags is available on MELPA and MELPA stable

You can install helm-gtags with the following command.

M-x package-install [RET] helm-gtags [RET]

Use Ctags with helm-gtags

You can use helm-gtags for languages which are supported by ctags(Both exuberant ctags and universal ctags) with ctags backend feature of GNU global. You can generate ctags backend tags by following command.

# exuberant ctags
% gtags --gtagslabel=ctags

# universal ctags
% gtags --gtagslabel=new-ctags

Basic Usage

helm-gtags-mode

Enable helm-gtags-mode.

helm-gtags-find-tag

Input tag name and move to the definition.

helm-gtags-find-tag-from-here

Find tag from here and move to its definition.

helm-gtags-find-rtag

Input tag name and move to the referenced point.

helm-gtags-find-symbol

Input symbol and move to the locations.

helm-gtags-find-files

Input file name and open it.

You can use those searching commands with prefix key.

Prefix Key Description
C-u Searches from specified directory
C-u C-u Searches under current directory
C-- Jump to symbol with other window

helm-gtags-select

Tag jump using gtags and helm

helm-gtags-dwim

Find name by context.

  • Jump to header file if cursor is on include statement
  • Jump to tag definition if cursor is on tag reference
  • Jump to tag reference if cursor is on tag definition

helm-gtags-tags-in-this-function

Show tagnames which are referenced in this function and jump to them.

helm-gtags-update-tags

Update TAG file. Default is update only current file, You can update all files with C-u prefix.

helm-gtags-create-tags

Create TAG file. Please choose default as GTAGSLABEL if you don't enable --with-ctags and plugin parser options. If you use homebrew on MacOSX, you can enable those features by following command.

# You should uninstall global at first if you already install global
% brew install global --with-ctags --with-pygments

helm-gtags-parse-file

Show symbols in current file like gtags-parse-file. You can choose any files with C-u prefix.

helm-gtags-pop-stack

Move to previous point on the stack. helm-gtags pushes current point to stack before executing each jump functions.

helm-gtags-push-stack

Push current location to the stack.

helm-gtags-next-history

Move to next history on context stack.

helm-gtags-previous-history

Move to previous history on context stack.

helm-gtags-show-stack

Show context stack with helm interface. You can jump to the context.

helm-gtags-clear-stack

Clear current context stack.

helm-gtags-clear-all-stacks

Clear all context stacks.

helm-gtags-clear-cache

Clear current project cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-clear-all-cache

Clear all result cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-resume

Resurrect previously invoked helm-gtags command. This is similar to helm-resume however this command resurrects helm gtags buffer if other helm commands are called.

Using Suggested Key Mapping

helm-gtags.el provides suggested key maps like gtags.el by setting helm-gtags-suggested-key-mapping to non-nil. Its prefix key is C-c as default. You can change prefix by setting helm-gtags-prefix-key.

You have to set them before loading helm-gtags.el. I recommend you to use custom-set-variables for setting this value.

(custom-set-variables
 '(helm-gtags-prefix-key "\C-t")
 '(helm-gtags-suggested-key-mapping t))

If you use invalid modifier string(like C-,) as prefix key, please don't escape Control prefix.(OK: C-,, NG: \C-,).

Default Key Mapping

Key Command
Prefix h helm-gtags-display-browser
Prefix C-] helm-gtags-find-tag-from-here
Prefix C-t helm-gtags-pop-stack
Prefix P helm-gtags-find-files
Prefix f helm-gtags-parse-file
Prefix g helm-gtags-find-pattern
Prefix s helm-gtags-find-symbol
Prefix r helm-gtags-find-rtag
Prefix t helm-gtags-find-tag
Prefix d helm-gtags-find-tag
M-* helm-gtags-pop-stack
M-. helm-gtags-find-tag
C-x 4 . helm-gtags-find-tag-other-window

Customize Variables

helm-gtags-path-style(Default 'root)

File path style, 'root or 'relative or 'absolute. You can only use 'absolute if you use Windows and set GTAGSLIBPATH environment variable. helm-gtags.el forces to use absolute style in such case.

helm-gtags-ignore-case(Default nil)

Ignore case for searching flag

helm-gtags-read-only(Default nil)

Open file as readonly, if this value is non-nil

helm-gtags-use-input-at-cursor(Default nil)

Use word at cursor as input if this value is non-nil

helm-gtags-highlight-candidate(Default t)

Highlighting candidates if this value is non-nil

helm-gtags-display-style(Default nil)

Show detail information if this value is 'detail, show reference point of function etc.

helm-gtags-auto-update(Default nil)

If this variable is non-nil, TAG file is updated after saving buffer

helm-gtags-update-interval-second(Default 60)

Tags are updated in `after-save-hook' if this seconds is passed from last update Always update if value of this variable is nil.

helm-gtags-cache-select-result(Default nil)

If this variable is non-nil, use cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-cache-max-result-size(Default 10MB)

Max size(bytes) to cache for each select result

helm-gtags-pulse-at-cursor(Default nil)

If this variable is non-nil, pulse at point after jumping

helm-gtags-fuzzy-match(Default nil)

Enable fuzzy match. You should set this value before loading helm-gtags.el.

helm-gtags-direct-helm-completing(Default nil)

Use helm completion instead of normal Emacs completion if this value is non-nil.

helm-gtags-maximum-candidates

Maximum number of helm candidates in helm-gtags.el. Please set small number if you feel slow for large source tree such as Linux kernel.

Default value is

  • 9999(Disable fuzzy match)
  • 100(Enable fuzzy match)

helm-gtags-preselect

If this variable is non-nil, preselect current file and line.

helm-gtags-cygwin-use-global-w32-port

This variable is only for Cygwin users. If you use both Cygwin version Emacs and GNU global, please set nil to this variable.

Faces

helm-gtags-file

Face of file name of candidates

helm-gtags-lineno

Face of line number of candidates

anything-gtags.el

helm-gtags.el is not compatible anything-gtags.el. But helm-gtags.el is designed for faster search than anything-gtags.el.

anything-gtags.el is slow in large source tree such as Linux kernel, FreeBSD, Android etc. Because anything-gtags.el creates candidates by processing output of gtags.el. helm-gtags.el creates candidates by itself, so helm-gtags.el is faster than anything-gtags.el.

Sample Configuration

;;; Enable helm-gtags-mode
(add-hook 'c-mode-hook 'helm-gtags-mode)
(add-hook 'c++-mode-hook 'helm-gtags-mode)
(add-hook 'asm-mode-hook 'helm-gtags-mode)

;; customize
(custom-set-variables
 '(helm-gtags-path-style 'relative)
 '(helm-gtags-ignore-case t)
 '(helm-gtags-auto-update t))

;; key bindings
(with-eval-after-load 'helm-gtags
  (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
  (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
  (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
  (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
  (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
  (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
  (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack))

helm-gtags's People

Contributors

artagnon avatar byplayer avatar dependabot[bot] avatar furiel avatar gifnksm avatar hadashia avatar jacekmigacz avatar jcs090218 avatar jeff66ruan avatar kosaki avatar liubinsheng avatar ljli avatar mikiya avatar pascalhaakmat-hj avatar pekatuu avatar syohex avatar yangwen0228 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helm-gtags's Issues

helm-render-source: Wrong type argument: stringp, (nil . "Warning: source file './include/boost/container/map.hpp' is not available.")

To reproduce:

  • Create ~/.gtags directory.
  • cd ~/.gtags
  • ln -s /usr/include include
  • gtags -c
  • export GTAGSLIBPATH=/home/tuhdo/.gtags/

Replace my name tuhdo with yours.

-c option tells gtags to generate tag database in compact format. Otherwise if you install Boost, it creates huge tag database: http://lists.gnu.org/archive/html/bug-global/2014-09/msg00014.html

I tried testing it on a simple C++ file to jump to map definition, but encountered this error:

helm-render-source: Wrong type argument: stringp, (nil . "Warning: source file './include/boost/container/map.hpp' is not available.")

Sample source code for testing:

#include <map>

int main(int argc, char *argv[])
{
    map<int> a;

    return 0;
}

not working in helm-mode

ใฏใ˜ใ‚ใพใ—ใฆใ€‚

ๅคงๅค‰ไพฟๅˆฉใชใ‚‚ใฎใ‚’ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™ใ€‚
ๆ—ฉ้€ŸๅฐŽๅ…ฅใ—ใ‚ˆใ†ใจๆ€ใฃใŸใฎใงใ™ใŒใ€(helm-mode 1)็’ฐๅขƒไธ‹ใงใ™ใจใ€ใ‚จใƒฉใƒผใŒๅ‡บใฆใ†ใพใๅ‹•ไฝœใ—ใพใ›ใ‚“ใ€‚
helm-gtags-find-tagใ‚’่ตทๅ‹•ใ—ใฆใ€ใ‚ฟใ‚ฐใ‚’ๅ…ฅๅŠ›ใ€ใ‚จใƒณใ‚ฟใƒผๅพŒใซใ‚จใƒฉใƒผใŒๅ‡บใ‚‹ๆ„Ÿใ˜ใงใ™ใ€‚
ใ‚ฟใ‚ฐๅ…ฅๅŠ›ๆ™‚ใซhelmใŒ่ตทๅ‹•ใ—ใฆใ—ใพใ†ใ“ใจใŒๅŽŸๅ› ใงใฏใชใ„ใ‹ใจๆ€ใ†ใฎใงใ™ใŒโ€ฆใ€‚
ใƒใƒƒใ‚ฏใƒˆใƒฌใƒผใ‚นใฏไปฅไธ‹ใฎๆง˜ใชๆ„Ÿใ˜ใงใ™ใ€‚
https://gist.github.com/3499424
helmใจhelm-gtagsใฎไธกๆ–นใซใคใ„ใฆ้ŽๅŽปใฎใƒใƒผใ‚ธใƒงใƒณใ‚‚่ฉฆใ—ใพใ—ใŸใŒใ€ๅŒใ˜ใ‚จใƒฉใƒผใซใชใ‚Šใพใ—ใŸใ€‚ใใฎไป–ใฎ็’ฐๅขƒใซใคใ„ใฆใฏๆœซๅฐพใซ่จ˜่ผ‰ใ—ใฆใ„ใพใ™ใ€‚
ใชใŠใ€helm-modeใ‚’ๆœ‰ๅŠนใซใ—ใฆใ„ใชใ„ๅ ดๅˆใฏๅ•้กŒใ‚ใ‚Šใพใ›ใ‚“ใ€‚
helm-modeๆœ‰ๅŠนใซใ™ใ‚‹ใจใใฎไป–ใซใ‚‚ไฝฟใ„ใซใใ„้ƒจๅˆ†ใ‚‚ๅคšใ€…ใ‚ใ‚‹ใฎใงๅ€‹ไบบ็š„ใซใฏไฝฟใ†ใฎใ‚’่พžใ‚ใ‚‹ๆ–นๅ‘ใง่€ƒใˆใฆใ„ใพใ™ใŒใ€ไธ€ๅฟœใ”ๅ ฑๅ‘Šใพใงใ€‚


Mac OS X 10.7.4
GNU GLOBAL 6.2.4
Emacs 24.2

Support for caller/callee search

glcall is a tool that output caller/callee search for a function. For example:

  • glcall -x <function> returns calling function of the supplied function.
  • glcall -r <function> returns functions that call the supplied function.

Is it possible to add support for that tool, so we have these features?

helm-gtags-select and helm-gtags-select-path are slow when there are many candidates

When I use helm-gtags-select-path in linux kernel source, it's quite slow for helm to show the window, even if the result is cached.

candidate-number-limit for helm-gtags-select and helm-gtags-select-path are both 9999. I think 999 is acceptable because no one would really navigate 9999 candidates. And 999 makes helm respond quickly. Could you please make this number configurable?

[Question] Making symbol and git files in one go

I really like this package and use extensively for my project. Thanks for this wonderful extension.

I've request to enhance this one with option for including git files. Right now, I use 'helm-gtags-select' for select functions/symbols. Can this be extended to include git files ? So that on one go i can look for functions/files/symbols ?.,

Enable fuzzy matching

Recently Helm added support for fuzzy matching to any source specified to do so with this commit.

If you create helm source with defvar, you can enable it with this:

(match . helm-fuzzy-match)

It will be useful for helm-gtags-select, helm-gtags-find-tag and helm-gtags-reference.

Automatically asks to create GTAGS database

ggtags has a convenient feature, that is, when a GTAGS database is not found and user invokes a ggtags command, it asks user whether to create or not. If user chooses to create, a database is generated; after the database is generated, the previous ggtags command is resumed with the new database.

I think it would be really convenient if helm-gtags can do such thing, so user won't have to jump to project root and manually invoke gtags shell command.

helm-gtags-select in the recent helm-gtags fails to work

The helm-gtags-select does not work well in the most recent helm-gtags.
Could you confirm this bug? Could I fix it by configurations? Thanks a lot!

The expected behavior of helm-gtags-select is shown in http://tuhdo.github.io/c-ide.html, illustrated as
helm-gtags-select

However, when I call helm-gtags-select, I successfully got a list. However, when hitting <TAB>, I got an error, and failed to switch to any path or show any lists, as illustrated below:
helm-gtags-select-malfunction
When I hit <ENTER>, I got another error, as illustrated below:
helm-gtags-select-malfunction2

Version:
Emacs 24.4.1
Helm 2015.08.15.740
Helm-gtags 2015.08.15.50

Configuration in init files:

;; Prefix config
(setq
 helm-gtags-ignore-case t
 helm-gtags-auto-update t
 helm-gtags-use-input-at-cursor t
 helm-gtags-pulse-at-cursor t
 helm-gtags-prefix-key "\C-cg"
 helm-gtags-suggested-key-mapping t
 helm-gtags-auto-update t
 ;helm-gtags-cache-select-result t
 )
(require 'helm-gtags)
;; Enable helm-gtags-mode
(add-hook 'dired-mode-hook 'helm-gtags-mode)
(add-hook 'eshell-mode-hook 'helm-gtags-mode)
(add-hook 'c-mode-hook 'helm-gtags-mode)
(add-hook 'c++-mode-hook 'helm-gtags-mode)

Find tags in multiple databases

xgtags.el has a nice feature that allows to search for definition in multiple database defined by users. The custom variable xgtags-find-multiple-db takes a function that returns a list of directories with GTAGS databases. This is particularly useful when we want to find function definitions not only in the current project, but in other projects or in library sources (for example, /usr/include, /usr/local/include).

It would be ideal if helm-gtags returns tags definitions/references in multiple helm sources. The first source is always matches in current project; subsequent sources are matches from the additional databases.

helm-gtags does not support muli-bytes language tags

There is GTAGS GPATH GRTAGS in my project root. I had generated tags using gtags command.
When using
gtags -d GTAGS
I can see some of the tags are started with Chinese which can not show in emacs
M-x: helm-gtags-select
. It only shows tags started with English.

List candidates in helm-gtags-select in flat format

I love the helm-gtags-select command that helps me to search tags so quickly. However, I wish it has an option to list every tag in usual format: <file>:<line number>: <line contains tag>, similar to how helm-etags-select works, like in this demo. It's really useful to combine with another source, like helm-semantic-or-imenu, so I can navigate tags in current buffer as well as in current project with just one command. But it only works when tags are displayed in flat format.

`helm-gtags-show-stack` should not append duplicate entry

When there exists an already jumped entry in the stack, it should not be appended. Currently, selecting an entry in helm-gtags-show-stack adds duplicate entry, and this looks annoying with multiple duplicate entries when we try to go back and forth between functions.

helm-gtags-select doesn't work in 1.4.3

For example, in a project root, input command:

M-x helm-gtags-select RET hello

helm give me:

hello1
hello2

When the cursor in hello1, if I press RET, it should jump to the definition, but it doesn't.

1.4.2 was working.

Thanks.

helm-gtags-find-tag-from-here error: apply: Wrong type argument: stringp, nil

Here is the backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  call-process("global" nil (t nil) nil "--result=grep" "--from-here=356:/home/xtuudoo/workspace/study/discrete_optimization/hw1/knapsack.cpp" nil)
  apply(call-process "global" nil (t nil) nil ("--result=grep" "--from-here=356:/home/xtuudoo/workspace/study/discrete_optimization/hw1/knapsack.cpp" nil))
  process-file("global" nil (t nil) nil "--result=grep" "--from-here=356:/home/xtuudoo/workspace/study/discrete_optimization/hw1/knapsack.cpp" nil)
  helm-gtags--find-tag-from-here-init()
  apply(helm-gtags--find-tag-from-here-init nil)
  helm-funcall-with-source(((name . "GNU Global at ~/workspace/study/discrete_optimization/hw1/") (helm-gtags-base-directory) (init . helm-gtags--find-tag-from-here-init) (candidates . helm-candidates-in-buffer) (action ("Open file" . helm-gtags--action-openfile) ("Open file other window" . helm-gtags--action-openfile-other-window)) (persistent-action . helm-gtags--persistent-action) (filtered-candidate-transformer helm-fuzzy-highlight-matches) (real-to-display . helm-gtags--candidate-transformer) (candidate-number-limit . 9999) (volatile) (match identity) (header-line . "C-j: helm-gtags--persistent-action (keeping session)") (dont-plug helm-compile-source--candidates-in-buffer helm-compile-source--match-plugin helm-compile-source--persistent-help) (matchplugin) (get-line . buffer-substring-no-properties) (search helm-mp-exact-search helm-mp-search helm-candidates-in-buffer-search-default-fn)) helm-gtags--find-tag-from-here-init)
  helm-funcall-foreach(init nil)
  helm-initial-setup(nil)
  helm-initialize(nil nil nil (helm-source-gtags-find-tag-from-here))
  #[0 "\311\211\211\211\305\206\n

byte-code: No buffer named *helm-gtags-update-tag*

To reproduce:

  • Connect to a remote via Tramp (i.e. connect to a VM).
  • Open a buffer with helm-gtags enabled.
  • Copy something and paste there.
  • Error happens: No buffer named *helm-gtags-update-tag* whenever we try to run any command. It makes saving buffer impossible.

File .... is read-only on disk. Make buffer read-only, too? (y or n) y

I got this error even though the file is not read-only. I don't know why. You can reproduce this using helm-gtags-select on the linux kernel:

  • Run helm-gtags-select.
  • Enter printk.
  • Press RET.
  • A list of files are displayed.
  • Press TAB on files a few times, and you will get that question. After answering the question (regardless of yes or no), pressing TAB won't be able to view the entry at point in other buffer.

Sorry, Have a question

Can Global support Ruby language?

If used in emacs, If can support Module::Class1:Class2.

Thanks.

Setting current directory: no such file or directory

Hi Syohex

I have a problem with the function helm-gtags-dwim. I work under emacs 24.4 in cygwin (windows 7).
I have the following error message :

Setting current directory: no such file or directory, D:/Exe/Cygwin/dev/brain^M/.
However, the right path is /dev/brain/ . Is helm gtags compatible with emacs under cygwin ?

Is there a solution ?

Thanks for your answer.

Failed: create TAGS(1)

My system info: Mac OSX 10.10
global version: 6.5

When I M-x helm-gtags-create-tags, helm-gtags throws error: Failed: create TAGS(1)

Create a separate Helm source for tags in current file

Currently, when finding definitions/references, helm-gtags only lists the output from GNU Global regarding the order. For example, in this demo you can see that the definition of loop_per_jiffy is in the line right above the current line, yet helm-gtags lists tags from somewhere else not the current file (the demo start when minibuffer contains "START"):

helm-gtags-find-def

I suggest this improvement by creating two Helm sources:

  • One for the current file that lists only definitions/references in current file.
  • One for showing definitions/references in other files.

`helm-gtags-update-tags` seems to be broken.

When I call it, nothing apparent happens. From time to time it fails with a message about a missing buffer " *helm-gtags-update-tag*". I usually create this manually with get-buffer-create to shut up that error.

However, tags still aren't recreated.

I'm using this over TRAMP, but that should not matter as calling shell is fully transparent.

Add history navigation feature

Now helm-gtags-pop-stack can go back the navigation history, and then the popped history is discarded. How about adding a function to "go forward" the navigation history like a web browser?

The data structure needs to change from stack to something like a list. And go-back just moves the current cursor back, and go-forward moves the cursor forward. The content at cursor can be accessed by nth-like functions.

A-B-C-D
     \
      E

When global jumps to E when the current cursor is at C, obviously D should be discarded using subseq.

A-B-C-E

The idea is from Source Insight and it's very handy when reading complex source code.

helm-gtags for windows environment

hello

root of project
f: blah blah

dir of GTAGSLIBPATH
c: blah blah

if helm-gtags-path-style is
Root or Relative from the current directory

../../Program Files/Microsoft SDKs/Windows/v7.1/Include/Fci.h:44:typedef unsigned int UINT; /* ui */
<--- not exactly relative(../../ <-- shortening)

if Absolute

c:/Program Files/Microsoft SDKs/Windows/v7.1/Include/Fci.h:44:typedef unsigned int UINT; /* ui */
<--- at below code, because split ":" and cl-first elems, result is "c"

in helm-gtags.el

(defun helm-gtags--action-openfile (elm)
  (let* ((elems (split-string elm ":"))
         (filename (cl-first elems))
         (line (string-to-number (cl-second elems)))
         (open-func (helm-gtags--select-find-file-func))
         (default-directory (helm-gtags--base-directory)))
    (helm-gtags--do-open-file open-func filename line)))

how to fix for windows environment? are you planning to fix that?
or can i overwrite openfile function temporarily?

have a nice day!

helm-gtags-windows-report

helm-gtags--persistent-action error

When trying to open a file using C-j from helm-gtags-show-stack:

 Debugger entered--Lisp error: (wrong-type-argument stringp 1)
  string-match("\\`[a-zA-Z]:" 1 nil)
  helm-gtags--extract-file-and-line(1)
  helm-gtags--persistent-action(1)
  helm-execute-selection-action-1(nil helm-gtags--persistent-action t)
  helm-execute-persistent-action()
  call-interactively(helm-execute-persistent-action nil nil)
  command-execute(helm-execute-persistent-action)
  read-from-minibuffer("pattern: " nil (keymap (tab . helm-execute-persistent-action) (f13 lambda nil (interactive) (helm-select-nth-action 12)) (f12 lambda nil (interactive) (helm-select-nth-action 11)) (f11 lambda nil (interactive) (helm-select-nth-action 10)) (f10 lambda nil (interactive) (helm-select-nth-action 9)) (f9 lambda nil (interactive) (helm-select-nth-action 8)) (f8 lambda nil (interactive) (helm-select-nth-action 7)) (f7 lambda nil (interactive) (helm-select-nth-action 6)) (f6 lambda nil (interactive) (helm-select-nth-action 5)) (f5 lambda nil (interactive) (helm-select-nth-action 4)) (f4 lambda nil (interactive) (helm-select-nth-action 3)) (f3 lambda nil (interactive) (helm-select-nth-action 2)) (f2 lambda nil (interactive) (helm-select-nth-action 1)) (menu-bar keymap (help-menu keymap (describe keymap (describe-mode . helm-help)))) (help keymap (109 . helm-help)) (f1 lambda nil (interactive) (helm-select-nth-action 0)) (8 keymap (109 . helm-help) (104 . undefined) (8 . undefined) (4 . helm-enable-or-switch-to-debug)) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (3 keymap (63 . helm-help) (62 . helm-toggle-truncate-line) (21 . helm-refresh) (6 . helm-follow-mode) (9 . helm-copy-to-buffer) (11 . helm-kill-selection-and-quit) (25 . helm-yank-selection) (4 . helm-delete-current-selection) (45 . helm-swap-windows)) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (19 . undefined) (18 . undefined) (23 . helm-yank-text-at-point) (24 keymap (2 . helm-resume-list-buffers-after-quit) (98 . helm-resume-previous-session-after-quit) (6 . helm-quit-and-find-file)) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark) (0 . helm-toggle-visible-mark) (C-M-up . helm-scroll-other-window-down) (C-M-down . helm-scroll-other-window) (M-prior . helm-scroll-other-window-down) (M-next . helm-scroll-other-window) (12 . helm-recenter-top-bottom-other-window) (15 . helm-next-source) (10 . helm-execute-persistent-action) (26 . helm-select-action) (9 . helm-execute-persistent-action) (13 . helm-maybe-exit-minibuffer) (left . helm-previous-source) (right . helm-next-source) (7 . helm-keyboard-quit) (22 . helm-next-page) (27 keymap (110 . next-history-element) (112 . previous-history-element) (115 . undefined) (5 . helm-display-all-sources) (1 . helm-show-all-in-this-source-only) (117 . helm-unmark-all) (97 . helm-mark-all) (109 . helm-toggle-all-marks) (41 . helm-next-visible-mark) (40 . helm-prev-visible-mark) (91) (32 . helm-toggle-visible-mark) (33554454 . helm-scroll-other-window-down) (25 . helm-scroll-other-window-down) (22 . helm-scroll-other-window) (12 . helm-reposition-window-other-window) (62 . helm-end-of-buffer) (60 . helm-beginning-of-buffer) (118 . helm-previous-page)) (next . helm-next-page) (prior . helm-previous-page) (C-up . helm-follow-action-backward) (C-down . helm-follow-action-forward) ...) nil nil nil t)
  helm-read-pattern-maybe(nil nil nil nil nil nil nil)
  #[0 "\311\211\211\211\305\206\n

helm-gtags integration with ctags

Since GNU Global can use ctags as backend for other languages, I think it would be beneficial for helm-gtags to make use of ctags feature in GNU Global. We can use helm-gtags for a lot of languages, completely replace the default M-. and M-,.

Issue with relative paths (on Windows)

When I try to jump to a tag, I get the error "find-file-noselect: Wrong type argument: stringp, nil".

This seems to be related to the helm-gtags--action-openfile function and commit b3ee4b8. If I use an older version of helm-gtags--action-openfile, the file opens as expected. Because the file name is only a relative path, helm-gtags--has-drive-letter-p returns nil, which causes problems.

Add pulse highlight when jumping to tags

Please consider adding pulse highlight when jumping to tags just like helm-semantic-or-imenu does. It's quite useful to help focus on the target line.

The following example implementation will import a new dependency on pulse library.

(defun helm-gtags-do-open-file (open-func file line)
  (funcall open-func file helm-gtags-read-only)
  (goto-char (point-min))
  (forward-line (1- line))
  (helm-gtags--push-context helm-gtags-saved-context)
  (pulse-momentary-highlight-one-line (point))) ; pulse here

Problem of helm-gtags-pop-stack when popping from files specified in GTAGSLIBPATH

If GTAGSLIBPATH is set and global jumps to the file specified in GTAGSLIBPATH, helm-gtags-pop-stack can't jump back to the original file, which is because the context stacks of different projects are maintained separately in helm-gtags-context-stack.

Maybe maintaining different context stacks could be made customizable.

Move the cursor to a useful position after jumping to a line

Usually after jumping to a tag, I type Alt-m (back-to-indentation) immediately to move the cursor to the first non-whitespace character.

Putting the cursot at the beginning of the line is usually useless in C sources. How about doing this in helm-gtags-do-open-file.

(defun helm-gtags-do-open-file (open-func file line)
  (funcall open-func file helm-gtags-read-only)
  (goto-char (point-min))
  (forward-line (1- line))
  (back-to-indentation) ; move to the first non-whitespace
  (recenter)
  (helm-gtags--push-context helm-gtags-saved-context)
  (pulse-momentary-highlight-one-line (point)))

Or we can even jumping to the exactly location of the tag by string matching.

Create code completion command using Helm and company

company already provides a way to retrieve function arguments with company-gtags--annotation:

(with-current-buffer "test"
  (insert (mapconcat (lambda (c)
                       (concat c (company-gtags--annotation c))) (company-gtags--fetch-tags "") "\n")))

From the above code snippet, move to any directory that helm-gtags can recognize as a project, create an emppty "test" buffer and run the above code with M-:. You will see that tags will be inserted with arguments.

The standard action for each candidate is that when executed, each candidate got inserted to the current buffer along with its arguments, using the company-template-c-like-templatify, so we can cycle fields similar to yasnippet. The argument to company-template-c-like-templatify is the returned value from company-gtags--annotation.

helm-gtags-suggested-key-binding has no effect

I tried to bind helm-gtags to another prefix and enable it. When I enter mode that has helm-gtags enabled, I still cannot use the prefix key.

(setq helm-gtags-prefix-key "\C-cg"
         helm-gtags-suggested-key-mapping t)

helm-gtags-dwim cannot be used in non-file buffer

To reproduce:

  • Navigate to a project root and generate tags there. Assume that the project has a tag main.
  • M-x compile then run this command echo main()
  • After the compilation buffer appears, move point to main() text.
  • Run helm-gtags-dwim and error occurs, while helm-gtags-find-tag or helm-gtags-find-rtags works perfectly fine.

This is useful when you one to quickly jump with gtags on console output i.e. results from test cases.

Add highlight to persistent-action

When there are multiple candicates, I usually use C-z to see which one is what I need. Highlighting like helm-occur or helm-imenu would make it easier to locate the line that is just shown.

Integrate eldoc with gtags

Currently I still have to use ggtags because of its Eldoc integration. Combined with ctags backend for other language, I get a pretty good environment for many languages. ggtags uses ggtags-eldoc-function, so maybe it's a good place to start if you want to add this feature. If it can be added, I can finally switch to helm-gtags completely.

Jump to files in GTAGSLIBPATH

I wonder whether it's possible to jump to a file in GTAGSLIBPATH with GNU Global. If so, we should add it. For example, I have include files in GTAGSLIBPATH but currently helm-gtags-dwim cannot jump to the file.

helm-gtags-find-tag and helm-gtags-find-rtags should automatically jump to the tag at point

If we really want to choose a specific tag and enter the tag into an input prompt, we already have helm-gtags-select with nice Helm interface and Helm actions to choose between go to definition and go to reference points.

helm-gtags-find-tags and helm-gtags-find-rtags should automatically jump to the tag at point and not to reconfirm again (by hitting enter). Having another prompt asking for input (with the default is the tag at point) is just redundant and inconvenient. Currently, we are missing the ability to directly jump to definition/reference at point.

Allows open tag in other window

Perhaps we could have an action for opening file in another window, so we can leave the current buffer with original position and perform code navigation in other buffer. Later, we can close the other buffer without jumping back to original position with helm-gtags-pop-stack.

Broken: helm-gtags-parse-file

Hello,

since this week: helm-gtags-parse-file is not working correctly anymore.

If I run the command, make a selection and press "Enter" to jump to the point, a new file is create with the name of the selection.

Greets,
Matthias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.