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

:tag command completion should use 'tagfunc' #22376

Open
BioBox opened this issue Feb 23, 2023 · 4 comments
Open

:tag command completion should use 'tagfunc' #22376

BioBox opened this issue Feb 23, 2023 · 4 comments
Labels
enhancement feature request needs:vim-patch upstream issue that needs to be fixed in vim first options configuration, settings

Comments

@BioBox
Copy link

BioBox commented Feb 23, 2023

Problem

Before switching from ctags to LSP, I would often use the :tag command very frequently to jump to a desired section of the code, but the completion functionality within the commandline is only valid with the use of tag files instead of the equivalent LSP functionality. Can there be a way for the code in cmdexpand.c to be modified in such a way to achieve this?

Expected behavior

I'm not sure exactly how LSP is done on neovim because I'm actually currenly a vim9 user, but for vim9 I was thinking of an extra 'tagsearch' option that functions similarly to 'tagfunc' but for cmd completion instead of jumping to the symbol definition underneath the cursor. Let me know what you all think.

@BioBox BioBox added the enhancement feature request label Feb 23, 2023
@justinmk
Copy link
Member

Why doesn't :tag use 'tagfunc' ? Was this raised at https://github.com/vim/vim/ ?

@justinmk justinmk added needs:vim-patch upstream issue that needs to be fixed in vim first options configuration, settings labels Feb 23, 2023
@justinmk justinmk changed the title Have :tag command completion use LSP :tag command completion should use 'tagfunc' Feb 23, 2023
@BioBox
Copy link
Author

BioBox commented Feb 23, 2023

Yeah I raised it over at vim.
The tag command in tag.c does use tagfunc, but the completion done by pressing <tab> as described in cmdexpand.c does not.

So I can still use :tag, but I'll have to type the entire symbol name each and every time; and that's the crux of the problem. The lsp API for jumping to a definition under a cursor is different from what one would use in trying to find a match when the user is tying in a tag name; that functionality is hard-coded as part of the C code in vim and neovim and can't be altered.

@clason
Copy link
Member

clason commented Feb 23, 2023

but the completion done by pressing as described in cmdexpand.c does not.

The question is "why doesn't it?"

@justinmk
Copy link
Member

justinmk commented Mar 8, 2023

vim/vim#12039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request needs:vim-patch upstream issue that needs to be fixed in vim first options configuration, settings
Projects
None yet
Development

No branches or pull requests

3 participants