Skip to content

Conversation

@NobbZ
Copy link
Owner

@NobbZ NobbZ commented Apr 4, 2025

Summary by CodeRabbit

  • New Features
    • Extended the plugin ecosystem by adding support for two new Git release plugins: nvim-nvim-ufo and nvim-promis-async.
    • Introduced configurable settings for optional plugins, allowing nvim-ufo as optional and marking promis-async as non-optional.
    • Enhanced text folding functionality with advanced LSP integration and new key mappings for more intuitive content expansion and collapse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

📝 Walkthrough

Walkthrough

The pull request updates multiple configuration and Lua module files to integrate two new plugins. It adds entries in the JSON sources and Nix configurations for the plugins nvim-nvim-ufo and nvim-promis-async. Additionally, changes in Lua scripts update LSP capabilities for folding functionality and initialize a new module that configures the nvim-ufo plugin with custom folding options and key mappings.

Changes

File(s) Summary
npins/sources.json & plugins/default.nix Added new plugin entries: In JSON, two new GitRelease entries are added for nvim-nvim-ufo and nvim-promis-async; in the Nix file, nvim-ufo is enabled and promis-async is set to false.
plugins/nobbz/lua/nobbz/init.lua & .../ufo.lua Updated LSP capabilities to include foldingRange settings and added a new module (ufo.lua) for nvim-ufo integration, which configures folding options, lazy-loading behavior, and key mappings.

Sequence Diagram(s)

sequenceDiagram
    participant E as Editor
    participant L as Lazy Loader
    participant U as nvim-ufo Module
    participant K as Key Mappings

    E->>L: Trigger DeferredUIEnter event
    L->>U: Load nvim-ufo plugin
    U->>U: Setup folding options & provider_selector (lsp/indent)
    Note right of U: Configure key mappings (zR/zM)
    K->>U: User presses zR or zM
    U-->>E: Execute fold open/close operations
Loading

Poem

Hop along, my code-bound friend,
New plugins join—let changes blend!
JSON and scripts now dance in tune,
With folds and keys that make hearts swoon.
From a rabbit’s hop, cheers we send! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7412420 and 60a8655.

