Closed lambdalisue closed 10 months ago
The updates across various Vim script and TypeScript files in Denops reflect a shift in plugin handling and message dispatching. The changes streamline the flow by centralizing meta information and refining control mechanisms. This reorganization suggests a move towards more efficient and maintainable code, particularly in the way plugins register and reload, and how the system handles internal notifications and service sessions.
File Path | Change Summary |
---|---|
autoload/denops.vim | Removed denops#trace configuration definition. |
autoload/denops/_internal/server/chan.vim | Replaced doautocmd with s:rpcnotify in s:connect function. |
autoload/denops/plugin.vim | Refactored plugin registration logic, deprecated denops#plugin#register() , and introduced a new function for plugin loading. |
denops/@denops-private/cli.ts | Updated handleConn function, added isMeta import. |
denops/@denops-private/host/invoker.ts | Removed meta parameter from load and reload methods. |
denops/@denops-private/host/{nvim.ts, vim.ts} | Updated message handling and dispatching, added #invoker field. |
denops/@denops-private/service.ts | Included meta property in the Service class, updated register and reload methods. |
doc/denops.txt | Added initialization requirement for g:denops#debug variable, renamed denops#server#stop() to denops#server#close() . |
plugin/denops.vim | Removed autocmd, added call to denops#server#wait_async in s:init() . |
denops/@denops-private/worker/script.ts | Removed trace parameter from main function's signature, updated related logic. |
🐇 In the den of code, where plugins abide, 🌟 Refactoring's done with a swift, smooth stride. 🧩 Pieces align in a dance of the bytes, 🎉 CodeRabbit cheers for the streamlined delights!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
b0812d3
) 96.47% compared to head (be0bd9b
) 96.47%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
It seems tests are broken. I'll fix later
Fixed
The conflict exists.
I will test it.
🐛 Fix fire timing of DenopsReady autocmd
Previously, the
DenopsReady
autocmd was fired when the channel was connected. However, it is not the right timing because the denops itself may not be ready yet. This commit fixes the timing of the autocmd so that denops is ready when the autocmd is fired.If this change cause issue, developers should use
denops#server#wait()
ordenops#server#wait_async()
function to ensure that functions are called AFTER denops got ready. For example💥 Read meta only once in initialization
This is a minor but a breaking change. This change affects the
g:denops#debug
variable. After this commit, the variable must be configured prior to the denops initialization.💥 Synchronously call wait_async() callbacks
It seems
timer_start()
triks is no longer needed so we can call callbacks synchronously in both cases.Let me know if this cause acutal issues (it might break lazy loading mech of denops that are not tested by myself.)
💥 Remove g:denops#trace option
The trace feature is not available when denops liberates from Worker and the feature obstructs the development of denops.
💥 Remove DenopsPluginRegister:* autocmd
We are planning to change internal registration mechanism and the autocmd is not suited for the new mechanism.
Quick search on GitHub shows that the autocmd is not used by anyones.
https://github.com/search?q=DenopsPluginRegister&type=code
💥 Remove {options} from register, reload, discover
We found that developers always use
mode: "skip"
and other options are not necessary. So we decided to remove{options}
from functions and always usemode: "skip"
.Quick search revelaed that no one uses
reload
anddiscover
with{options}
but some (e.g. dein.vim) usesregister
with{options}
.That's why we introduced a new
load
function that replacesregister
.Developers who need to support previous denops should use
load
whenever possible like:Summary by CodeRabbit
Summary by CodeRabbit
Refactor
New Features
Documentation
Bug Fixes