diff --git a/.changeset/update-tsgo-f3911d25.md b/.changeset/update-tsgo-f3911d25.md new file mode 100644 index 00000000..96065ad7 --- /dev/null +++ b/.changeset/update-tsgo-f3911d25.md @@ -0,0 +1,5 @@ +--- +"@effect/tsgo": patch +--- + +Update the pinned `typescript-go` submodule to `f3911d25a18e746c1d8ec68b175350c2b333da6d` and rebase local patch files so setup and validation continue to pass. diff --git a/_patches/010-fourslash-fourslash.patch b/_patches/010-fourslash-fourslash.patch index cc4644d7..fc9badab 100644 --- a/_patches/010-fourslash-fourslash.patch +++ b/_patches/010-fourslash-fourslash.patch @@ -1,5 +1,5 @@ diff --git a/internal/fourslash/fourslash.go b/internal/fourslash/fourslash.go -index b8575b1933..022443c14d 100644 +index d1087aabdf..803535aedc 100644 --- a/internal/fourslash/fourslash.go +++ b/internal/fourslash/fourslash.go @@ -41,6 +41,16 @@ import ( @@ -19,7 +19,7 @@ index b8575b1933..022443c14d 100644 type FourslashTest struct { client *lsptestutil.LSPClient vfs vfs.FS -@@ -149,6 +159,11 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten +@@ -155,6 +165,11 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten testfs[filePath] = vfstest.Symlink(tspath.GetNormalizedAbsolutePath(target, rootDir)) } @@ -31,10 +31,10 @@ index b8575b1933..022443c14d 100644 // !!! use default compiler options for inferred project as base compilerOptions := &core.CompilerOptions{ SkipDefaultLibCheck: core.TSTrue, -@@ -4319,3 +4334,379 @@ func (f *FourslashTest) VerifyErrorExistsBeforeMarker(t *testing.T, markerName s - } +@@ -5586,6 +5601,383 @@ func (f *FourslashTest) VerifyErrorExistsBeforeMarker(t *testing.T, markerName s t.Fatalf("Expected error before marker '%s' but none was found", markerName) } + + +// QuickFixInfo holds a diagnostic and the titles of its available quick fixes. +type QuickFixInfo struct { @@ -411,3 +411,7 @@ index b8575b1933..022443c14d 100644 + + return result +} ++ + func updatePositionForTextEdit(position int, editStart int, editEnd int, newTextLength int) int { + if position <= editStart { + return position diff --git a/_patches/025-tsoptions-diagnostic-scopes.patch b/_patches/025-tsoptions-diagnostic-scopes.patch index 212df650..df6a4834 100644 --- a/_patches/025-tsoptions-diagnostic-scopes.patch +++ b/_patches/025-tsoptions-diagnostic-scopes.patch @@ -1,8 +1,8 @@ diff --git a/internal/tsoptions/tsconfigparsing.go b/internal/tsoptions/tsconfigparsing.go -index 15118ae27..5e282dfd7 100644 +index b2d3d4093a..e1ba3214c4 100644 --- a/internal/tsoptions/tsconfigparsing.go +++ b/internal/tsoptions/tsconfigparsing.go -@@ -1087,7 +1087,7 @@ func parseConfig( +@@ -1108,7 +1108,7 @@ func parseConfig( result.compileOnSave = compileOnSave } } @@ -11,7 +11,7 @@ index 15118ae27..5e282dfd7 100644 } } -@@ -1121,7 +1121,7 @@ func parseConfig( +@@ -1142,7 +1142,7 @@ func parseConfig( sourceFile.ExtendedSourceFiles = core.InsertSorted(sourceFile.ExtendedSourceFiles, extendedSourceFile, cmp.Compare) } } @@ -20,10 +20,10 @@ index 15118ae27..5e282dfd7 100644 // ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? // assignWatchOptions(result, ownConfig.watchOptions) : // ownConfig.watchOptions || result.watchOptions; -@@ -1166,7 +1166,7 @@ func parseJsonConfigFileContentWorker( +@@ -1186,7 +1186,7 @@ func parseJsonConfigFileContentWorker( + var errors []*ast.Diagnostic - resolutionStackString := []string{} - parsedConfig, errors := parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStackString, extendedConfigCache) + parsedConfig, errors := parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, extendedConfigCache) - mergeCompilerOptions(parsedConfig.options, existingOptions, existingOptionsRaw) + mergeCompilerOptions(parsedConfig.options, existingOptions, existingOptionsRaw, configFileName, basePath) handleOptionConfigDirTemplateSubstitution(parsedConfig.options, basePathForFileNames) diff --git a/flake.nix b/flake.nix index a8020655..b540086d 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/c282336ea94f8a2e63187afd0f8d4bfb3b3f4d3b?submodules=1"; + url = "github:microsoft/typescript-go/f3911d25a18e746c1d8ec68b175350c2b333da6d?submodules=1"; flake = false; }; /* Source of truth: typescript-go's `_submodules/TypeScript` commit. diff --git a/shim/checker/shim.go b/shim/checker/shim.go index f651b4b7..cd36a65a 100644 --- a/shim/checker/shim.go +++ b/shim/checker/shim.go @@ -535,8 +535,12 @@ func FormatTypeFlags(flags checker.TypeFlags) []string type FunctionTypeMapper = checker.FunctionTypeMapper //go:linkname GetDeclarationModifierFlagsFromSymbol github.com/microsoft/typescript-go/internal/checker.GetDeclarationModifierFlagsFromSymbol func GetDeclarationModifierFlagsFromSymbol(s *ast.Symbol) ast.ModifierFlags +//go:linkname GetPropertyNameFromType github.com/microsoft/typescript-go/internal/checker.GetPropertyNameFromType +func GetPropertyNameFromType(t *checker.Type) string //go:linkname GetResolvedSignatureForSignatureHelp github.com/microsoft/typescript-go/internal/checker.GetResolvedSignatureForSignatureHelp func GetResolvedSignatureForSignatureHelp(node *ast.Node, argumentCount int, c *checker.Checker) (*checker.Signature, []*checker.Signature) +//go:linkname GetSetAccessorValueParameter github.com/microsoft/typescript-go/internal/checker.GetSetAccessorValueParameter +func GetSetAccessorValueParameter(accessor *ast.Node) *ast.Node //go:linkname GetSingleVariableOfVariableStatement github.com/microsoft/typescript-go/internal/checker.GetSingleVariableOfVariableStatement func GetSingleVariableOfVariableStatement(node *ast.Node) *ast.Node type Host = checker.Host @@ -623,6 +627,8 @@ func IsPrivateIdentifierSymbol(symbol *ast.Symbol) bool func IsTupleType(t *checker.Type) bool //go:linkname IsTypeAny github.com/microsoft/typescript-go/internal/checker.IsTypeAny func IsTypeAny(t *checker.Type) bool +//go:linkname IsTypeUsableAsPropertyName github.com/microsoft/typescript-go/internal/checker.IsTypeUsableAsPropertyName +func IsTypeUsableAsPropertyName(t *checker.Type) bool type IterationTypeKind = checker.IterationTypeKind const IterationTypeKindNext = checker.IterationTypeKindNext const IterationTypeKindReturn = checker.IterationTypeKindReturn diff --git a/shim/ls/shim.go b/shim/ls/shim.go index 02402ee7..f10a1ea7 100644 --- a/shim/ls/shim.go +++ b/shim/ls/shim.go @@ -58,6 +58,7 @@ const ExportKindExportEquals = ls.ExportKindExportEquals const ExportKindModule = ls.ExportKindModule const ExportKindNamed = ls.ExportKindNamed const ExportKindUMD = ls.ExportKindUMD +var FixClassIncorrectlyImplementsInterfaceProvider = ls.FixClassIncorrectlyImplementsInterfaceProvider type Host = ls.Host type ImpExpKind = ls.ImpExpKind const ImpExpKindExport = ls.ImpExpKindExport diff --git a/shim/lsp/lsproto/shim.go b/shim/lsp/lsproto/shim.go index 5583d63b..5fc758ee 100644 --- a/shim/lsp/lsproto/shim.go +++ b/shim/lsp/lsproto/shim.go @@ -79,6 +79,28 @@ type CancelParams = lsproto.CancelParams var CancelRequestInfo = lsproto.CancelRequestInfo type ChangeAnnotation = lsproto.ChangeAnnotation type ChangeAnnotationsSupportOptions = lsproto.ChangeAnnotationsSupportOptions +type ClassificationTypeName = lsproto.ClassificationTypeName +const ClassificationTypeNameClassName = lsproto.ClassificationTypeNameClassName +const ClassificationTypeNameComment = lsproto.ClassificationTypeNameComment +const ClassificationTypeNameEnumName = lsproto.ClassificationTypeNameEnumName +const ClassificationTypeNameFieldName = lsproto.ClassificationTypeNameFieldName +const ClassificationTypeNameIdentifier = lsproto.ClassificationTypeNameIdentifier +const ClassificationTypeNameInterfaceName = lsproto.ClassificationTypeNameInterfaceName +const ClassificationTypeNameKeyword = lsproto.ClassificationTypeNameKeyword +const ClassificationTypeNameLocalName = lsproto.ClassificationTypeNameLocalName +const ClassificationTypeNameMethodName = lsproto.ClassificationTypeNameMethodName +const ClassificationTypeNameModuleName = lsproto.ClassificationTypeNameModuleName +const ClassificationTypeNameNumber = lsproto.ClassificationTypeNameNumber +const ClassificationTypeNameOperator = lsproto.ClassificationTypeNameOperator +const ClassificationTypeNameParameterName = lsproto.ClassificationTypeNameParameterName +const ClassificationTypeNamePropertyName = lsproto.ClassificationTypeNamePropertyName +const ClassificationTypeNamePunctuation = lsproto.ClassificationTypeNamePunctuation +const ClassificationTypeNameString = lsproto.ClassificationTypeNameString +const ClassificationTypeNameText = lsproto.ClassificationTypeNameText +const ClassificationTypeNameTypeParameterName = lsproto.ClassificationTypeNameTypeParameterName +const ClassificationTypeNameWhiteSpace = lsproto.ClassificationTypeNameWhiteSpace +type ClassifiedTextElement = lsproto.ClassifiedTextElement +type ClassifiedTextRun = lsproto.ClassifiedTextRun type ClientCapabilities = lsproto.ClientCapabilities type ClientCodeActionKindOptions = lsproto.ClientCodeActionKindOptions type ClientCodeActionLiteralOptions = lsproto.ClientCodeActionLiteralOptions diff --git a/shim/project/shim.go b/shim/project/shim.go index 63a7a84c..a9a62ea4 100644 --- a/shim/project/shim.go +++ b/shim/project/shim.go @@ -85,6 +85,7 @@ type TestConfigEntry = project.TestConfigEntry type TestConfigFileNamesEntry = project.TestConfigFileNamesEntry type UpdateReason = project.UpdateReason const UpdateReasonDidChangeCompilerOptionsForInferredProjects = project.UpdateReasonDidChangeCompilerOptionsForInferredProjects +const UpdateReasonDidCloseFile = project.UpdateReasonDidCloseFile const UpdateReasonDidOpenFile = project.UpdateReasonDidOpenFile const UpdateReasonIdleCleanDiskCache = project.UpdateReasonIdleCleanDiskCache const UpdateReasonRequestedLanguageServiceForFileNotOpen = project.UpdateReasonRequestedLanguageServiceForFileNotOpen diff --git a/shim/tsoptions/shim.go b/shim/tsoptions/shim.go index d7b73983..961ef02b 100644 --- a/shim/tsoptions/shim.go +++ b/shim/tsoptions/shim.go @@ -96,7 +96,7 @@ func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOption func ParseConfigFileTextToJson(fileName string, path tspath.Path, jsonText string) (any, []*ast.Diagnostic) type ParseConfigHost = tsoptions.ParseConfigHost //go:linkname ParseExtendedConfig github.com/microsoft/typescript-go/internal/tsoptions.ParseExtendedConfig -func ParseExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host tsoptions.ParseConfigHost, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ExtendedConfigCacheEntry +func ParseExtendedConfig(fileName string, path tspath.Path, resolutionStack []tspath.Path, host tsoptions.ParseConfigHost, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ExtendedConfigCacheEntry //go:linkname ParseJsonConfigFileContent github.com/microsoft/typescript-go/internal/tsoptions.ParseJsonConfigFileContent func ParseJsonConfigFileContent(json any, host tsoptions.ParseConfigHost, basePath string, existingOptions *core.CompilerOptions, configFileName string, resolutionStack []tspath.Path, extraFileExtensions []tsoptions.FileExtensionInfo, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ParsedCommandLine //go:linkname ParseJsonSourceFileConfigFileContent github.com/microsoft/typescript-go/internal/tsoptions.ParseJsonSourceFileConfigFileContent diff --git a/typescript-go b/typescript-go index c282336e..f3911d25 160000 --- a/typescript-go +++ b/typescript-go @@ -1 +1 @@ -Subproject commit c282336ea94f8a2e63187afd0f8d4bfb3b3f4d3b +Subproject commit f3911d25a18e746c1d8ec68b175350c2b333da6d