diff --git a/internal/langserver/handlers/workspace_symbol_test.go b/internal/langserver/handlers/workspace_symbol_test.go index 2b654ede..2373a572 100644 --- a/internal/langserver/handlers/workspace_symbol_test.go +++ b/internal/langserver/handlers/workspace_symbol_test.go @@ -5,6 +5,8 @@ package handlers import ( "fmt" + "os" + "path/filepath" "testing" "github.com/hashicorp/terraform-ls/internal/langserver" @@ -18,6 +20,15 @@ func TestLangServer_workspace_symbol_basic(t *testing.T) { tmpDir := TempDir(t) InitPluginCache(t, tmpDir.Path()) + err := os.WriteFile(filepath.Join(tmpDir.Path(), "first.tf"), []byte("provider \"github\" {}\n"), 0o755) + if err != nil { + t.Fatal(err) + } + err = os.WriteFile(filepath.Join(tmpDir.Path(), "second.tf"), []byte("provider \"google\" {}\n"), 0o755) + if err != nil { + t.Fatal(err) + } + ss, err := state.NewStateStore() if err != nil { t.Fatal(err) @@ -166,6 +177,15 @@ func TestLangServer_workspace_symbol_missing(t *testing.T) { tmpDir := TempDir(t) InitPluginCache(t, tmpDir.Path()) + err := os.WriteFile(filepath.Join(tmpDir.Path(), "first.tf"), []byte("provider \"github\" {}\n"), 0o755) + if err != nil { + t.Fatal(err) + } + err = os.WriteFile(filepath.Join(tmpDir.Path(), "second.tf"), []byte("provider \"google\" {}\n"), 0o755) + if err != nil { + t.Fatal(err) + } + ss, err := state.NewStateStore() if err != nil { t.Fatal(err)