Skip to content

Commit

Permalink
helix: fix health
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 26, 2022
1 parent edfb6a3 commit c013f7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/actions/tools/helix/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ func ActionLanguages() carapace.Action {
}
return carapace.ActionExecCommand(cmd, "--health")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
r := regexp.MustCompile(`^\x1b\[39m(?P<language>[^ ]+) +\x1b\[[\d;]+m\x1b\[[\d;]+m(?P<lsp>(✘ | )?[^ ]+)`)
r := regexp.MustCompile(`^(?P<language>[^ ]+) +(?P<lsp>(✘ | )?[^ ]+)`)

vals := make([]string, 0)
for _, line := range lines {
for _, line := range lines[8:] {
if match := r.FindStringSubmatch(line); match != nil {
if lsp := match[2]; strings.HasPrefix(lsp, "✘") {
vals = append(vals, match[1], lsp, style.Red)
} else if strings.HasPrefix(lsp, "") {
} else if strings.HasPrefix(lsp, "") {
vals = append(vals, match[1], lsp, style.Green)
} else {
vals = append(vals, match[1], lsp, style.Yellow)
Expand Down

0 comments on commit c013f7a

Please sign in to comment.