From 6567d904c58914d3cac62f5a4724b69d203125c9 Mon Sep 17 00:00:00 2001 From: Mattia Manzati Date: Thu, 4 Jun 2026 08:53:36 +0200 Subject: [PATCH 1/2] chore: update typescript-go --- .changeset/typescript-go-70b87f0.md | 5 +++++ _patches/028-api-effect-diagnostics.patch | 18 +++++++++--------- internal/effecttest/quickfix_baseline.go | 12 +++++++++++- shim/api/shim.go | 22 +++++++++++++++------- shim/lsp/lsproto/shim.go | 13 +++++++++++++ typescript-go | 2 +- 6 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 .changeset/typescript-go-70b87f0.md diff --git a/.changeset/typescript-go-70b87f0.md b/.changeset/typescript-go-70b87f0.md new file mode 100644 index 00000000..ecd0a200 --- /dev/null +++ b/.changeset/typescript-go-70b87f0.md @@ -0,0 +1,5 @@ +--- +"@effect/tsgo": patch +--- + +Update `typescript-go` to commit `70b87f0321dea818af0a648809e2aaf06ec3f6a1` and refresh patches and generated shims for upstream API changes. diff --git a/_patches/028-api-effect-diagnostics.patch b/_patches/028-api-effect-diagnostics.patch index 4976cce0..88e6f856 100644 --- a/_patches/028-api-effect-diagnostics.patch +++ b/_patches/028-api-effect-diagnostics.patch @@ -1,9 +1,9 @@ diff --git a/internal/api/proto.go b/internal/api/proto.go --- a/internal/api/proto.go +++ b/internal/api/proto.go -@@ -6,6 +6,7 @@ import ( - "strconv" - "strings" +@@ -4,6 +4,7 @@ import ( + "errors" + "fmt" + "github.com/effect-ts/tsgo/etscore" "github.com/microsoft/typescript-go/internal/ast" @@ -17,7 +17,7 @@ diff --git a/internal/api/proto.go b/internal/api/proto.go MethodGetSuggestionDiagnostics Method = "getSuggestionDiagnostics" MethodGetDeclarationDiagnostics Method = "getDeclarationDiagnostics" MethodGetConfigFileParsingDiagnostics Method = "getConfigFileParsingDiagnostics" -@@ -389,6 +391,7 @@ var unmarshalers = map[Method]func(json.Value) (any, error){ +@@ -357,6 +359,7 @@ var unmarshalers = map[Method]func([]byte) (any, error){ MethodGetESSymbolType: unmarshallerFor[GetIntrinsicTypeParams], MethodGetSyntacticDiagnostics: unmarshallerFor[GetDiagnosticsParams], MethodGetSemanticDiagnostics: unmarshallerFor[GetDiagnosticsParams], @@ -25,14 +25,14 @@ diff --git a/internal/api/proto.go b/internal/api/proto.go MethodGetSuggestionDiagnostics: unmarshallerFor[GetDiagnosticsParams], MethodGetDeclarationDiagnostics: unmarshallerFor[GetDiagnosticsParams], MethodGetConfigFileParsingDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], -@@ -863,6 +866,15 @@ type GetDiagnosticsParams struct { - File *DocumentIdentifier `json:"file,omitempty"` +@@ -829,6 +832,15 @@ type GetDiagnosticsParams struct { + File *DocumentIdentifier `json:"file,omitempty"` } +// GetEffectDiagnosticsParams are parameters for Effect diagnostic rules. +type GetEffectDiagnosticsParams struct { -+ Snapshot Handle[project.Snapshot] `json:"snapshot"` -+ Project Handle[project.Project] `json:"project"` ++ Snapshot SnapshotID `json:"snapshot"` ++ Project ProjectID `json:"project"` + File DocumentIdentifier `json:"file"` + Options *etscore.EffectPluginOptions `json:"options,omitempty"` + Rules []string `json:"rules,omitempty"` @@ -40,7 +40,7 @@ diff --git a/internal/api/proto.go b/internal/api/proto.go + // GetProjectDiagnosticsParams are parameters for project-wide diagnostic methods. type GetProjectDiagnosticsParams struct { - Snapshot Handle[project.Snapshot] `json:"snapshot"` + Snapshot SnapshotID `json:"snapshot"` diff --git a/internal/api/session.go b/internal/api/session.go --- a/internal/api/session.go +++ b/internal/api/session.go diff --git a/internal/effecttest/quickfix_baseline.go b/internal/effecttest/quickfix_baseline.go index a4d77af0..2c51de40 100644 --- a/internal/effecttest/quickfix_baseline.go +++ b/internal/effecttest/quickfix_baseline.go @@ -51,6 +51,16 @@ func diagnosticCodeString(d *lsproto.Diagnostic) string { return "?" } +func diagnosticMessageString(d *lsproto.Diagnostic) string { + if d.Message.String != nil { + return *d.Message.String + } + if d.Message.MarkupContent != nil { + return d.Message.MarkupContent.Value + } + return "" +} + // generateQuickFixBaseline creates the content for a *.quickfixes.txt baseline file. func generateQuickFixBaseline(inventory []QuickFixInventoryEntry, results []QuickFixApplicationResult) string { var sb strings.Builder @@ -69,7 +79,7 @@ func generateQuickFixBaseline(inventory []QuickFixInventoryEntry, results []Quic entry.Diagnostic.Range.End.Line+1, entry.Diagnostic.Range.End.Character+1, diagnosticCodeString(entry.Diagnostic), - entry.Diagnostic.Message, + diagnosticMessageString(entry.Diagnostic), ) if len(entry.FixTitles) == 0 { sb.WriteString(" (no quick fixes)\n") diff --git a/shim/api/shim.go b/shim/api/shim.go index 93ef0ed8..37d761bb 100644 --- a/shim/api/shim.go +++ b/shim/api/shim.go @@ -60,7 +60,6 @@ type GetTypePropertyParams = api.GetTypePropertyParams type GetTypesAtPositionsParams = api.GetTypesAtPositionsParams type GetTypesOfSymbolsParams = api.GetTypesOfSymbolsParams type GetWidenedTypeParams = api.GetWidenedTypeParams -type Handle[T any] = api.Handle[T] type Handler = api.Handler type IndexInfoResponse = api.IndexInfoResponse type InitializeResponse = api.InitializeResponse @@ -148,7 +147,10 @@ const MethodParseConfigFile = api.MethodParseConfigFile const MethodPrintNode = api.MethodPrintNode const MethodRelease = api.MethodRelease const MethodResolveName = api.MethodResolveName +const MethodSaveHeapProfile = api.MethodSaveHeapProfile const MethodSignatureToSignatureDeclaration = api.MethodSignatureToSignatureDeclaration +const MethodStartCPUProfile = api.MethodStartCPUProfile +const MethodStopCPUProfile = api.MethodStopCPUProfile const MethodTypeToString = api.MethodTypeToString const MethodTypeToTypeNode = api.MethodTypeToTypeNode const MethodUpdateSnapshot = api.MethodUpdateSnapshot @@ -178,14 +180,16 @@ func NewStdioTransport(stdin io.ReadCloser, stdout io.WriteCloser) *api.StdioTra func NewSymbolResponse(symbol *ast.Symbol) *api.SymbolResponse //go:linkname NewSyncConn github.com/microsoft/typescript-go/internal/api.NewSyncConn func NewSyncConn(rwc io.ReadWriteCloser, protocol api.Protocol, handler api.Handler) *api.SyncConn -//go:linkname NodeHandleFrom github.com/microsoft/typescript-go/internal/api.NodeHandleFrom -func NodeHandleFrom(node *ast.Node) api.Handle[ast.Node] +type NodeHandle = api.NodeHandle type ParseConfigFileParams = api.ParseConfigFileParams type PipeTransport = api.PipeTransport type PrintNodeParams = api.PrintNodeParams +type ProfileParams = api.ProfileParams +type ProfileResult = api.ProfileResult type ProjectFileChanges = api.ProjectFileChanges //go:linkname ProjectHandle github.com/microsoft/typescript-go/internal/api.ProjectHandle -func ProjectHandle(p *project.Project) api.Handle[project.Project] +func ProjectHandle(p *project.Project) api.ProjectID +type ProjectID = api.ProjectID type ProjectResponse = api.ProjectResponse type Protocol = api.Protocol type RawBinary = api.RawBinary @@ -196,21 +200,25 @@ type ResolveNameParams = api.ResolveNameParams type Session = api.Session type SessionOptions = api.SessionOptions //go:linkname SignatureHandle github.com/microsoft/typescript-go/internal/api.SignatureHandle -func SignatureHandle(id uint64) api.Handle[checker.Signature] +func SignatureHandle(id uint64) api.SignatureID +type SignatureID = api.SignatureID type SignatureResponse = api.SignatureResponse type SignatureToSignatureDeclarationParams = api.SignatureToSignatureDeclarationParams type SnapshotChanges = api.SnapshotChanges +type SnapshotID = api.SnapshotID type SourceFileResponse = api.SourceFileResponse type StdioServer = api.StdioServer type StdioServerOptions = api.StdioServerOptions type StdioTransport = api.StdioTransport //go:linkname SymbolHandle github.com/microsoft/typescript-go/internal/api.SymbolHandle -func SymbolHandle(symbol *ast.Symbol) api.Handle[ast.Symbol] +func SymbolHandle(symbol *ast.Symbol) api.SymbolID +type SymbolID = api.SymbolID type SymbolResponse = api.SymbolResponse type SyncConn = api.SyncConn type Transport = api.Transport //go:linkname TypeHandle github.com/microsoft/typescript-go/internal/api.TypeHandle -func TypeHandle(t *checker.Type) api.Handle[checker.Type] +func TypeHandle(t *checker.Type) api.TypeID +type TypeID = api.TypeID type TypePredicateResponse = api.TypePredicateResponse type TypeResponse = api.TypeResponse type TypeToTypeNodeParams = api.TypeToTypeNodeParams diff --git a/shim/lsp/lsproto/shim.go b/shim/lsp/lsproto/shim.go index 84b7ca15..ac05e37a 100644 --- a/shim/lsp/lsproto/shim.go +++ b/shim/lsp/lsproto/shim.go @@ -249,6 +249,7 @@ type CustomProjectInfoResponse = lsproto.CustomProjectInfoResponse var CustomRunGCInfo = lsproto.CustomRunGCInfo var CustomSaveAllocProfileInfo = lsproto.CustomSaveAllocProfileInfo var CustomSaveHeapProfileInfo = lsproto.CustomSaveHeapProfileInfo +var CustomSetLogVerbosityInfo = lsproto.CustomSetLogVerbosityInfo var CustomStartCPUProfileInfo = lsproto.CustomStartCPUProfileInfo var CustomStopCPUProfileInfo = lsproto.CustomStopCPUProfileInfo var CustomTextDocumentMultiDocumentHighlightInfo = lsproto.CustomTextDocumentMultiDocumentHighlightInfo @@ -374,6 +375,8 @@ type ExecuteCommandParams = lsproto.ExecuteCommandParams type ExecuteCommandRegistrationOptions = lsproto.ExecuteCommandRegistrationOptions type ExecuteCommandResponse = lsproto.ExecuteCommandResponse var ExitInfo = lsproto.ExitInfo +type ExperimentalClientCapabilities = lsproto.ExperimentalClientCapabilities +type ExperimentalServerCapabilities = lsproto.ExperimentalServerCapabilities type FailureHandlingKind = lsproto.FailureHandlingKind const FailureHandlingKindAbort = lsproto.FailureHandlingKindAbort const FailureHandlingKindTextOnlyTransactional = lsproto.FailureHandlingKindTextOnlyTransactional @@ -577,6 +580,13 @@ type LocationsOrNull = lsproto.LocationsOrNull type LogMessageParams = lsproto.LogMessageParams var LogTraceInfo = lsproto.LogTraceInfo type LogTraceParams = lsproto.LogTraceParams +type LogVerbosity = lsproto.LogVerbosity +const LogVerbosityDebug = lsproto.LogVerbosityDebug +const LogVerbosityError = lsproto.LogVerbosityError +const LogVerbosityInfo = lsproto.LogVerbosityInfo +const LogVerbosityOff = lsproto.LogVerbosityOff +const LogVerbosityTrace = lsproto.LogVerbosityTrace +const LogVerbosityWarning = lsproto.LogVerbosityWarning type MarkdownClientCapabilities = lsproto.MarkdownClientCapabilities type MarkedStringWithLanguage = lsproto.MarkedStringWithLanguage type MarkupContent = lsproto.MarkupContent @@ -607,6 +617,7 @@ const MethodCustomProjectInfo = lsproto.MethodCustomProjectInfo const MethodCustomRunGC = lsproto.MethodCustomRunGC const MethodCustomSaveAllocProfile = lsproto.MethodCustomSaveAllocProfile const MethodCustomSaveHeapProfile = lsproto.MethodCustomSaveHeapProfile +const MethodCustomSetLogVerbosity = lsproto.MethodCustomSetLogVerbosity const MethodCustomStartCPUProfile = lsproto.MethodCustomStartCPUProfile const MethodCustomStopCPUProfile = lsproto.MethodCustomStopCPUProfile const MethodCustomTextDocumentMultiDocumentHighlight = lsproto.MethodCustomTextDocumentMultiDocumentHighlight @@ -824,6 +835,7 @@ type ResolvedDocumentOnTypeFormattingClientCapabilities = lsproto.ResolvedDocume type ResolvedDocumentRangeFormattingClientCapabilities = lsproto.ResolvedDocumentRangeFormattingClientCapabilities type ResolvedDocumentSymbolClientCapabilities = lsproto.ResolvedDocumentSymbolClientCapabilities type ResolvedExecuteCommandClientCapabilities = lsproto.ResolvedExecuteCommandClientCapabilities +type ResolvedExperimentalClientCapabilities = lsproto.ResolvedExperimentalClientCapabilities type ResolvedFileOperationClientCapabilities = lsproto.ResolvedFileOperationClientCapabilities type ResolvedFoldingRangeClientCapabilities = lsproto.ResolvedFoldingRangeClientCapabilities type ResolvedFoldingRangeWorkspaceClientCapabilities = lsproto.ResolvedFoldingRangeWorkspaceClientCapabilities @@ -937,6 +949,7 @@ type SemanticTokensWorkspaceClientCapabilities = lsproto.SemanticTokensWorkspace type ServerCapabilities = lsproto.ServerCapabilities type ServerCompletionItemOptions = lsproto.ServerCompletionItemOptions type ServerInfo = lsproto.ServerInfo +type SetLogVerbosityParams = lsproto.SetLogVerbosityParams var SetTraceInfo = lsproto.SetTraceInfo type SetTraceParams = lsproto.SetTraceParams type ShowDocumentClientCapabilities = lsproto.ShowDocumentClientCapabilities diff --git a/typescript-go b/typescript-go index 40f6707e..70b87f03 160000 --- a/typescript-go +++ b/typescript-go @@ -1 +1 @@ -Subproject commit 40f6707e0ae5474907c77bf25ec83c171a55df90 +Subproject commit 70b87f0321dea818af0a648809e2aaf06ec3f6a1 From 79a7dafd325ac9f4f106a45d2c90435fdc65c5e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 06:59:18 +0000 Subject: [PATCH 2/2] Refresh flake vendor hash --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index d8e6f898..1786e595 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ /* Source of truth: git submodule `typescript-go` commit. Keep in sync via `_tools/update-flake-vendor-hash.sh`. */ typescript-go-src = { - url = "github:microsoft/typescript-go/40f6707e0ae5474907c77bf25ec83c171a55df90?submodules=1"; + url = "github:microsoft/typescript-go/70b87f0321dea818af0a648809e2aaf06ec3f6a1?submodules=1"; flake = false; }; /* Source of truth: typescript-go's `_submodules/TypeScript` commit.