suggestion.go 795 B

123456789101112131415161718192021222324
  1. package completions
  2. import "github.com/sst/opencode/internal/styles"
  3. // CompletionSuggestion represents a data-only completion suggestion
  4. // with no styling or rendering logic
  5. type CompletionSuggestion struct {
  6. // The text to be displayed in the list. May contain minimal inline
  7. // ANSI styling if intrinsic to the data (e.g., git diff colors).
  8. Display func(styles.Style) string
  9. // The value to be used when the item is selected (e.g., inserted into the editor).
  10. Value string
  11. // An optional, longer description to be displayed.
  12. Description string
  13. // The ID of the provider that generated this suggestion.
  14. ProviderID string
  15. // The raw, underlying data object (e.g., opencode.Symbol, commands.Command).
  16. // This allows the selection handler to perform rich actions.
  17. RawData any
  18. }