-
-
Notifications
You must be signed in to change notification settings - Fork 262
fix(from_snipmate): extends #315
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
Conversation
|
I think I've solved the problem, but the WiFi in my room is not working, so the update will have to wait (this post is from my iPhone). |
|
xD |
|
In the case of lazy, only look at |
|
Ah, I understand. |
|
Oh I see, #include. That's easier to understand and use. |
|
TY, I'm glad we're on the same page 👍 |
|
It took some design changes, but I was able to implement it. Reading files asynchronously was complicated and confusing, so I borrowed Path.read_file from that PR and used it. It takes about 700ms to load all the honza/vim-snippets without lazy_load, so we need to tell users. |
|
Time to start coding in your iPhone bro 😄 |
|
It works fine for my own testing. (and WiFi is probably back on) |
|
@uga-rosa could you profile the loading? Maybe when can find out what's what makes it "slow", you just have to be using luajit 2.1 (it comes with the neovim from the releases, is the default in debian, for arch it's in AUR) and do something like: And share your |
|
It's like this, isn't it? |
|
@L3MON4D3 check this, maybe if you try it in your branch (the one for sync vscode loading) we can get more precise results (as we have more files there) but seems like |
|
I'm loading my own snippets and honza/vim-snippets. |
|
Oh holy.. |
|
@uga-rosa You also included the previously unsupported (iirc :D ) |
|
Hmmm? I think it supported {filetype}.snippets and {filetype}/*.snippets before. |
|
BTW the flame graph has extra data, if you click it you can see the percent of each bar while hovering it. |
Oh, nvm then :D |
It's only a picture for me 😅 But it's clear that |
It was 57.35%. I'm curious... |
|
Should we warn users that both a (in |
Damn, that's quite a bit... |
Hmm. It would certainly be better to write it in the help. |
|
I fixed the horrendous performance of (with |
|
I think the synchronous_load-PR can be merged tomorrow or so, @uga-rosa would you extend (haha get it :P) the existing snipmate-test suite with one for I'll be happy to help if you have any questions concerning the tests :) |
|
Is it something like this? Please let me know if something is wrong. |
|
Jup, looks good 👍 |
|
I accidentially merged an older version of this PR (didn't update my local branch before merging 🤦), but now all should be in order. |
|
I'm sorry, nvm, I'm getting this error when calling the regular Somehow it doesn't happen in the tests. I've got to go rn, could you look into it @uga-rosa? |
|
Ah, let add |
|
Thank you ❤️ |
|
Okay, I found the error, fixed with 1a0fac4 |
|
Ah, I see, because scandir now returns the full path. |
|
Jup, that's it exactly. |
This PR is incomplete.
If you use load to load all the snippets at once, this is fine, but if you use lazy_load, there is a bug where the snippets are loaded repeatedly when the filetype changes, resulting in duplicate candidates.
If you prepare sh.snippets as follows and open hoge.sh, then run
:set ft=zsh, you should be able to reproduce the problem.Furthermore, with lazy_load, if you open a file with ft=zsh without going through ft=sh, the snippet will not be added.