xolox / vim-easytags

Automated tag file generation and syntax highlighting of tags in Vim
http://peterodding.com/code/vim/easytags/
1.01k stars 109 forks source link

Fix detection of Universal Ctags #133

Open Wraul opened 8 years ago

Wraul commented 8 years ago

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

danarnold commented 8 years ago

This would be great! I too have this issue.

decentral1se commented 8 years ago

Awesome, hope to see this upstream soon.

xpac27 commented 8 years ago

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

still-dreaming-1 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

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

still-dreaming-1 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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 commented 7 years ago

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

carlitux commented 7 years ago

looks like this project is not maintained any more

decentral1se commented 7 years ago

fork, fork, fork, fork, fork

rogeruiz commented 6 years ago

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