Lualine component for NES status with loading state #66
sahaj-b
started this conversation in
Show and tell
Replies: 1 comment
-
|
I don't have a better solution, but thanks to your example, I have also added the process status to my variant: {
function()
local copilot_is_enabled = not require('copilot.client').is_disabled()
local sidekick_status = require('sidekick.status').get()
local sidekick_has_nes = require('sidekick.nes').have()
local sidekick_process_nes = next(require('sidekick.nes')._requests)
local icon = not copilot_is_enabled and icons.copilot.disabled
or sidekick_status.kind == 'Warning' and icons.copilot.warning
or icons.copilot.enabled
local icon_nes = sidekick_process_nes and icons.copilot.nes.process
or sidekick_has_nes and icons.copilot.nes.has
or ''
return icon .. icon_nes
end,
color = function()
local sidekick_status = require('sidekick.status').get()
if sidekick_status then
return sidekick_status.kind == 'Error' and 'DiagnosticError'
or sidekick_status.busy and 'DiagnosticWarn'
or sidekick_status.kind == 'Normal' and 'Special'
or nil
end
end,
cond = function()
local sidekick_has_status = require('sidekick.status').get() ~= nil
local copilot_is_enabled = not require('copilot.client').is_disabled()
return sidekick_has_status or copilot_is_enabled
end,
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Made Next Edit Suggestion status lualine component with all 3 states: NES available, not available and loading(API call), just like the Copilot LSP component
If someone knows a better way to check the loading state, let me know.
Beta Was this translation helpful? Give feedback.
All reactions