swift

package
v0.29.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSwiftReferencedSymbols added in v0.28.1

func ExtractSwiftReferencedSymbols(sourceCode []byte) []string

ExtractSwiftReferencedSymbols returns referenced symbol names in Swift source: type identifiers plus bare identifiers (function/constant references) and custom operators. Names declared at the top level of this file are excluded so a file is never treated as depending on itself.

func ExtractSwiftTypeIdentifiers

func ExtractSwiftTypeIdentifiers(sourceCode []byte) []string

ExtractSwiftTypeIdentifiers returns referenced type-like identifiers in Swift source.

func IsTestFile

func IsTestFile(filePath string) bool

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

func ParseSwiftTopLevelSymbolNames added in v0.28.1

func ParseSwiftTopLevelSymbolNames(sourceCode []byte) []string

ParseSwiftTopLevelSymbolNames returns the names of all top-level declarations in Swift source: types plus top-level functions, constants/variables, and custom operators. This is the declaration side of cross-file reference resolution (CLR-14): global funcs, lets, and operators can be referenced across files just like types.

func ParseSwiftTopLevelTypeNames

func ParseSwiftTopLevelTypeNames(sourceCode []byte) []string

ParseSwiftTopLevelTypeNames returns top-level type-like declaration names in Swift source.

func ResolveSwiftProjectImports

func ResolveSwiftProjectImports(
	absPath string,
	filePath string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

Types

type Provider added in v0.27.0

type Provider struct{}

func (Provider) Extensions added in v0.27.0

func (Provider) Extensions() []string

func (Provider) IsTestFile added in v0.27.0

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

func (Provider) Maturity added in v0.27.0

func (Provider) Maturity() moduleapi.MaturityLevel

func (Provider) Name added in v0.27.0

func (Provider) Name() string

func (Provider) NewResolver added in v0.27.0

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

type SwiftImport

type SwiftImport struct {
	Path string
}

SwiftImport represents an import in a Swift file.

func ParseSwiftImports

func ParseSwiftImports(sourceCode []byte) ([]SwiftImport, error)

ParseSwiftImports parses Swift source code and extracts imports.

func SwiftImports

func SwiftImports(filePath string) ([]SwiftImport, error)

SwiftImports parses a Swift file and returns its imports.

Jump to

Keyboard shortcuts

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