Documentation
¶
Index ¶
- func IsTestFile(filePath string) bool
- func ResolvePythonAbsoluteImportPath(importPath string, suppliedFiles map[string]bool) []string
- func ResolvePythonImportPath(sourceFile, importPath string, suppliedFiles map[string]bool) []string
- func ResolvePythonProjectImports(absPath string, filePath string, ext string, suppliedFiles map[string]bool, ...) ([]string, error)
- type ExternalImport
- type InternalImport
- type Module
- type PythonImport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestFile ¶
IsTestFile reports whether the given Python path is a test file.
func ResolvePythonAbsoluteImportPath ¶
ResolvePythonAbsoluteImportPath resolves an absolute Python package import (e.g. "dexter.tools.finance.api") to matching project files.
func ResolvePythonImportPath ¶
ResolvePythonImportPath resolves a Python import path to possible file paths.
Types ¶
type ExternalImport ¶
type ExternalImport struct {
// contains filtered or unexported fields
}
ExternalImport represents an external module import.
func (ExternalImport) IsTypeOnly ¶
func (e ExternalImport) IsTypeOnly() bool
func (ExternalImport) Path ¶
func (e ExternalImport) Path() string
type InternalImport ¶
type InternalImport struct {
// contains filtered or unexported fields
}
InternalImport represents a relative module import.
func (InternalImport) IsTypeOnly ¶
func (i InternalImport) IsTypeOnly() bool
func (InternalImport) Path ¶
func (i InternalImport) Path() string
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 PythonImport ¶
PythonImport represents an import in a Python file.
func ParsePythonImports ¶
func ParsePythonImports(sourceCode []byte) ([]PythonImport, error)
ParsePythonImports parses Python source code and extracts imports.
func PythonImports ¶
func PythonImports(filePath string) ([]PythonImport, error)
PythonImports parses a Python file and returns its imports.
Click to show internal directories.
Click to hide internal directories.