lsp improvements
This commit is contained in:
@@ -2,6 +2,7 @@ package chat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/charmbracelet/x/ansi"
|
||||
@@ -28,8 +29,16 @@ func lspsConfigured(width int) string {
|
||||
|
||||
lsps := styles.BaseStyle.Width(width).Foreground(styles.PrimaryColor).Bold(true).Render(title)
|
||||
|
||||
// Get LSP names and sort them for consistent ordering
|
||||
var lspNames []string
|
||||
for name := range cfg.LSP {
|
||||
lspNames = append(lspNames, name)
|
||||
}
|
||||
sort.Strings(lspNames)
|
||||
|
||||
var lspViews []string
|
||||
for name, lsp := range cfg.LSP {
|
||||
for _, name := range lspNames {
|
||||
lsp := cfg.LSP[name]
|
||||
lspName := styles.BaseStyle.Foreground(styles.Forground).Render(
|
||||
fmt.Sprintf("• %s", name),
|
||||
)
|
||||
@@ -49,7 +58,6 @@ func lspsConfigured(width int) string {
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
}
|
||||
return styles.BaseStyle.
|
||||
Width(width).
|
||||
|
||||
@@ -376,14 +376,7 @@ func (m *messagesCmp) working() string {
|
||||
if hasToolsWithoutResponse(m.messages) {
|
||||
task = "Waiting for tool response..."
|
||||
} else if !lastMessage.IsFinished() {
|
||||
lastUpdate := lastMessage.UpdatedAt
|
||||
currentTime := time.Now().Unix()
|
||||
if lastMessage.Content().String() != "" && lastUpdate != 0 && currentTime-lastUpdate > 5 {
|
||||
task = "Building tool call..."
|
||||
} else if lastMessage.Content().String() == "" {
|
||||
task = "Generating..."
|
||||
}
|
||||
task = ""
|
||||
task = "Generating..."
|
||||
}
|
||||
if task != "" {
|
||||
text += styles.BaseStyle.Width(m.width).Foreground(styles.PrimaryColor).Bold(true).Render(
|
||||
|
||||
@@ -151,7 +151,11 @@ func renderAssistantMessage(
|
||||
))
|
||||
}
|
||||
}
|
||||
if content != "" {
|
||||
if content != "" || (finished && finishData.Reason == message.FinishReasonEndTurn) {
|
||||
if content == "" {
|
||||
content = "*Finished without output*"
|
||||
}
|
||||
|
||||
content = renderMessage(content, false, msg.ID == focusedUIMessageId, width, info...)
|
||||
messages = append(messages, uiMessage{
|
||||
ID: msg.ID,
|
||||
|
||||
Reference in New Issue
Block a user