ctag code for ruby added
This commit is contained in:
parent
c58df5fed9
commit
a3be819fed
|
@ -8,6 +8,8 @@
|
||||||
(setup-inf-ruby)
|
(setup-inf-ruby)
|
||||||
(setup-bundler)
|
(setup-bundler)
|
||||||
|
|
||||||
|
(global-set-key (kbd "M-.") 'my-find-tag)
|
||||||
|
|
||||||
(with-ability rbenv
|
(with-ability rbenv
|
||||||
(require 'rbenv)
|
(require 'rbenv)
|
||||||
(global-rbenv-mode))
|
(global-rbenv-mode))
|
||||||
|
|
|
@ -61,4 +61,30 @@
|
||||||
;; Hack autocomplete so it treat :symbole and symbole the same way
|
;; Hack autocomplete so it treat :symbole and symbole the same way
|
||||||
(modify-syntax-entry ?: "."))
|
(modify-syntax-entry ?: "."))
|
||||||
|
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun visit-project-tags ()
|
||||||
|
(interactive)
|
||||||
|
(let ((tags-file (concat (projectile-project-root) "TAGS")))
|
||||||
|
(visit-tags-table tags-file)
|
||||||
|
(message (concat "Loaded " tags-file))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun build-ctag-file ()
|
||||||
|
"Create the ctag of the ruby project"
|
||||||
|
(interactive)
|
||||||
|
(message "building project tags")
|
||||||
|
(let ((root (projectile-project-root)))
|
||||||
|
(shell-command (concat "ctags -e -R . $(bundle list --paths) --extra=+fq --exclude=db --exclude=test --exclude=.git --exclude=public -f " root "TAGS " root)))
|
||||||
|
(visit-project-tags)
|
||||||
|
(message "tags built successfully"))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun my-find-tag ()
|
||||||
|
(interactive)
|
||||||
|
(if (file-exists-p (concat (projectile-project-root) "TAGS"))
|
||||||
|
(visit-project-tags)
|
||||||
|
(build-ctags))
|
||||||
|
(etags-select-find-tag-at-point))
|
||||||
|
|
||||||
(provide 'extensions/ruby/setup)
|
(provide 'extensions/ruby/setup)
|
||||||
|
|
Loading…
Reference in New Issue