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
Add tags builtin #219
Add tags builtin #219
Conversation
faa79ff
to
ce8e67d
Compare
@yujinyuz would be great if you could test this one. |
69ddba3
to
f7c8ba3
Compare
@Conni2461 do you mind guiding me how can I test this in my local? |
@yujinyuz i don't know where you need help exactly so i give you an full instruction. Feel free to ask questions if something does not work.
only_current_file = true -- default is false, setting this to true will only show tags for the current file
hide_filename = true -- default is false
show_line = true -- default is false
shorten_path = true
previewer = false -- default is true these options can be combines freely. I would suggest checking out these ones:
|
@tjdevries Should be good to review. If you find some time. |
OH! The other thing is that if it has a command / search thing, we could use that to find the tag in the file, without the line numbers. Isn't that what FZF does as well? I think we do it for helptags as well btw |
Yeah i mentioned this in a previous comment but i had problems with tags in Makefiles when it was a multiline tag. I will take another look at was FZF exactly does and ping you if i have a new version up and running |
d8ac5a1
to
3cb993f
Compare
@tjdevries I don't know if this is good, but with my testing i have not encountered a line where i could not find the lnum.
I don't actually get what the guys in FZF do, because they use perl and a |
Implementation is so much cleaner now! Also, implementation of action is very good. Thanks! |
Why is it that it's not able to find my
Running
When using FZF, it works just fine |
@yujinyuz sadly it needs to be generated via ctags -R it would be cool to havr auto generated and added to special place where they get manages by telephone "cache" . What do u think @Conni2461 |
@tami5 Im using universal ctags and a tags file already exists in my project root. What am I missing here? |
@yujinyuz ohh just make sure vim cwd matches that root directory |
@tami5 If you have time, could you take a look at this: My nvim version is
Also I'm running the latest telescope.nvim |
This might a potential bug🧐, please open a bug report and I will try to reproduce and fix it after my morning coffee 😬 |
@tami5 I can't reproduce it with minimal settings. Might be because of my config. I'll try to debug this. Anyway, thanks! |
@yujinyuz oh I hate when that happens, check you telescope settings then test if any plugin is intervening in some way |
@yujinyuz to be honest i'm really confused right now 😆 @tami5 We don't wanna cache tags because ctags basically are a pregenerated cache. Does that make sense. All we do is read the file. But we could load that file async with a plenary job. |
I just ran
|
But this might be one of the plugins I'm using that causes the conflict |
Okay so i don't get it. It is fine that it keeps increasing because we get a filehandle as result. But i don't get why another plugin might cause a conflict here. All i do is check if that handle isn't nil and if it is i will return that message 😕 |
I see what you mean @Conni2461, here's my thoughts while some users and some use cases will rather have tags files pregenerated and maintained. There are some cases where you have a code base that doesn't have tags generated and you want to tun Telescope tags and get back results without having to generate it and then reeeerun the command. I suggest having vim.loop.fs_stat that check if tag file is valid in vim.loop.cwd and if not, ensure that there is one in .cache/...../tags-dirname and use it. What do you think? for the async part, :D i'm still in stages of not knowing how it works but see huge amount of value in it |
Btw, I just tried commenting out all my plugins and it seems that it's not the case |
But you could also not reproduce it with a sami5 minimal rc? Could you remove the telescope.nvim/lua/telescope/builtin/init.lua Lines 942 to 945 in 5513f85
|
I finally found the cause of the error. I had this line in my .vimrc set wildignore+=tags,.*.un~,*.pyc Idk why it can't find because I added |
Okay. Hmm i think that should be fixed by me. Will provide a fix asap. |
Oh, yeah I forgot to give feedback as I've only tested it today. My only concern is that it doesn't exactly match what I want? For example in FZF, it matches correctly if I type But when using telescope I get I'm also not sure why it was not found because of |
I will look at that in a sec. Our default sorter is not as good as fzf. But you can change that to fzy
Our idea is that we have a modular design and you basically can change everything. |
A list of file patterns. A file that matches with one of these
patterns is ignored when expanding |wildcards|, completing file or
directory names, and influences the result of |expand()|, |glob()| and
|globpath()| unless a flag is passed to disable this. It is f****** |
@Conni2461 welcome! Btw, I just added this to my config
But I'm still getting the same output as the one above. It seems that it matches the filename first rather than the content of the |
I might need to change the |
No problem. Thanks @Conni2461 |
@tami5 I think that is too much we have to handle. We then basically become a ctags plugin. I think tj just wants builtin suff simple and clean. I am also not that familiar with plenary jobs. I am working with them since yesterday. I will try to implement that now. You should join the discussion over at #273. |
Close #209
Written in a coffee break, so WIP.Currently has to be generated with--fields=n
to get the line numbers. Soctags -R --fields=+n
Createctags
for user if file does not existsmake_entry
display
with new table createTake another look at how lines numbers get retrieved in fzf, so we don't have to use--fields=+n
. I decided to just force having--fields=+n
. We could search for the lines but it is kinda unnecessary.Only--fields=n
will not generate the other fields liketype
but using--fields=+n
includes these fields aswell but does not work this current version\t
and don't split if the line has\^\t
Available options: