scala

package
v0.19.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildScalaIndices

func BuildScalaIndices(
	scalaFiles []string,
	contentReader vcs.ContentReader,
) (map[string][]string, map[string]map[string][]string, map[string]string)

BuildScalaIndices builds package and type indices for supplied Scala files.

func ExtractTypeIdentifiers

func ExtractTypeIdentifiers(sourceCode []byte) []string

ExtractTypeIdentifiers returns referenced type-like identifiers in Scala source.

func IsPackageObject

func IsPackageObject(sourceCode []byte) bool

IsPackageObject reports whether this source declares a Scala package object.

func IsTestFile

func IsTestFile(filePath string) bool

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

func ParsePackageDeclaration

func ParsePackageDeclaration(sourceCode []byte) string

ParsePackageDeclaration extracts the Scala package from source code.

func ParseTopLevelTypeNames

func ParseTopLevelTypeNames(sourceCode []byte) []string

ParseTopLevelTypeNames extracts declared top-level type names from Scala source code.

func ResolveScalaProjectImports

func ResolveScalaProjectImports(
	absPath string,
	_ string,
	scalaPackageIndex map[string][]string,
	scalaPackageTypes map[string]map[string][]string,
	scalaFilePackages map[string]string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

ResolveScalaProjectImports resolves Scala project imports for a single file.

Types

type ExternalImport

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

ExternalImport represents a third-party 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 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() moduleapi.MaturityLevel

func (Module) Name

func (Module) Name() string

func (Module) NewResolver

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

type ScalaImport

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

ScalaImport represents an import in Scala source code.

func ParseScalaImports

func ParseScalaImports(sourceCode []byte, projectPackages map[string]bool) []ScalaImport

ParseScalaImports parses Scala source code and classifies imports.

type StandardLibraryImport

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

StandardLibraryImport represents a Scala/JDK 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