analyzer

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *zap.Logger)

func SetRoot

func SetRoot(root string)

Types

type CompletionItem

type CompletionItem struct {
	Label         string             `json:"label"`
	Kind          CompletionItemKind `json:"kind"`
	Detail        string             `json:"detail"`
	Documentation interface{}        `json:"documentation"`
	InsertText    string             `json:"insertText"`
}

type CompletionItemKind

type CompletionItemKind int
const (
	Method CompletionItemKind = iota
	Function
	Constructor
	Field
	Variable
	Class
	Struct
	Interface
	Module
	Property
	Event
	Operator
	Unit
	Value
	Constant
	Enum
	EnumMember
	Keyword
	Text
	Color
	File
	Reference
	Customcolor
	Folder
	TypeParameter
	Snippet
)

type MarkdownString

type MarkdownString struct {
	Value string `json:"value"`
}

type Package

type Package struct {
	Name     string     `json:"name"`
	Synopsis string     `json:"synopsis"`
	URL      string     `json:"url"`
	Path     string     `json:"path"`
	Children []*Package `json:"children"`
	PackageSummary
	// contains filtered or unexported fields
}

func ReadPackagesFile

func ReadPackagesFile(f string) ([]*Package, error)

func (*Package) Analyze

func (p *Package) Analyze() (err error)

func (*Package) GetCompletionItem

func (p *Package) GetCompletionItem() *CompletionItem

func (*Package) GetLocation

func (p *Package) GetLocation() string

func (*Package) HasChildren

func (p *Package) HasChildren() bool

func (*Package) IsBuiltin

func (p *Package) IsBuiltin() bool

IsBuiltin check if this is "builtin" special package

func (*Package) SymbolByChar

func (p *Package) SymbolByChar(chr string) []*CompletionItem

type PackageIndex

type PackageIndex struct {
	Packages []*Package
	// contains filtered or unexported fields
}

func BuildPackageIndex

func BuildPackageIndex(pkgs []*Package) PackageIndex

func (PackageIndex) Len

func (pi PackageIndex) Len() int

func (PackageIndex) Match

func (pi PackageIndex) Match(char string) []*CompletionItem

func (PackageIndex) PackageByName

func (pi PackageIndex) PackageByName(name string) (*Package, bool)

type PackageScanner

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

func NewPackageScanner

func NewPackageScanner(pkgName, pkgPath string, scanPrivate bool) PackageScanner

func (*PackageScanner) Scan

func (p *PackageScanner) Scan() (PackageSummary, error)

type PackageSummary

type PackageSummary struct {
	Functions SymbolIndex
	Values    SymbolIndex
}

func NewPackageSummary

func NewPackageSummary() PackageSummary

type Packages

type Packages []*Package

func (Packages) GetCompletionItems

func (pkgs Packages) GetCompletionItems() []*CompletionItem

type SymbolIndex

type SymbolIndex struct {
	Symbols []*CompletionItem
	// contains filtered or unexported fields
}

func (*SymbolIndex) Append

func (si *SymbolIndex) Append(items ...*CompletionItem)

func (SymbolIndex) Match

func (si SymbolIndex) Match(char string) []*CompletionItem

func (SymbolIndex) SymbolByName

func (si SymbolIndex) SymbolByName(name string) *CompletionItem

Directories

Path Synopsis
package check checks provided Go code and reports syntax errors
package check checks provided Go code and reports syntax errors

Jump to

Keyboard shortcuts

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