Documentation
¶
Index ¶
- func SetLogger(log *slog.Logger)
- type CompletionPopup
- type DefaultCompletion
- func (dc *DefaultCompletion) AddCompletor(completor gvcode.Completor, popup gvcode.CompletionPopup) error
- func (dc *DefaultCompletion) Cancel()
- func (dc *DefaultCompletion) IsActive() bool
- func (dc *DefaultCompletion) Layout(gtx layout.Context) layout.Dimensions
- func (dc *DefaultCompletion) Offset() image.Point
- func (dc *DefaultCompletion) OnConfirm(idx int)
- func (dc *DefaultCompletion) OnText(ctx gvcode.CompletionContext)
- func (dc *DefaultCompletion) SetDelay(delay time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompletionPopup ¶
type CompletionPopup struct {
// Size configures the max popup dimensions. If no value
// is provided, a reasonable value is set.
Size image.Point
// TextSize configures the size the text displayed in the popup. If no value
// is provided, a reasonable value is set.
TextSize unit.Sp
Theme *material.Theme
// contains filtered or unexported fields
}
CompletionPopup is the builtin implementation of a completion popup.
func NewCompletionPopup ¶
func NewCompletionPopup(editor *gvcode.Editor, cmp gvcode.Completion) *CompletionPopup
func (*CompletionPopup) Layout ¶
func (pop *CompletionPopup) Layout(gtx layout.Context, items []gvcode.CompletionCandidate) layout.Dimensions
type DefaultCompletion ¶
func (*DefaultCompletion) AddCompletor ¶ added in v0.2.2
func (dc *DefaultCompletion) AddCompletor(completor gvcode.Completor, popup gvcode.CompletionPopup) error
func (*DefaultCompletion) Cancel ¶
func (dc *DefaultCompletion) Cancel()
func (*DefaultCompletion) IsActive ¶
func (dc *DefaultCompletion) IsActive() bool
func (*DefaultCompletion) Layout ¶
func (dc *DefaultCompletion) Layout(gtx layout.Context) layout.Dimensions
func (*DefaultCompletion) Offset ¶
func (dc *DefaultCompletion) Offset() image.Point
func (*DefaultCompletion) OnConfirm ¶
func (dc *DefaultCompletion) OnConfirm(idx int)
func (*DefaultCompletion) OnText ¶
func (dc *DefaultCompletion) OnText(ctx gvcode.CompletionContext)
func (*DefaultCompletion) SetDelay ¶ added in v0.2.2
func (dc *DefaultCompletion) SetDelay(delay time.Duration)
SetDelay set a delay duration of run completion after the user stopped typing. This makes the UI more responsive when the user types fast as it reduces the unnecessary completion computation.
Click to show internal directories.
Click to hide internal directories.