Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/nobbz/lua/nobbz/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ null_ls.setup({
-- Load individual languages configuration
require("nobbz.lsp.astro")
require("nobbz.lsp.beancount")
require("nobbz.lsp.c-cpp")
require("nobbz.lsp.digestif")
require("nobbz.lsp.elixir")
require("nobbz.lsp.gleam")
require("nobbz.lsp.html")
require("nobbz.lsp.lua")
require("nobbz.lsp.mdx")
require("nobbz.lsp.meson")
require("nobbz.lsp.nil")
require("nobbz.lsp.nushell")
require("nobbz.lsp.oxide")
Expand Down
8 changes: 8 additions & 0 deletions plugins/nobbz/lua/nobbz/lsp/c-cpp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
local helpers = require("nobbz.lsp.helpers")

require("lspconfig").clangd.setup({
on_attach = helpers.keymap,
capabilities = LSP_CAPAS,
})
Comment on lines +3 to +6
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Leverage nobbz.lazy and local imports for plugin modules
To adhere to our lazy‑loading policy and ensure all plugin dependencies are declared as locals, replace the inline require("lspconfig") with a lazy import. For example:

-local helpers = require("nobbz.lsp.helpers")
-require("lspconfig").clangd.setup({
-  on_attach = helpers.keymap,
-  capabilities = LSP_CAPAS,
-})
+local helpers   = require("nobbz.lsp.helpers")
+local lspconfig = require("nobbz.lazy").lspconfig
+
+lspconfig.clangd.setup({
+  on_attach    = helpers.keymap,
+  capabilities = LSP_CAPAS,
+})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
require("lspconfig").clangd.setup({
on_attach = helpers.keymap,
capabilities = LSP_CAPAS,
})
local helpers = require("nobbz.lsp.helpers")
local lspconfig = require("nobbz.lazy").lspconfig
lspconfig.clangd.setup({
on_attach = helpers.keymap,
capabilities = LSP_CAPAS,
})


require("nobbz.health").register_lsp("clangd")
8 changes: 8 additions & 0 deletions plugins/nobbz/lua/nobbz/lsp/meson.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
local helpers = require("nobbz.lsp.helpers")

require("lspconfig").mesonlsp.setup({
on_attach = helpers.keymap,
capabilities = LSP_CAPAS,
})

require("nobbz.health").register_lsp("mesonlsp")