rust

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxWaitDuration = 5 * time.Minute

Variables

This section is empty.

Functions

func CheckRepo

func CheckRepo(repo string) (string, time.Duration)

func ConvertTreeToUse

func ConvertTreeToUse(node *UseNode, prefix string) []uniast.Import

func ExtractLazyStaticeSymbol

func ExtractLazyStaticeSymbol(loc lsp.Location) (string, error)

func GetAndMergeUse

func GetAndMergeUse(fileContents []string) ([]uniast.Import, error)

func GetDefaultLSP

func GetDefaultLSP() (lang uniast.Language, name string)

func GetLastCommitTime

func GetLastCommitTime(repo string) time.Time

func GetRustContentDefine

func GetRustContentDefine(name, fileContent string) (string, error)

func ParseUseStatements

func ParseUseStatements(fileContent string) ([]uniast.Import, error)

func RunCmdInDir

func RunCmdInDir(dir string, cmd string, args ...string) error

func UpdateToolChain

func UpdateToolChain(repo string, recommandDay int) error

call `rustup` to install the latest Rust toolchain on the end of month

Types

type Module

type Module struct {
	Name string
	Path string
}

type RustSpec

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

func NewRustSpec

func NewRustSpec() *RustSpec

func (*RustSpec) DeclareTokenOfSymbol

func (c *RustSpec) DeclareTokenOfSymbol(sym lsp.DocumentSymbol) int

func (*RustSpec) FileImports

func (c *RustSpec) FileImports(content []byte) ([]uniast.Import, error)

func (*RustSpec) FunctionSymbol

func (c *RustSpec) FunctionSymbol(sym lsp.DocumentSymbol) (int, []int, []int, []int)

func (*RustSpec) GetUnloadedSymbol

func (c *RustSpec) GetUnloadedSymbol(from lsp.Token, loc lsp.Location) (string, error)

func (*RustSpec) HasImplSymbol

func (c *RustSpec) HasImplSymbol() bool

func (*RustSpec) ImplSymbol

func (c *RustSpec) ImplSymbol(sym lsp.DocumentSymbol) (int, int, int)

func (*RustSpec) IsDocToken

func (c *RustSpec) IsDocToken(tok lsp.Token) bool

func (*RustSpec) IsEntitySymbol

func (c *RustSpec) IsEntitySymbol(sym lsp.DocumentSymbol) bool

Include: struct, enum , trait, typeAlias, const, static, variable, function, method of type, macro Exclude: field, method of trait, impl object, enum member

func (*RustSpec) IsEntityToken

func (c *RustSpec) IsEntityToken(tok lsp.Token) bool

func (*RustSpec) IsExternalEntityToken

func (c *RustSpec) IsExternalEntityToken(tok lsp.Token) bool

func (*RustSpec) IsMainFunction

func (c *RustSpec) IsMainFunction(sym lsp.DocumentSymbol) bool

func (*RustSpec) IsPublicSymbol

func (c *RustSpec) IsPublicSymbol(sym lsp.DocumentSymbol) bool

func (*RustSpec) IsStdToken

func (c *RustSpec) IsStdToken(tok lsp.Token) bool

func (*RustSpec) NameSpace

func (c *RustSpec) NameSpace(path string) (string, string, error)

func (*RustSpec) ShouldSkip

func (c *RustSpec) ShouldSkip(path string) bool

func (*RustSpec) TokenKind

func (c *RustSpec) TokenKind(tok lsp.Token) lsp.SymbolKind

func (*RustSpec) WorkSpace

func (c *RustSpec) WorkSpace(root string) (map[string]string, error)

implement LanguageSpec.CollectModules

type UseNode

type UseNode struct {
	Name     string
	Children []*UseNode
}

UseNode represents a module node in the dependency tree

func BuildDependencyTree

func BuildDependencyTree(useStatements []uniast.Import) *UseNode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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