yakdoc

package
v1.3.4-beta2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InterfaceToAnyRegep, _ = regexp.Compile(`interface\s*\{\}`)

	ErrAutoGenerated    = utils.Error("file is <autogenerated>")
	ErrIsInstanceMethod = utils.Error("function is instance method")
)

Functions

func ASTGetTypeName added in v1.3.3

func ASTGetTypeName(expr ast.Expr, fset *token.FileSet) string

func CustomHandleTypeName added in v1.3.0

func CustomHandleTypeName(typName string) string

func GetDeclAndCompletion added in v1.2.9

func GetDeclAndCompletion(funcName string, params, results []*Field) (string, string)

func GetProjectAstPackages added in v1.2.9

func GetProjectAstPackages() (map[string]*ast.Package, *token.FileSet, error)

func GetProjectPath added in v1.2.9

func GetProjectPath() string

func GetTypeNameWithPkgPath added in v1.3.3

func GetTypeNameWithPkgPath(typ reflect.Type) (pkgPath string, pkgPathName string)

func RegisterHook added in v1.2.9

func RegisterHook(hook func(h *DocumentHelper))

func ShrinkTypeVerboseName added in v1.2.9

func ShrinkTypeVerboseName(i string) string

rename native type

Types

type CacheAstBundle added in v1.2.9

type CacheAstBundle struct {
	// contains filtered or unexported fields
}

func GetCacheAstBundle added in v1.2.9

func GetCacheAstBundle(fileName string) (*CacheAstBundle, error)

type DeprecateFunction added in v1.3.1

type DeprecateFunction struct {
	Name string
	Self *FuncDecl
	Msg  string
}

type DocumentHelper

type DocumentHelper struct {
	Libs                map[string]*ScriptLib
	Functions           map[string]*FuncDecl
	Instances           map[string]*LibInstance
	StructMethods       map[string]*ScriptLib // 结构体方法,名字 -> 所有结构体与结构体指针方法
	DeprecatedFunctions []*DeprecateFunction
	// contains filtered or unexported fields
}

func (*DocumentHelper) Callback added in v1.2.9

func (h *DocumentHelper) Callback()

func (*DocumentHelper) GetAllLibs

func (h *DocumentHelper) GetAllLibs() []string

func (*DocumentHelper) HelpInfo

func (h *DocumentHelper) HelpInfo() string

func (*DocumentHelper) InjectInterfaceDocumentManually added in v1.2.9

func (h *DocumentHelper) InjectInterfaceDocumentManually(interfacePath, sourceCodePath string) error

func (*DocumentHelper) LibFuncAutoCompletion

func (h *DocumentHelper) LibFuncAutoCompletion(libName, funcName string) string

func (*DocumentHelper) LibFuncDefinitionStr

func (h *DocumentHelper) LibFuncDefinitionStr(libName, funcName string) string

func (*DocumentHelper) LibFuncHelpInfo

func (h *DocumentHelper) LibFuncHelpInfo(libName, funcName string) string

func (*DocumentHelper) LibHelpInfo

func (h *DocumentHelper) LibHelpInfo(name string) string

func (*DocumentHelper) ShowHelpInfo

func (h *DocumentHelper) ShowHelpInfo()

func (*DocumentHelper) ShowLibFuncHelpInfo

func (h *DocumentHelper) ShowLibFuncHelpInfo(libName, funcName string)

func (*DocumentHelper) ShowLibHelpInfo

func (h *DocumentHelper) ShowLibHelpInfo(name string)

type Field added in v1.2.7

type Field struct {
	Name    string
	Type    string
	RefType reflect.Type
}

func HandleFieldsRaw added in v1.2.9

func HandleFieldsRaw(fieldStr string) []*Field

func HandleParams added in v1.2.9

func HandleParams(funcRefType reflect.Type, typ *ast.FuncType, fset *token.FileSet) (params []*Field)

func HandleResults added in v1.2.9

func HandleResults(funcRefType reflect.Type, typ *ast.FuncType, fset *token.FileSet) (results []*Field)

type FuncDecl

type FuncDecl struct {
	LibName    string
	MethodName string
	Document   string
	Decl       string

	Params  []*Field
	Results []*Field

	VSCodeSnippets string
}

func FuncToFuncDecl

func FuncToFuncDecl(f interface{}, libName string, overideName string) (*FuncDecl, error)

Get description and declaration of a func

func (*FuncDecl) String

func (f *FuncDecl) String() string

type LibInstance

type LibInstance struct {
	LibName      string
	InstanceName string
	Type         string
	ValueStr     string
}

func AnyTypeToLibInstance

func AnyTypeToLibInstance(libName, name string, typ reflect.Type, value interface{}) *LibInstance

func (*LibInstance) String

func (i *LibInstance) String() string

type ScriptLib

type ScriptLib struct {
	Name        string
	Instances   map[string]*LibInstance
	Functions   map[string]*FuncDecl
	ElementDocs []string
}

func (*ScriptLib) String

func (l *ScriptLib) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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