gazelle_haskell_modules

package
v0.0.0-...-f28c6c7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Functions used for dependency resolution

An extension for gazelle to generate haskell_module rules from haskell rules

Index

Constants

View Source
const BOOT_EXTENSION = ".hs-boot"
View Source
const HIMPORTSCAN_PATH = "himportscan/himportscan"
View Source
const PRIVATE_ATTR_DEP_LABELS = "dep_labels"
View Source
const PRIVATE_ATTR_IS_BOOT = "is_source_importation"
View Source
const PRIVATE_ATTR_MODULE_LABELS = "module_labels"
View Source
const PRIVATE_ATTR_MODULE_NAME = "module_name"
View Source
const PRIVATE_ATTR_ORIGINATING_RULE = "originating_rule"
View Source
const PRIVATE_FIND_MODULES_DIRECTIVE = "gazelle_haskell_modules:srcs:"

Variables

View Source
var PRIVATE_STRIP_FIND_MODULES_DIRECTIVE = regexp.MustCompile(fmt.Sprintf(`#\s*%s(.*)`, PRIVATE_FIND_MODULES_DIRECTIVE))

Functions

func NewLanguage

func NewLanguage() language.Language

func ParseLabel

func ParseLabel(v string) (label.Label, error)

We use a patched parsing for labels, as the parser from gazelle can't understand labels of the form "@repo", supposed to mean "@repo//:repo".

Types

type Config

type Config struct{}

type HModuleImportData

type HModuleImportData struct {
	ImportedModules []ModuleImport
	UsesTH          bool
}

type HRuleImportData

type HRuleImportData struct {
	Deps    map[label.Label]bool // Absolute labels of deps of the library/binary/test
	Modules map[label.Label]bool // Absolute labels of the modules in the library, empty if not a library
	Srcs    []string
}

type ModuleData

type ModuleData struct {
	ModuleName      string
	FilePath        string
	ImportedModules []ModuleImport
	UsesTH          bool
	IsBoot          bool
}

type ModuleImport

type ModuleImport struct {
	IsSourceImported bool
	PackageName      string
	ModuleName       string
}

type RuleInfo

type RuleInfo struct {
	OriginatingRules []*rule.Rule
	ModuleData       *ModuleData
}

Jump to

Keyboard shortcuts

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