csharp

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 BuildCSharpIndices

func BuildCSharpIndices(
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) (map[string][]string, map[string]map[string][]string, map[string]string, map[string]string)

func ExtractCSharpTypeIdentifiers

func ExtractCSharpTypeIdentifiers(source string) []string

ExtractCSharpTypeIdentifiers extracts likely type identifiers from code references.

func IsTestFile

func IsTestFile(filePath string) bool

IsTestFile reports whether the given C# path is a test file.

func ParseCSharpNamespace

func ParseCSharpNamespace(source string) string

ParseCSharpNamespace extracts the file namespace declaration.

func ParseCSharpPartialTypeNames added in v0.27.0

func ParseCSharpPartialTypeNames(source string) map[string]bool

ParseCSharpPartialTypeNames returns the set of type names declared with the `partial` modifier. In valid C# the same type name may appear in multiple files of one namespace only as a partial type, so this lets the resolver link every file of a partial class (the common Foo.cs / Foo.Async.cs split) while still treating non-partial duplicate names as ambiguous.

func ParseTopLevelCSharpTypeNames

func ParseTopLevelCSharpTypeNames(source string) []string

ParseTopLevelCSharpTypeNames extracts top-level type names declared in a file.

func ResolveCSharpProjectImports

func ResolveCSharpProjectImports(
	absPath string,
	_ string,
	namespaceToFiles map[string][]string,
	namespaceToTypes map[string]map[string][]string,
	fileToNamespace map[string]string,
	fileToScope map[string]string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

Types

type CSharpImport

type CSharpImport struct {
	Path string
}

CSharpImport represents a using directive.

func CSharpImports

func CSharpImports(filePath string) ([]CSharpImport, error)

CSharpImports parses a C# file and returns its imports.

func ParseCSharpImports

func ParseCSharpImports(source string) []CSharpImport

ParseCSharpImports parses C# source code and extracts using directives.

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

Jump to

Keyboard shortcuts

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