// literal generates composite literal, function literal, and make() // completion items. func (c *completer) literal(ctx context.Context, literalType types.Type, imp *importInfo) { … } const literalCandidateScore … // functionLiteral returns a function literal completion item for the // given signature, if applicable. func (c *completer) functionLiteral(ctx context.Context, sig *types.Signature, matchScore float64) (CompletionItem, bool) { … } var conventionalAcronyms … // abbreviateTypeName abbreviates type names into acronyms. For // example, "fooBar" is abbreviated "fb". Care is taken to ignore // non-identifier runes. For example, "[]int" becomes "i", and // "struct { i int }" becomes "s". func abbreviateTypeName(s string) string { … } // compositeLiteral returns a composite literal completion item for the given typeName. // T is an (unnamed, unaliased) struct, array, slice, or map type. func (c *completer) compositeLiteral(T types.Type, snip *snippet.Builder, typeName string, matchScore float64, edits []protocol.TextEdit) CompletionItem { … } // basicLiteral returns a literal completion item for the given basic // type name typeName. // // If T is untyped, this function returns false. func (c *completer) basicLiteral(T types.Type, snip *snippet.Builder, typeName string, matchScore float64, edits []protocol.TextEdit) (CompletionItem, bool) { … } // makeCall returns a completion item for a "make()" call given a specific type. func (c *completer) makeCall(snip *snippet.Builder, typeName string, secondArg string, matchScore float64, edits []protocol.TextEdit) CompletionItem { … } // Create a snippet for a type name where type params become placeholders. func (c *completer) typeNameSnippet(literalType types.Type, qf types.Qualifier) (*snippet.Builder, string) { … } // fullyInstantiated reports whether all of t's type params have // specified type args. func (c *completer) fullyInstantiated(t typesinternal.NamedOrAlias) bool { … } // typeParamInScope returns whether tp's object is in scope at c.pos. // This tells you whether you are in a generic definition and can // assume tp has been specified. func (c *completer) typeParamInScope(tp *types.TypeParam) bool { … }