-
Notifications
You must be signed in to change notification settings - Fork 4
set up UFO #41
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
set up UFO #41
Conversation
📝 WalkthroughWalkthroughThe 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 Changes
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
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧠 Learnings (1)plugins/nobbz/lua/nobbz/init.lua (1)🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
foldlevelstartandfoldlevelat 99 ensure folds are open by default, whilefoldenableproperly enables the folding feature.
6-26: Key bindings are duplicated but this is intentional.The plugin is correctly registered with lazy loading on
DeferredUIEnterevent. You've defined keymaps for opening/closing all folds in two places:
- In the
afterfunction (with function handlers)- In the
keyssection (with descriptions only)This is likely intentional - the
keyssection 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
truevalue, consistent with the pattern used for other plugins.
22-22: LGTM for promis-async dependency configuration.Setting
promis-async = falsemarks 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_CAPASfor 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.
npins/sources.json
Outdated
| "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" | ||
| }, |
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.
💡 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 asnvim-ufo = true;.
Please update the key accordingly to ensure consistency across the codebase.
Summary by CodeRabbit
nvim-nvim-ufoandnvim-promis-async.nvim-ufoas optional and markingpromis-asyncas non-optional.