Skip to content

Commit ffd68e2

Browse files
committed
change mcp count highlight based on mcp status
1 parent 7db609d commit ffd68e2

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

lua/eca/sidebar.lua

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,12 +1086,26 @@ function M:_update_config_display()
10861086

10871087
local model = self.mediator:selected_model() or "unknown"
10881088
local behavior = self.mediator:selected_behavior() or "unknown"
1089-
local mcps = vim.tbl_count(self.mediator:mcps())
1089+
local mcps = self.mediator:mcps()
1090+
1091+
local mcps_hl = "Normal"
1092+
1093+
for _, mcp in pairs(mcps) do
1094+
if mcp.status == "starting" then
1095+
mcps_hl = "Comment"
1096+
break
1097+
end
1098+
1099+
if mcp.status == "failed" then
1100+
mcps_hl = "Exception"
1101+
break
1102+
end
1103+
end
10901104

10911105
local texts = {
10921106
{ "model:", "Comment" }, { model, "Normal" }, { "\t" },
10931107
{ "behavior:", "Comment" }, { behavior, "Normal" }, { " " },
1094-
{ "mcps:", "Comment" }, { tostring(mcps), "Exception" },
1108+
{ "mcps:", "Comment" }, { tostring(vim.tbl_count(mcps)), mcps_hl },
10951109
}
10961110

10971111
local virt_opts = { virt_text = texts, hl_mode = "combine" }
@@ -1188,7 +1202,7 @@ function M:_update_usage_info()
11881202
-1,
11891203
vim.tbl_extend("force",
11901204
{
1191-
virt_text = { { self._current_status, (status_text ~= "Idle") and "Question" or "Normal" } },
1205+
virt_text = { { self._current_status, (status_text ~= "Idle") and "Debug" or "Normal" } },
11921206
virt_text_pos = 'eol',
11931207
hl_mode = 'combine',
11941208
},

0 commit comments

Comments
 (0)