Documentation ¶
Index ¶
- func NewLanguage() language.Language
- type Web
- func (language *Web) AfterResolvingDeps(ctx context.Context)
- func (language *Web) Before(ctx context.Context)
- func (language *Web) Configure(config *config.Config, rel string, file *rule.File)
- func (language *Web) DoneGeneratingRules()
- func (lang *Web) GenerateRules(args language.GenerateArgs) language.GenerateResult
- func (lang *Web) Imports(c *config.Config, r *rule.Rule, f *rule.File) []resolve.ImportSpec
- func (*Web) Kinds() map[string]rule.KindInfo
- func (*Web) KnownDirectives() []string
- func (lang *Web) Loads() []rule.LoadInfo
- func (*Web) Name() string
- func (lang *Web) Resolve(c *config.Config, ix *resolve.RuleIndex, rc *repo.RemoteCache, r *rule.Rule, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLanguage ¶
Types ¶
type Web ¶
func (*Web) AfterResolvingDeps ¶
Called when finished resolving all dependencies with all extensions
func (*Web) Configure ¶
Read configuration from current directory's BUILD file, and apply changes from inherited configuration. Called in each directory when first entering it. c is the configuration for the current directory. It starts out as a copy of the configuration for the parent directory.
rel is the slash-separated relative path from the repository root to the current directory. It is "" for the root directory itself.
f is the build file for the current directory or nil if there is no existing build file.
func (*Web) DoneGeneratingRules ¶
func (language *Web) DoneGeneratingRules()
Called when finished generating all rules in all packages with all extensions, but before resolving imports
func (*Web) GenerateRules ¶
func (lang *Web) GenerateRules(args language.GenerateArgs) language.GenerateResult
GenerateRules extracts build metadata from source files in a directory. Called in each directory where an update is requested in depth-first post-order.
func (*Web) Imports ¶
Imports returns a list of ImportSpecs that can be used to import the rule r. This is used to populate RuleIndex.
If nil is returned, the rule will not be indexed. If any non-nil slice is returned, including an empty slice, the rule will be indexed.
func (*Web) KnownDirectives ¶
KnownDirectives returns a list of directive keys that this Configurer can interpret. Gazelle prints errors for directives that are not recoginized by any Configurer.
func (*Web) Name ¶
Name returns the name of the language. This should be a prefix of the kinds of rules generated by the language whenever possible.
func (*Web) Resolve ¶
func (lang *Web) Resolve(c *config.Config, ix *resolve.RuleIndex, rc *repo.RemoteCache, r *rule.Rule, imports interface{}, from label.Label)
https://www.typescriptlang.org/docs/handbook/module-resolution.html#classic Resolve translates imported libraries for a given rule into Bazel dependencies. Information about imported libraries is returned for each rule generated by language.GenerateRules in language.GenerateResult.Imports. Resolve generates a "deps" attribute (or the appropriate language-specific equivalent) for each import according to language-specific rules and heuristics.