index

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

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

Index type

func New

func New(program *loader.Program) *Index

New index

func (*Index) AddDefinition

func (i *Index) AddDefinition(d def.Definition)

AddDefinition adds a definition to the index

func (*Index) AddImport

func (i *Index) AddImport(parentPath string, alias, depPath string)

AddImport fn

func (*Index) All

func (i *Index) All() map[string]def.Definition

All gets all definitions from the index TODO: remove

func (*Index) DefinitionOf

func (i *Index) DefinitionOf(packagePath string, n ast.Node) (def.Definition, error)

DefinitionOf fn Will return nil when ident is: - package name - basic type - local variable that points to a basic type - function parameters & results TODO: memoize

func (*Index) DefinitionsByPath

func (i *Index) DefinitionsByPath(path string) (defs []def.Definition)

DefinitionsByPath returns a unique, deterministic number of definitions given a particular path

func (*Index) Get

func (i *Index) Get(id string) def.Definition

Get all definitions from the index

func (*Index) GetImports

func (i *Index) GetImports(parentPath string) map[string]string

GetImports fn

func (*Index) Inits

func (i *Index) Inits() (inits []def.Definition)

Inits gets all the main functions

func (i *Index) Link(alias string, d def.Definition)

Link is like a symlink to a definition

func (*Index) Mains

func (i *Index) Mains() (mains []def.Definition)

Mains gets all the main functions

func (*Index) Paths

func (i *Index) Paths() (paths []string)

Paths gets directory paths

func (*Index) Runtime

func (i *Index) Runtime(names ...string) (runtimes []def.Definition, err error)

Runtime gets a definition from the runtime

func (*Index) SetVDOMFile

func (i *Index) SetVDOMFile(def def.Definition)

SetVDOMFile sets the vdom file

func (*Index) SetVDOMPragma

func (i *Index) SetVDOMPragma(pragma string)

SetVDOMPragma sets up JSX

func (*Index) TypeOf

func (i *Index) TypeOf(packagePath string, n ast.Node) (types.Type, error)

TypeOf fn

func (*Index) VDOMFile

func (i *Index) VDOMFile() (def.Definition, error)

VDOMFile gets the vdom file

func (*Index) VDOMPragma

func (i *Index) VDOMPragma() (string, error)

VDOMPragma gets our jsx settings if we've specified them

Jump to

Keyboard shortcuts

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