Skip to content

Commit

Permalink
Fix root module discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Jun 6, 2024
1 parent b1938b0 commit 3d0d8f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/features/rootmodules/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ import (
"github.com/hashicorp/terraform-ls/internal/terraform/datadir"
"github.com/hashicorp/terraform-ls/internal/terraform/exec"
op "github.com/hashicorp/terraform-ls/internal/terraform/module/operation"
"github.com/hashicorp/terraform-ls/internal/uri"
)

func (f *RootModulesFeature) discover(path string, files []string) error {
if uri, ok := datadir.ModuleUriFromDataDir(path); ok {
rawUri := uri.FromPath(path)
if uri, ok := datadir.ModuleUriFromDataDir(rawUri); ok {
f.logger.Printf("discovered root module in %s", uri)

err := f.Store.AddIfNotExists(uri)
dir := document.DirHandleFromURI(uri)
err := f.Store.AddIfNotExists(dir.Path())
if err != nil {
return err
}
Expand Down

0 comments on commit 3d0d8f9

Please sign in to comment.