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

CocTagFunc not working #71

Open
Draiken opened this issue Jul 13, 2023 · 9 comments
Open

CocTagFunc not working #71

Draiken opened this issue Jul 13, 2023 · 9 comments

Comments

@Draiken
Copy link

Draiken commented Jul 13, 2023

I'm attempting to use set tagfunc=CocTagFunc and it doesn't seem to work with Solargraph.
It seems to call getTagList and looking through the code it makes definition calls to the LSP, so this should be present in Solargraph. Calling call CocAction('jumpDefinition') works and AFAICT that's pretty much what the taglist would do.

I'm happy to dig deeper and try to come up with a solution but I'd need some pointers since I just switched over to COC and I'm not familiar with it.

My best guess is that this is a small missing piece (perhaps on the client configuration?).

@chemzqm
Copy link
Member

chemzqm commented Sep 3, 2023

Seems no definitioin found.

@chemzqm chemzqm closed this as completed Sep 3, 2023
@Draiken
Copy link
Author

Draiken commented Sep 4, 2023

@chemzqm I'm sorry, what does this mean?

The issue remains. On the same definition, jump to definition works, using the tag navigation does not.

@chemzqm chemzqm reopened this Sep 5, 2023
@chemzqm
Copy link
Member

chemzqm commented Sep 5, 2023

jump to definition works, using the tag navigation does not.

Not able to reproduce.

@Draiken
Copy link
Author

Draiken commented Sep 5, 2023

I attempted to reproduce this with a clean vimrc and indeed it does seem to work. It seems the issue is with my specific configuration.

Thanks for looking into it!

@Draiken Draiken closed this as completed Sep 5, 2023
@Draiken
Copy link
Author

Draiken commented Sep 5, 2023

@chemzqm if you could help me, I am puzzled at this.

I tried using a clean CoC install, and it worked with this. I had to manually set the filetype to ruby, then the tag command works.

set nocompatible
filetype off

set rtp=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'neoclide/coc.nvim'
call vundle#end()
filetype plugin indent on
syntax on

set tagfunc=CocTagFunc

If I add back the default /usr/share/vim/vim90 to the runtime path, it stops working

set nocompatible
filetype off

set rtp=/usr/share/vim/vim90
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'neoclide/coc.nvim'
call vundle#end()
filetype plugin indent on
syntax on

set tagfunc=CocTagFunc

This is my vim version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 02 2023 19:48:15)
Included patches: 1-1848
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       +tcl/dyn
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
+balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
+browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl/dyn          +title
+channel           +ipv6              +persistent_undo   +toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby/dyn          +wildignore
+cursorbind        +lua/dyn           +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con_gui    +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/vim/src=/usr/src/debug/vim -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.38/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm 

It seems that something in the default vim runtime is breaking this behavior for me. If you can help me in any way, I'd really appreciate it. Thanks!

@chemzqm
Copy link
Member

chemzqm commented Sep 5, 2023

set rtp=/usr/share/vim/vim90

What is inside the file vim90?

@Draiken
Copy link
Author

Draiken commented Sep 5, 2023

It's the default vim runtime for vim 9. Basically it's the system's installation which includes what is in this folder from vim's source.

@Draiken
Copy link
Author

Draiken commented Sep 5, 2023

It might mean that there's a conflict with whatever is being packaged in vim for my Linux installation. Or maybe it's for all installations.

I'm gonna see if I can reproduce this in a docker container

@Draiken
Copy link
Author

Draiken commented Sep 5, 2023

Okay, I've managed to reproduce this. Something is wrong with the plugin running a default vim installation. I've created a repository with a Docker image reproducing the issue. Instructions are on the README

https://github.com/Draiken/vim-tags-issue

@Draiken Draiken reopened this Sep 5, 2023
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

No branches or pull requests

2 participants