vim-easytags icon indicating copy to clipboard operation
vim-easytags copied to clipboard

Fix detection of Universal Ctags

Open Wraul opened this issue 9 years ago • 14 comments

Recently Universal Ctags changed version from 'Development' to '0.0.0' which broke the detection.

I have changed the detection to explicitly test for Universal Ctags and in that case ignore the version.

This should fix #132

Wraul avatar Dec 24 '15 13:12 Wraul

This would be great! I too have this issue.

danarnold avatar Jan 08 '16 20:01 danarnold

Awesome, hope to see this upstream soon.

decentral1se avatar Jan 14 '16 21:01 decentral1se

Me too! because I need to use Universal Ctags to get support for C++11.

xpac27 avatar Jan 22 '16 11:01 xpac27

I just experienced this problem installing this plugin for the first time. I was hoping it would just work with universal ctags since it has the same executable name and is based on exuberant ctags. But when my Neovim starts up it says

easytags.vim 3.11: Plug-in not loaded because Exuberant Ctags 5.5 or newer is required while you have version 0.0.0 installed!                                
Press ENTER or type command to continue

Seems like maybe it is too smart for it's own good and not checking the version would be less problematic. When I run ctags --version this is what I see:

Universal Ctags 0.0.0(43bec42), Copyright (C) 2015 Universal Ctags Team                                                                                       
Universal Ctags is derived from Exuberant Ctags.                                                                                                              
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert                                                                                                   
  Compiled: Feb 25 2016, 12:40:16                                                                                                                             
  URL: https://ctags.io/                                                                                                                                      
  Optional compiled features: +wildcards, +regex, +option-directory, +coproc, +xpath

still-dreaming-1 avatar Feb 28 '16 23:02 still-dreaming-1

I just pointed my plugin manager to the commit from this pull request. I will let you know how it works for me. So far, it has allowed to me to at least start Neovim without the error message.

still-dreaming-1 avatar Feb 28 '16 23:02 still-dreaming-1

@still-dreaming-1 how is it going? what plugin manager are you using?

@xolox: this is a :thumbsup: from another universal-ctags user

al3xandru avatar Apr 07 '16 06:04 al3xandru

@al3xandru Actually I got this working somehow, I forget how. After getting it working, I discovered this plugin actually has an option to disable checking the ctags version, which is a great workaround for this. After I got it working, I tried out the plugin and ended up not liking it. I forget why exactly I didn't like this particular plugin because I tried a bunch of different tags plugins and I didn't like any of them. I ended up making my own tags plugin: vim-project-tags. It is already past version 1 because I am using it with my own projects already and I'm getting a lot of usefulness out of it.

still-dreaming-1 avatar Apr 07 '16 19:04 still-dreaming-1

Thanks for the update @still-dreaming-1. I'll check out your plugin too (I currently switched to guttentags hoping this PR will be accepted). I'll look again for the version check flag, but I don't remember seeing it.

al3xandru avatar Apr 07 '16 20:04 al3xandru

@al3xandru Here is the option I was thinking of: g:easytags_suppress_ctags_warning I haven't tried it, but it sounds like it would suppress the error message that is causing problems. Also to answer one of your questions, I am using the vim-plug plugin manager. Actually you can see my entire Neovim configuration in my dot files.

still-dreaming-1 avatar Apr 07 '16 23:04 still-dreaming-1

Thanks @still-dreaming-1. I was heading here to post about let g:easytags_suppress_ctags_warning = 1 which even if I haven't tested yet seems to be the one disabling the warning (not the check though).

al3xandru avatar Apr 08 '16 03:04 al3xandru

Is there a reason this hasn't been merged yet?

pjrt avatar Oct 19 '16 13:10 pjrt

looks like this project is not maintained any more

carlitux avatar Nov 13 '16 04:11 carlitux

fork, fork, fork, fork, fork

decentral1se avatar Nov 13 '16 15:11 decentral1se

Wasn't able to apply the contents of this patch directly, but here's an updated patch file from a fresh clone. Just run git apply universal_tag_support.patch with the file below and it should fix the issue.

$ cat universal_tag_support.patch
diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim
index d0dec21..3c85e6a 100644
--- a/autoload/xolox/easytags.vim
+++ b/autoload/xolox/easytags.vim
@@ -78,19 +78,25 @@ function! xolox#easytags#check_ctags_compatible(name, min_version) " {{{2
     call xolox#misc#msg#debug("easytags.vim %s: Command '%s' returned nonzero exit code %i!", g:xolox#easytags#version, a:name, result['exit_code'])
   else
     " Extract the version number from the output.
-    let pattern = '\(Exuberant\|Universal\) Ctags \zs\(\d\+\(\.\d\+\)*\|Development\)'
-    let g:easytags_ctags_version = matchstr(get(result['stdout'], 0, ''), pattern)
-    " Deal with development builds.
-    if g:easytags_ctags_version == 'Development'
-      call xolox#misc#msg#debug("easytags.vim %s: Assuming development build is compatible ..", g:xolox#easytags#version, a:name)
-      return 1
-    endif
-    " Make sure the version is compatible.
-    if xolox#misc#version#at_least(a:min_version, g:easytags_ctags_version)
-      call xolox#misc#msg#debug("easytags.vim %s: Version is compatible! :-)", g:xolox#easytags#version)
-      return 1
-    else
-      call xolox#misc#msg#debug("easytags.vim %s: Version is not compatible! :-(", g:xolox#easytags#version)
+    let pattern = '\(\w\+\) Ctags \(\d\+\(\.\d\+\)*\|Development\)'
+    let match = matchlist(get(result['stdout'], 0, ''), pattern)
+    let g:easytags_ctags_fork = match[1]
+    let g:easytags_ctags_version = match[2]
+    if g:easytags_ctags_fork != '' && g:easytags_ctags_version != ''
+      call xolox#misc#msg#debug("easytags.vim %s: Detected %s Ctags %s", g:xolox#easytags#version, g:easytags_ctags_fork, g:easytags_ctags_version)
+      if g:easytags_ctags_fork == 'Universal'
+        " All versions should be compatible.
+        call xolox#misc#msg#debug("easytags.vim %s: Assuming all versions is compatible ..", g:xolox#easytags#version)
+        return 1
+      elseif g:easytags_ctags_fork == 'Exuberant'
+        " Make sure the version is compatible.
+        if xolox#misc#version#at_least(a:min_version, g:easytags_ctags_version)
+          call xolox#misc#msg#debug("easytags.vim %s: Version is compatible! :-)", g:xolox#easytags#version)
+          return 1
+        else
+          call xolox#misc#msg#debug("easytags.vim %s: Version is not compatible! :-(", g:xolox#easytags#version)
+        endif
+      endif
     endif
   endif
   call xolox#misc#msg#debug("easytags.vim %s: Standard output of command: %s", g:xolox#easytags#version, string(result['stdout']))

rogeruiz avatar Jul 19 '17 18:07 rogeruiz