Skip to content

Commit

Permalink
walker: remove last occurence of old watcher (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Jun 28, 2022
1 parent 55cbed1 commit c89b117
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
11 changes: 0 additions & 11 deletions internal/terraform/module/types.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
package module

import (
"context"
"io/fs"
"log"

"github.com/hashicorp/terraform-ls/internal/document"
)

type Watcher interface {
Start(context.Context) error
Stop() error
SetLogger(*log.Logger)
AddModule(string) error
RemoveModule(string) error
IsModuleWatched(string) bool
}

type ReadOnlyFS interface {
fs.FS
ReadDir(name string) ([]fs.DirEntry, error)
Expand Down
11 changes: 1 addition & 10 deletions internal/terraform/module/walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ type Walker struct {
jobStore job.JobStore
tfExecFactory exec.ExecutorFactory

watcher Watcher
logger *log.Logger
logger *log.Logger

Collector *WalkerCollector

Expand Down Expand Up @@ -77,10 +76,6 @@ func (w *Walker) SetLogger(logger *log.Logger) {
w.logger = logger
}

func (w *Walker) SetWatcher(watcher Watcher) {
w.watcher = watcher
}

func (w *Walker) SetExcludeModulePaths(excludeModulePaths []string) {
w.excludeModulePaths = make(map[string]bool)
for _, path := range excludeModulePaths {
Expand Down Expand Up @@ -328,10 +323,6 @@ func (w *Walker) walk(ctx context.Context, dir document.DirHandle) error {
}
w.collectJobId(id)

if w.watcher != nil {
w.watcher.AddModule(dir)
}

return nil
}

Expand Down

0 comments on commit c89b117

Please sign in to comment.