diff --git a/internal/features/tests/tests_feature.go b/internal/features/tests/tests_feature.go index 81e5f2b12..987f77353 100644 --- a/internal/features/tests/tests_feature.go +++ b/internal/features/tests/tests_feature.go @@ -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" ) @@ -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) @@ -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