📒 Files selected for processing (4)
  • npins/sources.json (2 hunks)
  • plugins/default.nix (1 hunks)
  • plugins/nobbz/lua/nobbz/init.lua (2 hunks)
  • plugins/nobbz/lua/nobbz/ufo.lua (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • plugins/nobbz/lua/nobbz/ufo.lua
  • plugins/default.nix
  • npins/sources.json
🧰 Additional context used
🧠 Learnings (1)
plugins/nobbz/lua/nobbz/init.lua (1)
Learnt from: NobbZ
PR: NobbZ/nobbz-vim#19
File: plugins/nobbz/lua/nobbz/lsp/beancount.lua:3-6
Timestamp: 2025-04-04T19:28:01.524Z
Learning: In the nobbz-vim project, `LSP_CAPAS` is defined as a global variable in `plugins/nobbz/lua/nobbz/init.lua` and should be used for LSP capabilities across the codebase.
🔇 Additional comments (2)
plugins/nobbz/lua/nobbz/init.lua (2)

5-12: LSP capabilities properly updated for folding support.

The modification to LSP_CAPAS correctly adds folding range capabilities to the LSP configuration. This aligns with the codebase convention of using LSP_CAPAS as a global variable for LSP capabilities.


55-55: UFO module initialization correctly added.

The new module initialization for ufo follows the established pattern in this file and is properly documented with a clear comment.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5089c2 and 7412420.

📒 Files selected for processing (4)
  • npins/sources.json (2 hunks)
  • plugins/default.nix (1 hunks)
  • plugins/nobbz/lua/nobbz/init.lua (2 hunks)
  • plugins/nobbz/lua/nobbz/ufo.lua (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
plugins/nobbz/lua/nobbz/init.lua (1)
Learnt from: NobbZ
PR: NobbZ/nobbz-vim#19
File: plugins/nobbz/lua/nobbz/lsp/beancount.lua:3-6
Timestamp: 2025-04-04T19:28:01.524Z
Learning: In the nobbz-vim project, `LSP_CAPAS` is defined as a global variable in `plugins/nobbz/lua/nobbz/init.lua` and should be used for LSP capabilities across the codebase.
🔇 Additional comments (7)
plugins/nobbz/lua/nobbz/ufo.lua (2)

1-4: LGTM for folding configuration.

The Vim options for folding look appropriate. The foldlevelstart and foldlevel at 99 ensure folds are open by default, while foldenable properly enables the folding feature.


6-26: Key bindings are duplicated but this is intentional.

The plugin is correctly registered with lazy loading on DeferredUIEnter event. You've defined keymaps for opening/closing all folds in two places:

  1. In the after function (with function handlers)
  2. In the keys section (with descriptions only)

This is likely intentional - the keys section registers them for which-key documentation, while the actual implementation happens after the plugin loads. The provider configuration looks good, prioritizing LSP-based folding with indent as fallback.

plugins/default.nix (2)

19-19: LGTM for nvim-ufo plugin configuration.

The plugin is correctly marked as optional with true value, consistent with the pattern used for other plugins.


22-22: LGTM for promis-async dependency configuration.

Setting promis-async = false marks it as non-optional, which makes sense as it's likely a required dependency for the UFO plugin.

plugins/nobbz/lua/nobbz/init.lua (2)

5-12: LGTM for LSP capabilities configuration.

The LSP capabilities have been correctly updated to include folding support with both dynamic registration and line-folding-only options enabled. This aligns with the retrieved learning about using LSP_CAPAS for capabilities across the codebase.


55-55: LGTM for ufo module initialization.

The UFO module is properly initialized using the rs() helper function, following the same pattern as other modules.

npins/sources.json (1)

379-394: LGTM for promise-async dependency configuration.

The JSON configuration for the promise-async dependency is correctly structured, following the same pattern as other GitRelease entries in this file.

Comment on lines 337 to 352
"nvim-nvim-ufp": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "kevinhwang91",
"repo": "nvim-ufo"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v1.4.0",
"revision": "a5390706f510d39951dd581f6d2a972741b3fa26",
"url": "https://api.github.com/repos/kevinhwang91/nvim-ufo/tarball/v1.4.0",
"hash": "0fyc504ay04402gk1vly0lz8fa5yyfmix16zsvl29grw6rpjacvp"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Possible typo in plugin name.

The plugin name nvim-nvim-ufp appears to have a typo - the repository is named nvim-ufo but the key contains ufp. Other entries in this file typically use the pattern nvim- followed by the repository name.


🏁 Script executed:

#!/bin/bash
# Check if this is a typo or intentional
grep -r "nvim-ufp\|nvim-ufo" --include="*.nix" --include="*.json" .

Length of output: 309


Action Required: Correct the Plugin Key Consistency

The plugin entry in npins/sources.json uses the key "nvim-nvim-ufp", but based on the repository field ("repo": "nvim-ufo") and the usage in ./plugins/default.nix where it’s referenced as nvim-ufo, the key appears to have a typo. It seems the intended name should follow the pattern nvim- followed by the repository name, resulting in "nvim-ufo".

  • File: npins/sources.json (Lines 337-352)
  • Issue: The key "nvim-nvim-ufp" should be changed to "nvim-ufo" to match both the repository name and the naming convention used elsewhere.
  • Reference: In ./plugins/default.nix, the plugin is correctly referenced as nvim-ufo = true;.

Please update the key accordingly to ensure consistency across the codebase.

@NobbZ NobbZ merged commit 5f11460 into main Apr 4, 2025
1 check passed
@NobbZ NobbZ deleted the ufo branch April 4, 2025 23:03
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.

2 participants