Skip to content

Conversation

@NobbZ
Copy link
Owner

@NobbZ NobbZ commented Jun 21, 2025

Summary by CodeRabbit

  • Refactor
    • Updated LSP server configuration and setup to use Neovim's built-in LSP API instead of the external lspconfig plugin. This change is internal and does not affect user-facing behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 21, 2025

Walkthrough

The changes update the way LSP server configurations are accessed and set up by switching from the external lspconfig module to Neovim's native vim.lsp.config and vim.lsp.enable APIs. This affects both the LSP health check and LSP registration logic, without altering any public function signatures.

Changes

File(s) Change Summary
plugins/nobbz/lua/nobbz/health.lua Changed LSP server config access from require("lspconfig")[lsp] to vim.lsp.config[lsp].
plugins/nobbz/lua/nobbz/lsp.lua Replaced lspconfig usage with native vim.lsp.config and vim.lsp.enable for LSP setup/enable.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LSPModule
    participant NeovimLSP

    User->>LSPModule: register_lsp(name, setup)
    LSPModule->>NeovimLSP: config(name, setup)
    LSPModule->>NeovimLSP: enable(name)
Loading

Possibly related PRs

  • healthchecks #55: Adds a health check module and a register_lsp function to track LSP binaries; directly related as this PR modifies the same function and logic.

Poem

A hop, a skip, a little tweak,
LSPs now natively speak!
No more configs from afar,
Vim’s own magic sets the bar.
Health and setup, hand in paw—
The code is nimble, without flaw!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aced58f and c64ea75.

📒 Files selected for processing (2)
  • plugins/nobbz/lua/nobbz/health.lua (1 hunks)
  • plugins/nobbz/lua/nobbz/lsp.lua (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`plugins/**/*.lua`: Please ensure all of the following: - Plugins are lazyloaded if possible through `nobbz.lazy` - `local` has to be used - coding follows the [luarocks styleguide...

plugins/**/*.lua: Please ensure all of the following:

  • Plugins are lazyloaded if possible through nobbz.lazy
  • local has to be used
  • coding follows the luarocks styleguide, but with 2 spaces indentation
  • plugins/nobbz/lua/nobbz/lsp.lua
  • plugins/nobbz/lua/nobbz/health.lua
🔇 Additional comments (2)
plugins/nobbz/lua/nobbz/lsp.lua (1)

74-75: [web_search]

Which Neovim version introduced vim.lsp.config and vim.lsp.enable?
plugins/nobbz/lua/nobbz/health.lua (1)

74-74: LGTM - Consistent with LSP API migration.

The change from require("lspconfig")[lsp] to vim.lsp.config[lsp] is consistent with the broader migration from external lspconfig to native Neovim LSP API. The health check logic remains intact and should continue to function correctly.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

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.

@NobbZ NobbZ requested a review from Copilot June 21, 2025 20:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors LSP setup to use Neovim’s built-in LSP API instead of the external lspconfig plugin.

  • Removed require("lspconfig") and replaced its setup call with vim.lsp.config and vim.lsp.enable.
  • Updated health checks to read server configs from vim.lsp.config rather than from lspconfig.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
plugins/nobbz/lua/nobbz/lsp.lua Switched LSP initialization calls from lspconfig to built-in API
plugins/nobbz/lua/nobbz/health.lua Updated health module to fetch server config from built-in API
Comments suppressed due to low confidence (1)

plugins/nobbz/lua/nobbz/health.lua:74

  • Accessing vim.lsp.config[lsp] relies on an internal table that may not be populated; consider using a documented getter (e.g., vim.lsp.get_config) or maintain your own registry for server configs.
  local config = vim.lsp.config[lsp]

Comment on lines +74 to +75
vim.lsp.config(name, setup)
vim.lsp.enable(name)
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

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

There is no vim.lsp.config(name, setup) function in the built-in API; you likely need to call vim.lsp.start_client(setup) or use the documented vim.lsp.start(config) method instead.

Suggested change
vim.lsp.config(name, setup)
vim.lsp.enable(name)
vim.lsp.start(setup)

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

According to https://neovim.io/doc/user/lsp.html#lsp-quickstart, vim.lsp.config and vim.lsp.enable do exist.

Comment on lines +74 to 76
vim.lsp.config(name, setup)
vim.lsp.enable(name)

Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

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

vim.lsp.enable is not a standard Neovim LSP API call; if you’re trying to attach or start the server, use vim.lsp.start_client or the appropriate attach function.

Suggested change
vim.lsp.config(name, setup)
vim.lsp.enable(name)
vim.lsp.start_client(setup)

Copilot uses AI. Check for mistakes.
@NobbZ NobbZ merged commit bc152ad into main Jun 21, 2025
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 22, 2025
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