Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/effecttest-lsp-unmarshal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/tsgo": patch
---

Fix `internal/effecttest` LSP test helpers broken by the `typescript-go` update: the untyped `SendRequestWorker` now returns the response result as a raw `json.Value`, so the inlay hint, diagnostic, and code action helpers decode it via `RequestInfo.UnmarshalResult` instead of type-asserting the typed response struct.
1 change: 1 addition & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVo
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8=
golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio=
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
Expand Down
12 changes: 6 additions & 6 deletions internal/effecttest/autoimport_style_consistency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ func verifyImportFixContentsUnordered(t *testing.T, f *fourslash.FourslashTest,
if !ok {
t.Fatal("diagnostic request failed")
}
diagResult, ok := diagResp.Result.(lsproto.DocumentDiagnosticResponse)
if !ok {
t.Fatal("unexpected diagnostic response type")
diagResult, err := lsproto.TextDocumentDiagnosticInfo.UnmarshalResult(diagResp.Result)
if err != nil {
t.Fatalf("failed to unmarshal diagnostic response: %v", err)
}

var diagnostics []*lsproto.Diagnostic
Expand All @@ -151,9 +151,9 @@ func verifyImportFixContentsUnordered(t *testing.T, f *fourslash.FourslashTest,
if !ok {
t.Fatal("code action request failed")
}
actionResult, ok := actionResp.Result.(lsproto.CodeActionResponse)
if !ok {
t.Fatal("unexpected code action response type")
actionResult, err := lsproto.TextDocumentCodeActionInfo.UnmarshalResult(actionResp.Result)
if err != nil {
t.Fatalf("failed to unmarshal code action response: %v", err)
}

var actual []string
Expand Down
6 changes: 3 additions & 3 deletions internal/effecttest/inlay_hints_baseline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func verifyLocalBaselineInlayHints(t *testing.T, f *fourslash.FourslashTest, tes
t.Fatalf("%s request returned error: %s", lsproto.MethodTextDocumentInlayHint, resp.Error.String())
}

result, ok := resp.Result.(lsproto.InlayHintResponse)
if !ok {
t.Fatalf("Unexpected %s response type: %T", lsproto.MethodTextDocumentInlayHint, resp.Result)
result, err := lsproto.TextDocumentInlayHintInfo.UnmarshalResult(resp.Result)
if err != nil {
t.Fatalf("Failed to unmarshal %s response: %v", lsproto.MethodTextDocumentInlayHint, err)
}

actual := formatInlayHintBaseline(t, fileContent, result)
Expand Down
Loading