Skip to content

Commit

Permalink
fix: update test feature channels to match refactored interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Sep 23, 2024
1 parent 44ab633 commit 95665f8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions internal/features/tests/tests_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/hashicorp/terraform-ls/internal/features/modules/jobs"
testDecoder "github.com/hashicorp/terraform-ls/internal/features/tests/decoder"
"github.com/hashicorp/terraform-ls/internal/features/tests/state"
"github.com/hashicorp/terraform-ls/internal/job"
"github.com/hashicorp/terraform-ls/internal/langserver/diagnostics"
globalState "github.com/hashicorp/terraform-ls/internal/state"
)
Expand Down Expand Up @@ -61,9 +62,9 @@ func (f *TestsFeature) Start(ctx context.Context) {

topic := "feature.tests"

didOpenDone := make(chan struct{}, 10)
didChangeDone := make(chan struct{}, 10)
didChangeWatchedDone := make(chan struct{}, 10)
didOpenDone := make(chan job.IDs, 10)
didChangeDone := make(chan job.IDs, 10)
didChangeWatchedDone := make(chan job.IDs, 10)

discover := f.bus.OnDiscover(topic, nil)
didOpen := f.bus.OnDidOpen(topic, didOpenDone)
Expand All @@ -78,16 +79,16 @@ func (f *TestsFeature) Start(ctx context.Context) {
f.discover(discover.Path, discover.Files)
case didOpen := <-didOpen:
// TODO? collect errors
f.didOpen(didOpen.Context, didOpen.Dir, didOpen.LanguageID)
didOpenDone <- struct{}{}
spawnedIds, _ := f.didOpen(didOpen.Context, didOpen.Dir, didOpen.LanguageID)
didOpenDone <- spawnedIds
case didChange := <-didChange:
// TODO? collect errors
f.didChange(didChange.Context, didChange.Dir)
didChangeDone <- struct{}{}
spawnedIds, _ := f.didChange(didChange.Context, didChange.Dir)
didChangeDone <- spawnedIds
case didChangeWatched := <-didChangeWatched:
// TODO? collect errors
f.didChangeWatched(didChangeWatched.Context, didChangeWatched.RawPath, didChangeWatched.ChangeType, didChangeWatched.IsDir)
didChangeWatchedDone <- struct{}{}
spawnedIds, _ := f.didChangeWatched(didChangeWatched.Context, didChangeWatched.RawPath, didChangeWatched.ChangeType, didChangeWatched.IsDir)
didChangeWatchedDone <- spawnedIds

case <-ctx.Done():
return
Expand Down

0 comments on commit 95665f8

Please sign in to comment.