Source File
raw_item.go
Belonging Package
src.elv.sh/pkg/edit/complete
package completeimport ()// PlainItem is a simple implementation of RawItem.type PlainItem stringfunc ( PlainItem) () string { return string() }func ( PlainItem) ( parse.PrimaryType) mode.CompletionItem {:= string(), := parse.QuoteAs(, )return mode.CompletionItem{ToInsert: , ToShow: }}// noQuoteItem is a RawItem implementation that does not quote when cooked. This// type is not exposed, since argument generators never need this.type noQuoteItem stringfunc ( noQuoteItem) () string { return string() }func ( noQuoteItem) (parse.PrimaryType) mode.CompletionItem {:= string()return mode.CompletionItem{ToInsert: , ToShow: }}// ComplexItem is an implementation of RawItem that offers customization options.type ComplexItem struct {Stem string // Used in the code and the menu.CodeSuffix string // Appended to the code.Display string // How the item is displayed. If empty, defaults to Stem.DisplayStyle ui.Style // Use for displaying.}func ( ComplexItem) () string { return .Stem }func ( ComplexItem) ( parse.PrimaryType) mode.CompletionItem {, := parse.QuoteAs(.Stem, ):= .Displayif == "" {= .Stem}return mode.CompletionItem{ToInsert: + .CodeSuffix,ToShow: ,ShowStyle: .DisplayStyle,}}
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)