rust

package
v0.19.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CargoTomlFile = "Cargo.toml"

Variables

View Source
var Extensions = []string{
	"rs",
}
View Source
var MakeModTree = utils.Cached1In1OutErr(func(mainPath string) (*ModTree, error) {

	return makeModTree(mainPath, "crate", nil)
})

MakeModTree builds the ModTree given the main library/executable file path (src/lib.rs or src/main.rs).

Functions

func MakeRustLanguage

func MakeRustLanguage(_ *Config) (language.Language, error)

Types

type CargoToml added in v0.18.0

type CargoToml struct {
	PackageDefinition packageDefinition `toml:"package"`
	// It's [dev-]dependencies.
	Dependencies map[string]localDependency
	// contains filtered or unexported fields
}

func (*CargoToml) MainFile added in v0.18.0

func (c *CargoToml) MainFile() (string, error)

MainFile retrieves the main file of the workspace (e.g. src/lib.rs or src/main.rs).

func (*CargoToml) ModTree added in v0.18.0

func (c *CargoToml) ModTree() (*ModTree, error)

ModTree lazily builds the ModTree for this specific CargoToml.

First call to this function needs to parse the ModTree, subsequent calls are cached.

type Config added in v0.17.4

type Config struct{}

type Language

type Language struct{}

func (*Language) ParseExports

func (l *Language) ParseExports(file *language.FileInfo) (*language.ExportsResult, error)

func (*Language) ParseFile

func (l *Language) ParseFile(id string) (*language.FileInfo, error)

func (*Language) ParseImports

func (l *Language) ParseImports(file *language.FileInfo) (*language.ImportsResult, error)

type ModTree

type ModTree struct {
	Name     string
	Path     string
	Parent   *ModTree
	Children map[string]*ModTree
}

func (*ModTree) Search

func (m *ModTree) Search(modChain []string) *ModTree

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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