Skip to content

Commit 7f3e0a5

Browse files
committed
perf(provider): disable integrations that are unavailable
1 parent bfccd45 commit 7f3e0a5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.neoconf.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
"neodev": {
33
"library": {
44
"enabled": true,
5-
"plugins": ["heirline.nvim"]
5+
"plugins": [
6+
"astrocore",
7+
"astrolsp",
8+
"conform.nvim",
9+
"heirline.nvim",
10+
"none-ls.nvim",
11+
"nvim-lint",
12+
"nvim-web-devicons"
13+
]
614
}
715
},
816
"neoconf": {

lua/astroui/status/provider.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local M = {}
1111

1212
local astro = require "astrocore"
1313
local extend_tbl = astro.extend_tbl
14+
local is_available = astro.is_available
1415
local luv = vim.uv or vim.loop -- TODO: REMOVE WHEN DROPPING SUPPORT FOR Neovim v0.9
1516

1617
local ui = require "astroui"
@@ -483,7 +484,14 @@ end
483484
-- @usage local heirline_component = { provider = require("astroui.status").provider.lsp_client_names({ integrations = { null_ls = true, conform = true, lint = true }, truncate = 0.25 }) }
484485
-- @see astroui.status.utils.stylize
485486
function M.lsp_client_names(opts)
486-
opts = extend_tbl({ integrations = { null_ls = true, conform = true, lint = true }, truncate = 0.25 }, opts)
487+
opts = extend_tbl({
488+
integrations = {
489+
null_ls = is_available "none-ls.nvim",
490+
conform = is_available "conform.nvim",
491+
lint = is_available "nvim-lint",
492+
},
493+
truncate = 0.25,
494+
}, opts)
487495
return function(self)
488496
local bufnr = self and self.bufnr or 0
489497
local buf_client_names = {}

0 commit comments

Comments
 (0)