Documentation
¶
Index ¶
- func BuildKotlinIndices(kotlinFiles []string, contentReader vcs.ContentReader) (map[string][]string, map[string]map[string][]string, map[string]string)
- func ExtractPackageDeclaration(sourceCode []byte) string
- func ExtractTopLevelTypeNames(sourceCode []byte) []string
- func ExtractTypeIdentifiers(sourceCode []byte) []string
- func IsTestFile(filePath string) bool
- func ResolveKotlinProjectImports(absPath string, filePath string, kotlinPackageIndex map[string][]string, ...) ([]string, error)
- type ExternalImport
- type InternalImport
- type KotlinImport
- type Module
- type StandardLibraryImport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKotlinIndices ¶
func ExtractPackageDeclaration ¶
ExtractPackageDeclaration extracts the package declaration from Kotlin source code
func ExtractTopLevelTypeNames ¶
ExtractTopLevelTypeNames returns the class/object/interface/typealias names declared at the top level of the file
func ExtractTypeIdentifiers ¶
ExtractTypeIdentifiers returns all type identifiers referenced within the file
func IsTestFile ¶
IsTestFile reports whether the given Kotlin file path is a test file.
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 ¶
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) IsTestFile ¶
func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool
func (Module) Maturity ¶
func (Module) Maturity() langsupport.MaturityLevel
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