Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of Universal Ctags #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Wraul
Copy link

@Wraul Wraul commented Dec 24, 2015

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

Recently Universal Ctags changed version from 'Development' to '0.0.0'
which broke the detection.
@danarnold
Copy link

This would be great! I too have this issue.

@decentral1se
Copy link

Awesome, hope to see this upstream soon.

@xpac27
Copy link

xpac27 commented Jan 22, 2016

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

@still-dreaming-1
Copy link

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
Copy link

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.

@al3xandru
Copy link

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

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

@still-dreaming-1
Copy link

@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.

@al3xandru
Copy link

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.

@still-dreaming-1
Copy link

@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.

@al3xandru
Copy link

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).

@pjrt
Copy link

pjrt commented Oct 19, 2016

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

@carlitux
Copy link

looks like this project is not maintained any more

@decentral1se
Copy link

fork, fork, fork, fork, fork

@rogeruiz
Copy link

rogeruiz commented Jul 19, 2017

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']))

aude added a commit to aude/dotfiles that referenced this pull request Nov 11, 2018
original project is not updated, pull request with fix is not being merged:
xolox/vim-easytags#133
JohnStarich added a commit to JohnStarich/vim-easytags that referenced this pull request Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

easytags not parsing ctags version correctly
9 participants