mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
fix(tui): panic on completions failure
This commit is contained in:
parent
c389e0ed43
commit
1dffabcfda
1 changed files with 7 additions and 1 deletions
|
@ -61,7 +61,9 @@ func (cg *filesAndFoldersContextGroup) getGitFiles() []dialog.CompletionItemI {
|
||||||
return items
|
return items
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cg *filesAndFoldersContextGroup) GetChildEntries(query string) ([]dialog.CompletionItemI, error) {
|
func (cg *filesAndFoldersContextGroup) GetChildEntries(
|
||||||
|
query string,
|
||||||
|
) ([]dialog.CompletionItemI, error) {
|
||||||
items := make([]dialog.CompletionItemI, 0)
|
items := make([]dialog.CompletionItemI, 0)
|
||||||
|
|
||||||
query = strings.TrimSpace(query)
|
query = strings.TrimSpace(query)
|
||||||
|
@ -75,6 +77,10 @@ func (cg *filesAndFoldersContextGroup) GetChildEntries(query string) ([]dialog.C
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("Failed to get completion items", "error", err)
|
slog.Error("Failed to get completion items", "error", err)
|
||||||
|
return items, err
|
||||||
|
}
|
||||||
|
if files == nil {
|
||||||
|
return items, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range *files {
|
for _, file := range *files {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue