-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RFC] rplugin: let the python host identify packages #4438
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
\ function('provider#pythonx#Require')) | ||
call remote#host#Register('python3', '*.py', | ||
call remote#host#Register('python3', '*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 lines are the only real change here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unlet! specs
is very real. The others are real as well if we don't want misleading messages.
👍 I'd like to completely remove the need for exposing users to it. It should only be something that plug managers do. (In fact, we could hook into
|
BTW, LGTM, please merge if RDY. |
rplugin: let the python host identify packages
Thanks, merged. And by |
True, I thoght JSON to make it human readable but we already have an edit plugin for shada... Would it be fine to |
It would be fine to write only the rplugin section (unless there is some technical reason I am not aware of). The fact that it's all contained in the same file is a feature. Most users have no idea that The rplugin section of the shada file would not be "optional" however, any more than we would make If user uses |
Sure, I'm not suggesting that we should continue to keep generated data in
👍 |
endfor | ||
echomsg printf("remote/host: %s host registered plugins %s", | ||
\ a:host, string(map(copy(paths), "fnamemodify(v:val, ':t')"))) | ||
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map()
modifies list in-place. It is a good practice to not use copy(list)
or list[:]
only when you need in-place modification in :call
or when you need super optimization, not when it is harmless in the current state of code because it is only harmless in the current state, not outside of :call
because it is hard to mention side-effects otherwise and not when your goal is something other then making code that is called really often run a bit faster (I needed such optimizations only for a few thousand calls).
For neovim/pynvim#183
Eventually I would also like to reduce the need for
:UpdateRemotePlugins
. The python-client already recalculates the specs everytime a plugin is actually used, it could send them back to neovim, and neovim could check if the specs changed and in that case updateinit.vim-rplugin
in place. For that we should change that file to a machine-readable format like JSON. In the long run we should detect all rplugin update event kinds so:URP
never is strictly needed (it can save an extra nvim restart but nvim should be fine without it after a restart or two)Repo synchronization: neovim/pynvim#183 requires this, but this patch works without that one (
:UpdateRemotePlugins
gets uglier but it still works)