completion

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger added in v0.2.2

func SetLogger(log *slog.Logger)

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

type DefaultCompletion

type DefaultCompletion struct {
	Editor *gvcode.Editor
	// contains filtered or unexported fields
}

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 (*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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL