Skip to content
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

Fix load #304

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Fix load #304

merged 2 commits into from
Jan 2, 2024

Conversation

lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented Jan 2, 2024

Summary by CodeRabbit

  • New Features

    • Improved the initialization process of plugins with an automatic discovery mechanism upon Denops readiness.
  • Refactor

    • Enhanced job control in Neovim by refining the stop function with better job handling.

Copy link

coderabbitai bot commented Jan 2, 2024

Walkthrough

The updates to the Vim plugin involve streamlining the initialization process and improving job handling. For Neovim users, the job stopping mechanism now waits for the job to terminate, ensuring resources are cleaned up properly. The initialization sequence has been simplified by removing asynchronous waiting functions and directly triggering plugin discovery when the DenopsReady event occurs.

Changes

File Path Change Summary
autoload/denops/.../job.vim Added jobwait for Neovim in s:stop function.
plugin/denops.vim Removed wait_async calls; added DenopsReady autocmd for plugin discovery.

🐇✨
To the code, we hop and tweak,
Ensuring the plugin's future isn't bleak.
With jobwait now in its rightful place,
DenopsReady springs with newfound grace. 🌟🔌

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?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5071427) 96.47% compared to head (90773c0) 96.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #304   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files           3        3           
  Lines          85       85           
  Branches        6        6           
=======================================
  Hits           82       82           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5071427 and 90773c0.
Files selected for processing (2)
  • autoload/denops/_internal/job.vim (1 hunks)
  • plugin/denops.vim (1 hunks)
Additional comments: 4
plugin/denops.vim (2)
  • 25-25: The addition of autocmd User DenopsReady call denops#plugin#discover() to the augroup denops_plugin_internal is a good enhancement for initializing the plugin when Denops is ready.

  • 22-24: The removal of denops#server#wait_async calls is not shown in the hunk but is mentioned in the summary. Ensure that this change does not negatively impact other parts of the plugin's initialization logic.

Verification successful

The search results indicate that the function denops#server#wait_async is still defined in autoload/denops/server.vim. However, there are no results showing usage of this function elsewhere in the codebase, which suggests that the removal of calls to this function in plugin/denops.vim has been completed as intended.

Given this information, it seems that the removal of denops#server#wait_async calls from plugin/denops.vim does not negatively impact other parts of the plugin's initialization logic, as there are no remaining references to it that would require updating or removal.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any remaining references to denops#server#wait_async which might need to be updated or removed.
rg --type vim 'denops#server#wait_async'

Length of output: 118

autoload/denops/_internal/job.vim (2)
  • 33-33: The addition of jobwait([a:job]) in the s:stop function is a good practice to ensure that jobs are properly awaited and terminated in Neovim.

  • 34-36: The error handling for E900: Invalid job id in the catch block is appropriate and ensures that the function fails silently if the job has already been closed.

@lambdalisue lambdalisue merged commit 0e67ae7 into main Jan 2, 2024
16 checks passed
@lambdalisue lambdalisue deleted the fix-load branch January 2, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant