Skip to content

Conversation

@NobbZ
Copy link
Owner

@NobbZ NobbZ commented Apr 4, 2025

Summary by CodeRabbit

  • New Features

    • Introduced support for tarball sources and refined Git repository handling with optional submodule control.
    • Added an optional plugin that enhances language server interactions by offering advanced code navigation features.
    • Integrated lspsaga plugin with new key mappings for improved functionality.
  • Bug Fixes

    • Removed unnecessary diagnostic navigation keybindings for a cleaner experience.
  • Refactor

    • Streamlined configuration settings with updated version checks.
    • Reorganized module loading for improved clarity and efficiency.
    • Simplified plugin path assignment in Lua language server configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

📝 Walkthrough

Walkthrough

This pull request updates the source management system and plugin configuration in the Nix environment. It revises function signatures in npins/default.nix (adding new parameters and a tarball source) and updates npins/sources.json with a new submodule property and version number. Minor formatting changes and reordering in plugin files are also included. New functionality for the lspsaga plugin is introduced via a dedicated configuration file, and some legacy diagnostic navigation features are removed.

Changes

File(s) Change Summary
npins/default.nix Updated function signatures (mkSource now takes a name parameter and mkGitSource now accepts submodules), added support for "Tarball" source, introduced mkTarballSource, and included new utility functions.
npins/sources.json Added "submodules": false to repository entries and updated the version from 3 to 5.
plugins/default.nix Removed an extra space in the overrideCheck function and added the new optional plugin lspsaga = true.
plugins/nobbz/lua/nobbz/init.lua Reordered module loading (moved rs("blink")) and added a new module requirement rs("lspsaga").
plugins/nobbz/lua/nobbz/lsp/helpers.lua Updated refresh_codelens to include a buffer parameter, removed diagnostic navigation key mappings, and added an alias for Handler.
plugins/nobbz/lua/nobbz/lspsaga.lua Introduced a new file to configure lspsaga (initialized on DeferredUIEnter) with specified options and key mappings.
plugins/nobbz/lua/nobbz/lsp/lua.lua Simplified the definition of plugin_paths by removing unnecessary vim.print calls.
plugins/nobbz/lua/nobbz/startuptime.lua Simplified the assignment of nvim_path by removing unnecessary printing of the environment variable.

Sequence Diagram(s)

sequenceDiagram
    participant U as User Request
    participant F as mkGitSource Function
    participant R as Repository Resolver
    participant G as Git Fetcher

    U->>F: Call mkGitSource({repository, revision, url, submodules, hash, branch})
    F->>F: Check if url is provided and submodules flag is set
    alt Tarball fetch
        F->>R: Resolve tarball URL
    else Git fetch
        F->>R: Determine repository URL (GitHub, GitLab, etc.)
        F->>G: Fetch repository with submodules if requested
    end
    G--)F: Return fetched repository
    F--)U: Return source specification
Loading
sequenceDiagram
    participant E as DeferredUIEnter Event
    participant L as lspsaga Setup
    participant P as Plugin Manager

    E->>L: Trigger lspsaga initialization
    L->>P: Register lspsaga key mappings and configurations
    P--)L: Confirm registration
    L--)E: lspsaga setup complete
Loading

Possibly related PRs

  • augment #34: Enhances submodule handling in Git sources, aligning with the new submodules parameter.
  • update 2024 12 25 #12: Updates to sources.json (submodules property and version update) mirror the changes made here.
  • update 2024 12 10 #11: Modifications in submodule configuration and versioning in sources.json align closely with the current PR.

Poem

I hop through lines of code with cheer,
Tweaking functions so crisp and clear.
Tarballs and Git merge in a lively dance,
lspsaga joins in, seizing its chance.
A rabbit’s delight in each change so dear! 🐇
Hop on, code—there’s magic all around!


📜 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 6e855de and ba7ea7b.

📒 Files selected for processing (1)
  • plugins/nobbz/lua/nobbz/lsp/lua.lua (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/nobbz/lua/nobbz/lsp/lua.lua

🪧 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: 0

🧹 Nitpick comments (4)
plugins/nobbz/lua/nobbz/lspsaga.lua (1)

5-5: Debug print statement left in code.

There is a vim.print debug statement in the code that should be removed before merging to production.

-    vim.print("loading lspsaga")
plugins/nobbz/lua/nobbz/lsp/helpers.lua (1)

45-45: Potential performance impact of frequent codelens refresh.
Triggering refresh_codelens on TextChanged, InsertLeave, CursorHold, and LspAttach could introduce overhead in large files or during rapid edits. Consider limiting refreshes to events like CursorHold and InsertLeave or adjusting the interval if performance issues arise.

npins/default.nix (2)

27-48: Override logic is straightforward, but consider trace verbosity.
Reading an environment variable to override fetched sources is convenient and mirrors patterns in Niv. Be mindful that extensive usage of builtins.trace may clutter logs in large builds. Switching to a less verbose diagnostics approach in production might be safer.


69-115: Support for submodules in mkGitSource is well-structured, but address the SRI TODO.
The flow for url != null && !submodules vs. fetchGit with submodules is coherent. However, the # FIXME: check nix version & use SRI hashes remains. If you'd like to adopt SRI, updating the hash usage to the sha256-<base32> format is recommended.

I can help finalize the SRI approach and verify any minimal Nix version requirements—would you like me to open a follow-up PR or provide the modifications here?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0f37c1d and 5a687a5.

📒 Files selected for processing (6)
  • npins/default.nix (1 hunks)
  • npins/sources.json (33 hunks)
  • plugins/default.nix (2 hunks)
  • plugins/nobbz/lua/nobbz/init.lua (1 hunks)
  • plugins/nobbz/lua/nobbz/lsp/helpers.lua (3 hunks)
  • plugins/nobbz/lua/nobbz/lspsaga.lua (1 hunks)
🔇 Additional comments (19)
npins/sources.json (3)

11-11: Consistent submodules property added.

The addition of "submodules": false to all repository entries standardizes the Git fetching behavior, explicitly specifying that submodules should not be included when fetching repositories. This change provides better clarity and control over dependency management.

Also applies to: 24-24, 37-37, 52-52, 66-66, 79-79, 92-92, 105-105, 118-118, 131-131, 144-144, 157-157, 183-183, 196-196, 209-209, 222-222, 235-235, 248-248, 261-261, 274-274, 289-289, 303-303, 316-316, 331-331, 345-345, 358-358, 371-371, 384-384, 397-397, 410-410, 423-423, 436-436, 449-449


162-174: New LSP Saga plugin added to sources.

The LSP Saga plugin has been added to the sources JSON. This plugin enhances LSP-related UI interactions with functionality like peeking at definitions, navigating diagnostics, and finding references.


455-455: Version number updated from 3 to 5.

The version number has been updated to 5, which likely indicates a significant change in the overall structure or schema of the sources file. This aligns with the standardized addition of the submodules property to all entries.

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

1-15: New LSP Saga plugin configuration.

The configuration loads the LSP Saga plugin on the "DeferredUIEnter" event, which is a good practice for deferring plugin loading until the UI is ready. The setup enables the symbol display in the window bar and configures the outline to close after jump, enhancing usability.


17-24: Comprehensive key mappings for LSP Saga.

A well-organized set of key mappings has been added for LSP Saga functionality. The mappings follow a logical pattern (<leader>lp for peek operations, <leader>l< and <leader>l> for navigating diagnostics), making them intuitive for users.

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

32-32: Added LSP Saga module loading.

The LSP Saga module is now loaded after the LSP module, which is the correct sequence since LSP Saga extends LSP functionality. This ensures that LSP is fully initialized before LSP Saga attempts to enhance it.


28-28:

Details

✅ Verification successful

Changed order of module loading.

The blink module (foundations for completions) now loads after augment. This reordering may impact the initialization sequence. Ensure that there are no dependencies between these modules that could be affected by this change.


🏁 Script executed:

#!/bin/bash
# Check for potential dependencies between augment and blink
grep -r "require.*augment" --include="*.lua" . | grep -v "init.lua"
grep -r "require.*blink" --include="*.lua" . | grep -v "init.lua"

Length of output: 294


Action: Module Loading Order Verified

The dependency check indicates no direct dependencies between the augment and blink modules. The blink module’s imports (e.g., require("blink.cmp")) do not rely on augment, so the reordering in plugins/nobbz/lua/nobbz/init.lua appears safe.

  • No require calls that link augment to blink were found outside of initialization files.
  • The usage of blink.cmp in both blink.lua and lsp.lua confirms that the dependency remains isolated.
plugins/default.nix (2)

9-9: Code formatting improvement.

The space has been removed before the closing brace in the overrideCheck function definition, making the code more compact without changing functionality.


18-18: LSP Saga added as an optional plugin.

LSP Saga has been added to the optionalPlugins set with a value of true, indicating it should be included. This aligns with the new LSP Saga configuration added in the other files.

plugins/nobbz/lua/nobbz/lsp/helpers.lua (2)

4-8: Confirm correctness of new parameter usage in refresh_codelens.
The added buffer parameter and the usage of client:supports_method("textDocument/codelens", buffer) appear functionally sound. However, this deviates from the typical Neovim LSP client API, which usually checks client.supports_method("textDocument/codelens") without a second parameter. Ensure that this custom approach is intentional and recognized by any upstream or downstream code.

Would you like me to generate a script to search the codebase for other references to supports_method to confirm consistency with this new signature?


54-54: Alias addition is clear and improves type clarity.
The newly introduced ---@alias Handler nobbz.lsp.helpers.Handler helps unify references and improves readability.

npins/default.nix (8)

1-9: MIT license header looks valid.
Including the full MIT license text at the start of the file is clear and follows best practices.


15-18: Range function implementation is correct.
Using builtins.genList (n: first + n) aligns with standard Nix patterns, and referencing the official link to Nixpkgs clarifies provenance.


19-26: String utilities align with Nixpkgs references.
The newly added stringToCharacters, stringAsChars, concatMapStrings, and concatStrings are standard building blocks for string manipulation. This modular approach improves maintainability.


49-68: mkSource function extension looks appropriate.
Handling new source types like "Tarball" expands usability. Failing fast via builtins.throw on unknown types is a good practice.


117-123: mkPyPiSource adheres to standard fetch usage.
Fetching PyPI packages via builtins.fetchurl using straightforward parameters is consistent with typical Nix derivation patterns.


124-130: mkChannelSource tarball fetching is standard.
Invoking builtins.fetchTarball for channels remains a reliable approach.


131-141: mkTarballSource supports locked URL usage.
Accepting locked_url gracefully decouples the user-specified URL from the verified, locked version, which is beneficial for reproducible builds.


143-147: Version check updated to 5.
Throwing an error on unsupported versions encourages users to update, aligning with the note in sources.json.

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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5a687a5 and 6e855de.

📒 Files selected for processing (3)
  • plugins/nobbz/lua/nobbz/lsp/lua.lua (1 hunks)
  • plugins/nobbz/lua/nobbz/lspsaga.lua (1 hunks)
  • plugins/nobbz/lua/nobbz/startuptime.lua (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • plugins/nobbz/lua/nobbz/startuptime.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/nobbz/lua/nobbz/lspsaga.lua

@NobbZ NobbZ merged commit c5089c2 into main Apr 4, 2025
1 check passed
@NobbZ NobbZ deleted the saga branch April 4, 2025 19:52
@NobbZ NobbZ restored the saga branch April 5, 2025 08:30
@coderabbitai coderabbitai bot mentioned this pull request Nov 16, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jan 5, 2026
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