-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Speed up tag search #442
Comments
If
To speed up narrowing down items you can use external CtrlP matcher like nixprime/cpsm or FelikZ/ctrlp-py-matcher which is much faster than built-in matcher. |
Thank you very much.. I will look into one of these.. |
@tacahiroy I installed It did speed up the search process quite a bit. However, I finding that For example, in the current buffer, if I use Is there any other setting I need to enable for Or do I need to increase the number of tags that |
I opened a issue on |
Can you give me more details about your setup please.
|
Sure.. I installed https://github.com/universal-ctags/ctags.git Ctags:
I will generate a new tag file, because I can't share the current tag file.. |
Its a bit weird.. I tried replicating it wit the ctrlp repository, and this issue doesn't exist. I can use However, when I try to use my own repository, I am still having the same problem. To check whether this is just coming from having some errors in my previous tag file, I deleted my original tag file and regenerated a new tag file. However, even after generation of the new tag file, the problem still exists. I can't get My repository however is much larger than Most of the size of my repository comes from having a relatively large number of external Python libraries that I use (~185mb) vs ~57mb of actual code (+data). Have you guys experienced this kind of issues with relatively large repositories? |
Well my initial hypothesis of this being related to the tag file and repository file size probably is wrong.. I tried it with the linux kernel repository (3.7GB) size and a 500mb tag file.. It was able to find specific keys from the repository.. |
It turns out.. that if I do remove the |
Ok.. I have been able to reproduce it using another library. What seems to be important here to reproduce this issue is
Steps to reproduce:
However, Next, do the following:
Next in P.S. I am using |
hmm - I don't reproduce the issue by following the steps above :/ Is there 'options' in the tags file in both cases actually?
|
@tacahiroy.. thanks for checking.. I will try to follow your steps and see it works.. |
What version of To reduce it to the smallest problem possible, I am not loading anything else other than the necessary files, so my .vim consists of the following .vim/ This is the vimrc I am using now:
I am running ctrlp version (as you are): 306bc60 ctrlp-py-matcher version (latest version): cf63fd5 ctags version: 4fe1a60 Vim version: 8.0.1430 I removed Yes, the |
Added the tags with and without the env folder: |
Upgraded my ctags to your version: 44a0e97.. but the problem still persists. The only difference, I can see now is that you have a later VIM version.. I will try that as well... In the mean time, if you have any idea whats going on.. or how to debug this issue let me know.. |
Updated my |
Created a small test with a vimrc, ctrlp, ctrlp-pymatcher, pathogen, Jinja2 etc here: https://github.com/alphaCTzo7G/test if you do a and then do
Then do a If you remove the I was able to reproduce this with |
Please have a look at #421, universal ctags does not support "-extra" anymore. The given pull-request still isn't merged. |
@Grueslayer .. thanks for replying.. In this case, Maybe, I dont understand the implications of the patch..However, there too I dont see anything related to Wondering why you think this is related to the I will try out your suggestion anyways to see if it resolves the issue.. |
This was my fault, I thought about CtrlPBufTag. This is not using the tags file, instead it is calling ctags by itself (and universal ctags does not accept -extra anymore, it fails). You are right that does not matter for CtrlPTag itself. Sorry. Did you had a look in the tagfile itself, anything different for the lines when including additional stuff? |
@Grueslayer .. actually there is not much difference.. I tracked it down to one file(atleast for the jinja2 library) which is causing If I have this file anywhere in my repostitory Heres the https://github.com/alphaCTzo7G/test This repository contains the To replicate the problem: `
Next try to remove the
|
The only difference that I can find between the 2 tag files in the tags file uploaded to the github repository is this line:
related to the |
Everything works quite fine with both tags files from you (and generated myself) under MacOS (8.0.1238 and 8.1.72) using your stripped down setup. The line contains many UTF-8 encoded characters, maybe not handled correct by your vim / python? |
Hmm.. I made a small correction to the instructions above to replicate the problem.. When I have but they show up when I have If both you and @tacahiroy haven't been able to replicate it, perhaps its related to my I will do some tests to see if the Thanks for checking.. |
I just thought I would update it here.. that the issues is with a particular function in vim When I did remove the
It seems that @ludovicchabant also faced the same issue and had to modify https://github.com/ludovicchabant/vim-gutentags to handle the issue: https://ludovic.chabant.com/devblog/2017/02/25/aaa-gamedev-with-vim/ His modification of I am not sure yet why you guys are being able to get the tags even when Currently, I have eliminated the entire Do you guys know any other alternative to |
This is the wrong approach. First: Tags file shouldn't contain any BOM within its tags definition lines (there are 2 more BOMs for UTF16LE/BE). Second: BOM is only at start of a file, vim gives a list of strings to python, so BOM must be stripped by reading a file and content kept in the current encoding.
… Am 15.07.2018 um 01:41 schrieb alphaCTzo7G ***@***.***>:
I just thought I would update it here.. that the issues is with a particular function in vim vim.eval which is used by ctrlp-py-matcher. Certain files such as _idenfier.py in the jinja2 library contain BOM fields. This apparently crashes vim.eval
When I did remove the BOM field form the _identifier.py using the solution here: https://unix.stackexchange.com/a/381263/242983, regenerated the tags
:CtrlPTag started working again using the `ctrlp-py-matcher.
It seems that @ludovicchabant also faced the same issue and had to modify https://github.com/ludovicchabant/vim-gutentags to handle the issue: https://ludovic.chabant.com/devblog/2017/02/25/aaa-gamedev-with-vim/
His modification of ctrlp-py-matcher is here: https://github.com/ludovicchabant/ctrlp-py-matcher/blob/2f6947480203b734b069e5d9f69ba440db6b4698/autoload/pymatcher.py#L22
I am not sure yet why you guys are being able to get the tags even when _identifier.py and the BOM fields are present in your tags... Any ideas?
Currently, I have eliminated the entire python env folder because my own python files are not going to have these BOM fields, and I have the correct encoding set up.
Do you guys know any other alternative to vim.eval which would able to convert a:items to the python equivalent, even if a:items has BOM fields https://github.com/FelikZ/ctrlp-py-matcher/blob/cf63fd546f1e80dd4db3db96afbeaad301d21f13/autoload/pymatcher.py#L7?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Grueslayer .. Thanks for your reply. What if ctags contains invalid characters. In my case,
Also you are correct, that there is probably no BOM in the file atleast in my case. If I open up the file in vim and use it seems the invalid I have seen this happen on multiple libraries.. weirdly, this has happened mostly on Even if there is a single invalid character in the entire python library, What would be the right approach? |
Hi all,
I use
Universal Ctag
andgutentags
to generate the tag files. However, when I use:CtrlPTag
, it takes a lot of time to search through the tags.If I use
find
in thectrlp_user_command
, will I be able to speed up the tag search?Does
ctrlp
use the same engine for all searches?files/buffer/tags
etc?The text was updated successfully, but these errors were encountered: