Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Provide correct module reference targets #158

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/schema/0.12/module_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func moduleBlockSchema() *schema.BlockSchema {
Name: "name",
SemanticTokenModifiers: lang.SemanticTokenModifiers{tokmod.Name},
Description: lang.PlainText("Reference Name"),
IsDepKey: true,
},
},
Description: lang.PlainText("Module block to call a locally or remotely stored module"),
Expand Down
1 change: 1 addition & 0 deletions internal/schema/0.13/module_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func moduleBlockSchema() *schema.BlockSchema {
Name: "name",
SemanticTokenModifiers: lang.SemanticTokenModifiers{tokmod.Name},
Description: lang.PlainText("Reference Name"),
IsDepKey: true,
},
},
Description: lang.PlainText("Module block to call a locally or remotely stored module"),
Expand Down
6 changes: 6 additions & 0 deletions schema/schema_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ func (m *SchemaMerger) SchemaForModule(meta *tfmod.Meta) (*schema.BodySchema, er
path := filepath.Join(meta.Path, sourceAddr.String())

depKeys := schema.DependencyKeys{
Labels: []schema.LabelDependent{
{
Index: 0,
Value: module.LocalName,
},
},
// Fetching based only on the source can cause conflicts for multiple versions of the same module
// specially if they have different versions or the source of those modules have been modified
// inside the .terraform folder. This is a compromise that we made in this moment since it would impact only auto completion
Expand Down