Skip to content

Commit

Permalink
avoid evaluating symlinks for now
Browse files Browse the repository at this point in the history
We use module paths in many different places and we this ensure
we will compare the same paths consistently and avoid duplicate
entries in memdb.
  • Loading branch information
radeksimko committed Nov 17, 2021
1 parent 371d8fd commit 248373c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/langserver/handlers/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func resolvePath(rootDir, rawPath string) (string, error) {
}

func cleanupPath(path string) (string, error) {
absPath, err := filepath.EvalSymlinks(path)
absPath, err := filepath.Abs(path)
return toLowerVolumePath(absPath), err
}

Expand Down
4 changes: 3 additions & 1 deletion internal/terraform/module/module_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func (mm *moduleManager) AddModule(modPath string) (Module, error) {

err := mm.moduleStore.Add(modPath)
if err != nil {
return nil, err
if _, ok := err.(*state.AlreadyExistsError); !ok {
return nil, err
}
}

// TODO: Avoid returning new module, just the error from adding
Expand Down

0 comments on commit 248373c

Please sign in to comment.