comp

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

scripthaus completion

Index

Constants

View Source
const (
	// local to simplecomp
	CGTypeCommand  = "command"
	CGTypeFile     = "file"
	CGTypeDir      = "directory"
	CGTypeVariable = "variable"

	// implemented in cmdrunner
	CGTypeMeta        = "metacmd"
	CGTypeCommandMeta = "command+meta"

	CGTypeRemote         = "remote"
	CGTypeRemoteInstance = "remoteinstance"
	CGTypeGlobalCmd      = "globalcmd"
)
View Source
const (
	QuoteTypeLiteral = ""
	QuoteTypeDQ      = "\""
	QuoteTypeANSI    = "$'"
	QuoteTypeSQ      = "'"
)
View Source
const MaxCompQuoteLen = 5000

Variables

View Source
var SimpleCompGenFns map[string]SimpleCompGenFnType

Functions

func RegisterSimpleCompFn

func RegisterSimpleCompFn(compType string, fn SimpleCompGenFnType)

func SortCompReturnEntries

func SortCompReturnEntries(c *CompReturn)

Types

type CompContext

type CompContext struct {
	RemotePtr  *sstore.RemotePtrType
	Cwd        string
	ForDisplay bool
}

type CompEntry

type CompEntry struct {
	Word      string
	IsMetaCmd bool
}

directories will have a trailing "/"

type CompPoint

type CompPoint struct {
	StmtStr     string
	Words       []ParsedWord
	CompWord    int
	CompWordPos int
	Prefix      string
	Suffix      string
}

func ParseCompPoint

func ParseCompPoint(cmdStr utilfn.StrWithPos) *CompPoint

func (*CompPoint) FullyExtend

func (p *CompPoint) FullyExtend(crtn *CompReturn) utilfn.StrWithPos

type CompReturn

type CompReturn struct {
	CompType string
	Entries  []CompEntry
	HasMore  bool
}

func CombineCompReturn

func CombineCompReturn(compType string, c1 *CompReturn, c2 *CompReturn) *CompReturn

func DoCompGen

func DoCompGen(ctx context.Context, cmdStr utilfn.StrWithPos, compCtx CompContext) (*CompReturn, *utilfn.StrWithPos, error)

func DoCompGenOld

func DoCompGenOld(ctx context.Context, sp utilfn.StrWithPos, compCtx CompContext) (*CompReturn, *utilfn.StrWithPos, error)

func DoSimpleComp

func DoSimpleComp(ctx context.Context, compType string, prefix string, compCtx CompContext, args []interface{}) (*CompReturn, error)

func (*CompReturn) GetCompDisplayStrs

func (c *CompReturn) GetCompDisplayStrs() []string

func (*CompReturn) GetCompStrs

func (c *CompReturn) GetCompStrs() []string

type ParsedWord

type ParsedWord struct {
	Offset      int
	Word        *syntax.Word
	PartialWord string
	Prefix      string
}

type SimpleCompGenFnType

type SimpleCompGenFnType = func(ctx context.Context, prefix string, compCtx CompContext, args []interface{}) (*CompReturn, error)

Jump to

Keyboard shortcuts

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