diff options
| author | adamdottv <[email protected]> | 2025-05-29 09:42:56 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-29 14:04:48 -0500 |
| commit | 6759674c0f3205155a0737b929a3fd0346a752c4 (patch) | |
| tree | 7f90fcf3283985022536a966b09a18547873464c /internal/tui/components/core | |
| parent | a9799136fe68c6ebac8b60ad963521ba159d9ae9 (diff) | |
| download | opencode-6759674c0f3205155a0737b929a3fd0346a752c4.tar.gz opencode-6759674c0f3205155a0737b929a3fd0346a752c4.zip | |
wip: refactoring tui
Diffstat (limited to 'internal/tui/components/core')
| -rw-r--r-- | internal/tui/components/core/status.go | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go index 681703c36..74e254eb9 100644 --- a/internal/tui/components/core/status.go +++ b/internal/tui/components/core/status.go @@ -9,7 +9,6 @@ import ( "github.com/charmbracelet/lipgloss" "github.com/sst/opencode/internal/config" "github.com/sst/opencode/internal/llm/models" - "github.com/sst/opencode/internal/lsp" "github.com/sst/opencode/internal/lsp/protocol" "github.com/sst/opencode/internal/pubsub" "github.com/sst/opencode/internal/status" @@ -155,8 +154,8 @@ func (m statusCmp) View() string { // Initialize the help widget status := getHelpWidget("") - if m.app.CurrentSession.ID != "" { - tokens := formatTokensAndCost(m.app.CurrentSession.PromptTokens+m.app.CurrentSession.CompletionTokens, model.ContextWindow, m.app.CurrentSession.Cost) + if m.app.CurrentSessionOLD.ID != "" { + tokens := formatTokensAndCost(m.app.CurrentSessionOLD.PromptTokens+m.app.CurrentSessionOLD.CompletionTokens, model.ContextWindow, m.app.CurrentSessionOLD.Cost) tokensStyle := styles.Padded(). Background(t.Text()). Foreground(t.BackgroundSecondary()). @@ -245,12 +244,12 @@ func (m *statusCmp) projectDiagnostics() string { // Check if any LSP server is still initializing initializing := false - for _, client := range m.app.LSPClients { - if client.GetServerState() == lsp.StateStarting { - initializing = true - break - } - } + // for _, client := range m.app.LSPClients { + // if client.GetServerState() == lsp.StateStarting { + // initializing = true + // break + // } + // } // If any server is initializing, show that status if initializing { @@ -263,22 +262,22 @@ func (m *statusCmp) projectDiagnostics() string { warnDiagnostics := []protocol.Diagnostic{} hintDiagnostics := []protocol.Diagnostic{} infoDiagnostics := []protocol.Diagnostic{} - for _, client := range m.app.LSPClients { - for _, d := range client.GetDiagnostics() { - for _, diag := range d { - switch diag.Severity { - case protocol.SeverityError: - errorDiagnostics = append(errorDiagnostics, diag) - case protocol.SeverityWarning: - warnDiagnostics = append(warnDiagnostics, diag) - case protocol.SeverityHint: - hintDiagnostics = append(hintDiagnostics, diag) - case protocol.SeverityInformation: - infoDiagnostics = append(infoDiagnostics, diag) - } - } - } - } + // for _, client := range m.app.LSPClients { + // for _, d := range client.GetDiagnostics() { + // for _, diag := range d { + // switch diag.Severity { + // case protocol.SeverityError: + // errorDiagnostics = append(errorDiagnostics, diag) + // case protocol.SeverityWarning: + // warnDiagnostics = append(warnDiagnostics, diag) + // case protocol.SeverityHint: + // hintDiagnostics = append(hintDiagnostics, diag) + // case protocol.SeverityInformation: + // infoDiagnostics = append(infoDiagnostics, diag) + // } + // } + // } + // } if len(errorDiagnostics) == 0 && len(warnDiagnostics) == 0 && |
