Closed Milly closed 2 months ago
The updates primarily convert the notify
method in the Host
interface and its implementations (in nvim.ts
and vim.ts
) from synchronous to asynchronous by returning a Promise<void>
. Additionally, worker.ts
sees refactoring for improved console method patching. These changes optimize code maintainability and enhance asynchronous operations handling.
File(s) | Change Summary |
---|---|
denops/@denops-private/host.ts |
Updated notify method in Host interface to return Promise<void> instead of void . |
denops/@denops-private/host/nvim.ts |
Updated notify method in Neovim class to return Promise<void> and used async/await ; Updated "jsr:@lambdalisue/messagepack-rpc" version from 2.1.1 to 2.4.0 . |
denops/@denops-private/host/vim.ts |
Updated notify method in Vim class to async notify returning Promise<void> with added await for this.#client.callNoReply . |
denops/@denops-private/worker.ts |
Refactored console patching; introduced patchConsole to centralize method patching logic dynamically based on CONSOLE_PATCH_METHODS and meta.mode ; Updated imports for Meta and Host . |
denops/@denops-private/worker_test.ts |
Added imports for Neovim , Vim , and assertObjectMatch ; Enhanced test logic to include stubbing behaviors and native console methods. |
This section is omitted due to the varied and specific nature of the changes which don't lend themselves to simple flow diagrams.
In the code's realm, where changes bloom,
Asynchronous whispers break the gloom.
WithPromises
they now align,
Methods await in elegant design.
Patching consoles, cleaner to behold,
Let's celebrate, in code so bold!
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:
Project coverage is 92.35%. Comparing base (
1eabd14
) to head (aef417d
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@coderabbitai review
If the host is not healthy, the patched
console.*
will fall back to the original behavior.Summary by CodeRabbit
New Features
Refactor
patchConsole
function.Bug Fixes
notify
methods asynchronous inHost
,Neovim
, andVim
classes, improving behavior and consistency.Tests