Help us shape the future of Go! Take the 2026 Go Developer Survey

swift

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 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 ParseSwiftExtensionOwners added in v0.30.0

func ParseSwiftExtensionOwners(sourceCode []byte) []string

ParseSwiftExtensionOwners returns the types extended by this 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 SwiftDeclarationLocation added in v0.30.0

type SwiftDeclarationLocation struct {
	Name  string
	Owner string
	Kind  string
	Line  int
}

SwiftDeclarationLocation is one cross-file-visible declaration.

func ParseSwiftDeclarationLocations added in v0.30.0

func ParseSwiftDeclarationLocations(sourceCode []byte) []SwiftDeclarationLocation

ParseSwiftDeclarationLocations returns declarations eligible for cross-file resolution with their 1-based source lines.

type SwiftExtensionMember added in v0.30.0

type SwiftExtensionMember struct {
	Owner  string
	Member string
}

SwiftExtensionMember identifies a cross-file-visible extension member and the type whose extension declares it.

func ParseSwiftExtensionMembers added in v0.30.0

func ParseSwiftExtensionMembers(sourceCode []byte) []SwiftExtensionMember

ParseSwiftExtensionMembers returns non-private direct extension members.

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.

type SwiftQualifiedReference added in v0.30.0

type SwiftQualifiedReference struct {
	Qualifier string
	Member    string
}

SwiftQualifiedReference is a member referenced through an explicit type-like qualifier (for example Parser.parse or Self.parse).

func ExtractSwiftQualifiedReferences added in v0.30.0

func ExtractSwiftQualifiedReferences(sourceCode []byte) []SwiftQualifiedReference

ExtractSwiftQualifiedReferences returns explicit type/Self member references. Lowercase value-member navigation such as logger.error is deliberately excluded because it cannot be matched safely without type information.

type SwiftReferenceLocation added in v0.30.0

type SwiftReferenceLocation struct {
	Name      string
	Qualifier string
	Line      int
}

SwiftReferenceLocation is one source-level symbol reference.

func ExtractSwiftReferenceLocations added in v0.30.0

func ExtractSwiftReferenceLocations(sourceCode []byte) []SwiftReferenceLocation

ExtractSwiftReferenceLocations returns the references used by dependency resolution with their 1-based source lines.

Jump to

Keyboard shortcuts

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