kotlin

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKotlinIndices

func BuildKotlinIndices(
	kotlinFiles []string,
	contentReader vcs.ContentReader,
) (map[string][]string, map[string]map[string][]string, map[string]string)

func ExtractPackageDeclaration

func ExtractPackageDeclaration(sourceCode []byte) string

ExtractPackageDeclaration extracts the package declaration from Kotlin source code

func ExtractTopLevelTypeNames

func ExtractTopLevelTypeNames(sourceCode []byte) []string

ExtractTopLevelTypeNames returns the class/object/interface/typealias names declared at the top level of the file

func ExtractTypeIdentifiers

func ExtractTypeIdentifiers(sourceCode []byte) []string

ExtractTypeIdentifiers returns all type identifiers referenced within the file

func IsTestFile

func IsTestFile(filePath string) bool

IsTestFile reports whether the given Kotlin file path is a test file.

func ResolveKotlinProjectImports

func ResolveKotlinProjectImports(
	absPath string,
	filePath string,
	kotlinPackageIndex map[string][]string,
	kotlinPackageTypes map[string]map[string][]string,
	kotlinFilePackages map[string]string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

Types

type ExternalImport

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

ExternalImport represents an external library import

func (ExternalImport) IsWildcard

func (e ExternalImport) IsWildcard() bool

func (ExternalImport) Package

func (e ExternalImport) Package() string

func (ExternalImport) Path

func (e ExternalImport) Path() string

type InternalImport

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

InternalImport represents an internal project import

func (InternalImport) IsWildcard

func (i InternalImport) IsWildcard() bool

func (InternalImport) Package

func (i InternalImport) Package() string

func (InternalImport) Path

func (i InternalImport) Path() string

type KotlinImport

type KotlinImport interface {
	Path() string
	IsWildcard() bool
	Package() string
}

KotlinImport represents an import in a Kotlin file

func ClassifyWithProjectPackages

func ClassifyWithProjectPackages(imports []KotlinImport, projectPackages map[string]bool) []KotlinImport

ClassifyWithProjectPackages reclassifies imports with knowledge of project packages This is used during graph building when we know all project packages

func KotlinImports

func KotlinImports(filePath string) ([]KotlinImport, error)

KotlinImports parses a Kotlin file and returns its imports

func ParseKotlinImports

func ParseKotlinImports(sourceCode []byte) ([]KotlinImport, error)

ParseKotlinImports parses Kotlin source code and extracts imports

type Module

type Module struct{}

func (Module) Extensions

func (Module) Extensions() []string

func (Module) IsTestFile

func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool

func (Module) Maturity

func (Module) Maturity() langsupport.MaturityLevel

func (Module) Name

func (Module) Name() string

func (Module) NewResolver

func (Module) NewResolver(ctx *langsupport.Context, contentReader vcs.ContentReader) langsupport.Resolver

type StandardLibraryImport

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

StandardLibraryImport represents a Kotlin/Java/Android standard library import

func (StandardLibraryImport) IsWildcard

func (s StandardLibraryImport) IsWildcard() bool

func (StandardLibraryImport) Package

func (s StandardLibraryImport) Package() string

func (StandardLibraryImport) Path

func (s StandardLibraryImport) Path() string

Jump to

Keyboard shortcuts

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