Index uninitalized modules #724
Labels
enhancement
New feature or request
modules
Functionality related to the module block and modules generally
Milestone
Background
The server implements an "indexer" (internally called "walker") which indexes modules by walking the file hierarchy. This allows the server to maintain data about modules which can be used for sourcing (more) relevant schema, providing cross-module references etc.
Use-cases
We have historically only indexed initialized modules (i.e. those which have
.terraform
directory). This was partially to reduce performance impact in the early versions of LS when we were indexing "synchronously" as part of responding to theinitialize
request and secondly because we only used the module manifest and provider binaries, not the configuration itself.A new use case comes into play with cross-module "go-to-definition" and "go-to-references" (introduced in #700), where it would be beneficial to index all modules, even uninitialized ones.
Proposal
DidChangeWatchedFilesRegistrationOptions
#867ast.IsFilenameIndexable(file string) bool
toast
package.terraform
conditional logic with some logic which detects any first indexable file in a directory and schedules the module for indexing and skips any other files within that directoryterraform-ls/internal/terraform/module/walker.go
Lines 187 to 197 in 40a6ae8
The text was updated successfully, but these errors were encountered: