Use module version proximity in finding relevant schema #180
Labels
enhancement
New feature or request
modules
Functionality related to the module block and modules generally
Because detection of the relevant root module for a file/dir is not a trivial task, #176 introduces new functionality which reports all potential candidates for root modules in the context of a directory being initialized/opened, matches the first one and displays warning when there is more than 1.
Picking the right root module from a list of candidates is something that #176 does not solve yet, because there is a number of different factors which may play role in picking.
Use-cases
For example:
module-alpha
is referenced bytf-root-1
andtf-root-2
module-alpha
requiresaws
provider~> 2.0
tf-root-1
requiresaws
provider~> 2.0
and has2.2.0
installedtf-root-2
requiresaws
provider~> 2.5
and has2.5.9
installedtf-root-2
is probably more relevant, because any compatible higher version is better?The downside here is that the schema data may not be accurate for
tf-root-1
.Proposal
*.tf
) - something which so far only lives on the client sideprovider
'sversion
and/orterraform
'srequired_providers
- something we should understand anyway long-term, but that is a non-trivial task in itselfThen would provide us more context (plugin version constraints and versions installed) to further sort potential candidates for root modules for a given file/directory being opened.
I assume we could generally flag up mismatching plugin constraints between module consumers? This would require some better understanding of how people use plugin constraints in this context.
References
#32
#176
The text was updated successfully, but these errors were encountered: