diff --git a/microsoft/typescript-go b/microsoft/typescript-go index 63b00de50..bd7c18dc8 160000 --- a/microsoft/typescript-go +++ b/microsoft/typescript-go @@ -1 +1 @@ -Subproject commit 63b00de5083cdfffdb77df46341a8d30bd9c3b67 +Subproject commit bd7c18dc8ed3c5ed960d72f1e329353f0a594bcc diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index ab57bc322..601af3db1 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -10983,7 +10983,7 @@ func (node *SourceFile) computeDeclarationMap() map[string][]*Node { result := make(map[string][]*Node) addDeclaration := func(declaration *Node) { - name := getDeclarationName(declaration) + name := GetDeclarationName(declaration) if name != "" { result[name] = append(result[name], declaration) } @@ -10993,7 +10993,7 @@ func (node *SourceFile) computeDeclarationMap() map[string][]*Node { visit = func(node *Node) bool { switch node.Kind { case KindFunctionDeclaration, KindFunctionExpression, KindMethodDeclaration, KindMethodSignature: - declarationName := getDeclarationName(node) + declarationName := GetDeclarationName(node) if declarationName != "" { declarations := result[declarationName] var lastDeclaration *Node @@ -11025,7 +11025,7 @@ func (node *SourceFile) computeDeclarationMap() map[string][]*Node { break } fallthrough - case KindVariableDeclaration, KindBindingElement: + case KindVariableDeclaration, KindBindingElement, KindCommonJSExport: name := node.Name() if name != nil { if IsBindingPattern(name) { @@ -11074,6 +11074,12 @@ func (node *SourceFile) computeDeclarationMap() map[string][]*Node { } } } + case KindBinaryExpression: + switch GetAssignmentDeclarationKind(node.AsBinaryExpression()) { + case JSDeclarationKindThisProperty, JSDeclarationKindProperty: + addDeclaration(node) + } + node.ForEachChild(visit) default: node.ForEachChild(visit) } @@ -11083,7 +11089,7 @@ func (node *SourceFile) computeDeclarationMap() map[string][]*Node { return result } -func getDeclarationName(declaration *Node) string { +func GetDeclarationName(declaration *Node) string { name := GetNonAssignedNameOfDeclaration(declaration) if name != nil { if IsComputedPropertyName(name) { diff --git a/pkg/ast/diagnostic.go b/pkg/ast/diagnostic.go index d5c77c12f..b3e8a7cfc 100644 --- a/pkg/ast/diagnostic.go +++ b/pkg/ast/diagnostic.go @@ -7,16 +7,20 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" ) // Diagnostic type Diagnostic struct { - file *SourceFile - loc core.TextRange - code int32 - category diagnostics.Category - message string + file *SourceFile + loc core.TextRange + code int32 + category diagnostics.Category + // Original message; may be nil. + message *diagnostics.Message + messageKey diagnostics.Key + messageArgs []string messageChain []*Diagnostic relatedInformation []*Diagnostic reportsUnnecessary bool @@ -31,7 +35,8 @@ func (d *Diagnostic) Len() int { return d.loc.Len() } func (d *Diagnostic) Loc() core.TextRange { return d.loc } func (d *Diagnostic) Code() int32 { return d.code } func (d *Diagnostic) Category() diagnostics.Category { return d.category } -func (d *Diagnostic) Message() string { return d.message } +func (d *Diagnostic) MessageKey() diagnostics.Key { return d.messageKey } +func (d *Diagnostic) MessageArgs() []string { return d.messageArgs } func (d *Diagnostic) MessageChain() []*Diagnostic { return d.messageChain } func (d *Diagnostic) RelatedInformation() []*Diagnostic { return d.relatedInformation } func (d *Diagnostic) ReportsUnnecessary() bool { return d.reportsUnnecessary } @@ -72,12 +77,22 @@ func (d *Diagnostic) Clone() *Diagnostic { return &result } -func NewDiagnosticWith( +func (d *Diagnostic) Localize(locale locale.Locale) string { + return diagnostics.Localize(locale, d.message, d.messageKey, d.messageArgs...) +} + +// For debugging only. +func (d *Diagnostic) String() string { + return diagnostics.Localize(locale.Default, d.message, d.messageKey, d.messageArgs...) +} + +func NewDiagnosticFromSerialized( file *SourceFile, loc core.TextRange, code int32, category diagnostics.Category, - message string, + messageKey diagnostics.Key, + messageArgs []string, messageChain []*Diagnostic, relatedInformation []*Diagnostic, reportsUnnecessary bool, @@ -89,7 +104,8 @@ func NewDiagnosticWith( loc: loc, code: code, category: category, - message: message, + messageKey: messageKey, + messageArgs: messageArgs, messageChain: messageChain, relatedInformation: relatedInformation, reportsUnnecessary: reportsUnnecessary, @@ -104,7 +120,9 @@ func NewDiagnostic(file *SourceFile, loc core.TextRange, message *diagnostics.Me loc: loc, code: message.Code(), category: message.Category(), - message: message.Format(args...), + message: message, + messageKey: message.Key(), + messageArgs: diagnostics.StringifyArgs(args), reportsUnnecessary: message.ReportsUnnecessary(), reportsDeprecated: message.ReportsDeprecated(), } @@ -185,13 +203,13 @@ func EqualDiagnosticsNoRelatedInfo(d1, d2 *Diagnostic) bool { return getDiagnosticPath(d1) == getDiagnosticPath(d2) && d1.Loc() == d2.Loc() && d1.Code() == d2.Code() && - d1.Message() == d2.Message() && + slices.Equal(d1.MessageArgs(), d2.MessageArgs()) && slices.EqualFunc(d1.MessageChain(), d2.MessageChain(), equalMessageChain) } func equalMessageChain(c1, c2 *Diagnostic) bool { return c1.Code() == c2.Code() && - c1.Message() == c2.Message() && + slices.Equal(c1.MessageArgs(), c2.MessageArgs()) && slices.EqualFunc(c1.MessageChain(), c2.MessageChain(), equalMessageChain) } @@ -211,7 +229,7 @@ func compareMessageChainSize(c1, c2 []*Diagnostic) int { func compareMessageChainContent(c1, c2 []*Diagnostic) int { for i := range c1 { - c := strings.Compare(c1[i].Message(), c2[i].Message()) + c := slices.Compare(c1[i].MessageArgs(), c2[i].MessageArgs()) if c != 0 { return c } @@ -256,7 +274,7 @@ func CompareDiagnostics(d1, d2 *Diagnostic) int { if c != 0 { return c } - c = strings.Compare(d1.Message(), d2.Message()) + c = slices.Compare(d1.MessageArgs(), d2.MessageArgs()) if c != 0 { return c } diff --git a/pkg/bundled/generate.go b/pkg/bundled/generate.go index 7bbb2ed57..da2a524ec 100644 --- a/pkg/bundled/generate.go +++ b/pkg/bundled/generate.go @@ -14,6 +14,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/repo" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -150,7 +151,7 @@ func readLibs() []lib { if len(diags) > 0 { for _, diag := range diags { - log.Printf("%s", diag.Message()) + log.Printf("%s", diag.Localize(locale.Default)) } log.Fatalf("failed to parse libs.json") } diff --git a/pkg/checker/jsx.go b/pkg/checker/jsx.go index 35b3123fc..e2ff5135a 100644 --- a/pkg/checker/jsx.go +++ b/pkg/checker/jsx.go @@ -297,7 +297,7 @@ func (c *Checker) elaborateJsxComponents(node *ast.Node, source *Type, target *T if !ast.IsJsxSpreadAttribute(prop) && !isHyphenatedJsxName(prop.Name().Text()) { nameType := c.getStringLiteralType(prop.Name().Text()) if nameType != nil && nameType.flags&TypeFlagsNever == 0 { - reportedError = c.elaborateElement(source, target, relation, prop.Name(), prop.Initializer(), nameType, nil, diagnosticOutput) || reportedError + reportedError = c.elaborateElement(source, target, relation, prop.Name(), prop.Initializer(), nameType, nil, nil, diagnosticOutput) || reportedError } } } @@ -326,13 +326,14 @@ func (c *Checker) elaborateJsxComponents(node *ast.Node, source *Type, target *T nonArrayLikeTargetParts = c.filterType(childrenTargetType, func(t *Type) bool { return !c.isArrayOrTupleLikeType(t) }) } var invalidTextDiagnostic *diagnostics.Message - getInvalidTextualChildDiagnostic := func() *diagnostics.Message { + var invalidTextDiagnosticArgs []any + getInvalidTextualChildDiagnostic := func() (*diagnostics.Message, []any) { if invalidTextDiagnostic == nil { tagNameText := scanner.GetTextOfNode(node.Parent.TagName()) - diagnostic := diagnostics.X_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2 - invalidTextDiagnostic = diagnostics.FormatMessage(diagnostic, tagNameText, childrenPropName, c.TypeToString(childrenTargetType)) + invalidTextDiagnostic = diagnostics.X_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2 + invalidTextDiagnosticArgs = []any{tagNameText, childrenPropName, c.TypeToString(childrenTargetType)} } - return invalidTextDiagnostic + return invalidTextDiagnostic, invalidTextDiagnosticArgs } if moreThanOneRealChildren { if arrayLikeTargetParts != c.neverType { @@ -350,7 +351,7 @@ func (c *Checker) elaborateJsxComponents(node *ast.Node, source *Type, target *T child := validChildren[0] e := c.getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic) if e.errorNode != nil { - reportedError = c.elaborateElement(source, target, relation, e.errorNode, e.innerExpression, e.nameType, e.errorMessage, diagnosticOutput) || reportedError + reportedError = c.elaborateElement(source, target, relation, e.errorNode, e.innerExpression, e.nameType, nil, e.createDiagnostic, diagnosticOutput) || reportedError } } else if !c.isTypeRelatedTo(c.getIndexedAccessType(source, childrenNameType), childrenTargetType, relation) { // arity mismatch @@ -364,13 +365,13 @@ func (c *Checker) elaborateJsxComponents(node *ast.Node, source *Type, target *T } type JsxElaborationElement struct { - errorNode *ast.Node - innerExpression *ast.Node - nameType *Type - errorMessage *diagnostics.Message + errorNode *ast.Node + innerExpression *ast.Node + nameType *Type + createDiagnostic func(prop *ast.Node) *ast.Diagnostic // Optional: creates a custom diagnostic for this element } -func (c *Checker) generateJsxChildren(node *ast.Node, getInvalidTextDiagnostic func() *diagnostics.Message) iter.Seq[JsxElaborationElement] { +func (c *Checker) generateJsxChildren(node *ast.Node, getInvalidTextDiagnostic func() (*diagnostics.Message, []any)) iter.Seq[JsxElaborationElement] { return func(yield func(JsxElaborationElement) bool) { memberOffset := 0 for i, child := range node.Children().Nodes { @@ -387,7 +388,7 @@ func (c *Checker) generateJsxChildren(node *ast.Node, getInvalidTextDiagnostic f } } -func (c *Checker) getElaborationElementForJsxChild(child *ast.Node, nameType *Type, getInvalidTextDiagnostic func() *diagnostics.Message) JsxElaborationElement { +func (c *Checker) getElaborationElementForJsxChild(child *ast.Node, nameType *Type, getInvalidTextDiagnostic func() (*diagnostics.Message, []any)) JsxElaborationElement { switch child.Kind { case ast.KindJsxExpression: // child is of the type of the expression @@ -398,7 +399,15 @@ func (c *Checker) getElaborationElementForJsxChild(child *ast.Node, nameType *Ty return JsxElaborationElement{} } // child is a string - return JsxElaborationElement{errorNode: child, innerExpression: nil, nameType: nameType, errorMessage: getInvalidTextDiagnostic()} + return JsxElaborationElement{ + errorNode: child, + innerExpression: nil, + nameType: nameType, + createDiagnostic: func(prop *ast.Node) *ast.Diagnostic { + errorMessage, errorArgs := getInvalidTextDiagnostic() + return NewDiagnosticForNode(prop, errorMessage, errorArgs...) + }, + } case ast.KindJsxElement, ast.KindJsxSelfClosingElement, ast.KindJsxFragment: // child is of type JSX.Element return JsxElaborationElement{errorNode: child, innerExpression: child, nameType: nameType} @@ -448,7 +457,10 @@ func (c *Checker) elaborateIterableOrArrayLikeTargetElementwise(iterator iter.Se if next != nil { specificSource = c.checkExpressionForMutableLocationWithContextualType(next, sourcePropType) } - if c.exactOptionalPropertyTypes && c.isExactOptionalPropertyMismatch(specificSource, targetPropType) { + if e.createDiagnostic != nil { + // Use the custom diagnostic factory if provided (e.g., for JSX text children with dynamic error messages) + c.reportDiagnostic(e.createDiagnostic(prop), diagnosticOutput) + } else if c.exactOptionalPropertyTypes && c.isExactOptionalPropertyMismatch(specificSource, targetPropType) { diag := createDiagnosticForNode(prop, diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, c.TypeToString(specificSource), c.TypeToString(targetPropType)) c.reportDiagnostic(diag, diagnosticOutput) } else { @@ -456,10 +468,10 @@ func (c *Checker) elaborateIterableOrArrayLikeTargetElementwise(iterator iter.Se sourceIsOptional := propName != ast.InternalSymbolNameMissing && core.OrElse(c.getPropertyOfType(source, propName), c.unknownSymbol).Flags&ast.SymbolFlagsOptional != 0 targetPropType = c.removeMissingType(targetPropType, targetIsOptional) sourcePropType = c.removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional) - result := c.checkTypeRelatedToEx(specificSource, targetPropType, relation, prop, e.errorMessage, diagnosticOutput) + result := c.checkTypeRelatedToEx(specificSource, targetPropType, relation, prop, nil, diagnosticOutput) if result && specificSource != sourcePropType { // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType - c.checkTypeRelatedToEx(sourcePropType, targetPropType, relation, prop, e.errorMessage, diagnosticOutput) + c.checkTypeRelatedToEx(sourcePropType, targetPropType, relation, prop, nil, diagnosticOutput) } } } diff --git a/pkg/checker/relater.go b/pkg/checker/relater.go index 5e07e1407..e4748ea83 100644 --- a/pkg/checker/relater.go +++ b/pkg/checker/relater.go @@ -503,10 +503,10 @@ func (c *Checker) elaborateObjectLiteral(node *ast.Node, source *Type, target *T } switch prop.Kind { case ast.KindSetAccessor, ast.KindGetAccessor, ast.KindMethodDeclaration, ast.KindShorthandPropertyAssignment: - reportedError = c.elaborateElement(source, target, relation, prop.Name(), nil, nameType, nil, diagnosticOutput) || reportedError + reportedError = c.elaborateElement(source, target, relation, prop.Name(), nil, nameType, nil, nil, diagnosticOutput) || reportedError case ast.KindPropertyAssignment: message := core.IfElse(ast.IsComputedNonLiteralName(prop.Name()), diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1, nil) - reportedError = c.elaborateElement(source, target, relation, prop.Name(), prop.Initializer(), nameType, message, diagnosticOutput) || reportedError + reportedError = c.elaborateElement(source, target, relation, prop.Name(), prop.Initializer(), nameType, message, nil, diagnosticOutput) || reportedError } } return reportedError @@ -531,12 +531,12 @@ func (c *Checker) elaborateArrayLiteral(node *ast.Node, source *Type, target *Ty } nameType := c.getNumberLiteralType(jsnum.Number(i)) checkNode := c.getEffectiveCheckNode(element) - reportedError = c.elaborateElement(source, target, relation, checkNode, checkNode, nameType, nil, diagnosticOutput) || reportedError + reportedError = c.elaborateElement(source, target, relation, checkNode, checkNode, nameType, nil, nil, diagnosticOutput) || reportedError } return reportedError } -func (c *Checker) elaborateElement(source *Type, target *Type, relation *Relation, prop *ast.Node, next *ast.Node, nameType *Type, errorMessage *diagnostics.Message, diagnosticOutput *[]*ast.Diagnostic) bool { +func (c *Checker) elaborateElement(source *Type, target *Type, relation *Relation, prop *ast.Node, next *ast.Node, nameType *Type, errorMessage *diagnostics.Message, diagnosticFactory func(prop *ast.Node) *ast.Diagnostic, diagnosticOutput *[]*ast.Diagnostic) bool { targetPropType := c.getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType) if targetPropType == nil || targetPropType.flags&TypeFlagsIndexedAccess != 0 { // Don't elaborate on indexes on generic variables @@ -557,7 +557,10 @@ func (c *Checker) elaborateElement(source *Type, target *Type, relation *Relatio if next != nil { specificSource = c.checkExpressionForMutableLocationWithContextualType(next, sourcePropType) } - if c.exactOptionalPropertyTypes && c.isExactOptionalPropertyMismatch(specificSource, targetPropType) { + if diagnosticFactory != nil { + // Use the custom diagnostic factory if provided (e.g., for JSX text children with dynamic error messages) + diags = append(diags, diagnosticFactory(prop)) + } else if c.exactOptionalPropertyTypes && c.isExactOptionalPropertyMismatch(specificSource, targetPropType) { diags = append(diags, createDiagnosticForNode(prop, diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, c.TypeToString(specificSource), c.TypeToString(targetPropType))) } else { propName := c.getPropertyNameFromIndex(nameType, nil /*accessNode*/) diff --git a/pkg/compiler/fileloader.go b/pkg/compiler/fileloader.go index 94a062967..870b42c08 100644 --- a/pkg/compiler/fileloader.go +++ b/pkg/compiler/fileloader.go @@ -18,7 +18,7 @@ import ( type libResolution struct { libraryName string resolution *module.ResolvedModule - trace []string + trace []module.DiagAndArgs } type LibFile struct { @@ -231,7 +231,7 @@ func processAllProgramFiles( module.ModeAwareCacheKey{Name: value.libraryName, Mode: core.ModuleKindCommonJS}: value.resolution, } for _, trace := range value.trace { - opts.Host.Trace(trace) + opts.Host.Trace(trace.Message, trace.Args...) } } @@ -286,7 +286,7 @@ func (p *fileLoader) addAutomaticTypeDirectiveTasks() { func (p *fileLoader) resolveAutomaticTypeDirectives(containingFileName string) ( toParse []resolvedRef, typeResolutionsInFile module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], - typeResolutionsTrace []string, + typeResolutionsTrace []module.DiagAndArgs, ) { automaticTypeDirectiveNames := module.GetAutomaticTypeDirectiveNames(p.opts.Config.CompilerOptions(), p.opts.Host) if len(automaticTypeDirectiveNames) != 0 { @@ -449,7 +449,7 @@ func (p *fileLoader) resolveTypeReferenceDirectives(t *parseTask) { meta := t.metadata typeResolutionsInFile := make(module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], len(file.TypeReferenceDirectives)) - var typeResolutionsTrace []string + var typeResolutionsTrace []module.DiagAndArgs for index, ref := range file.TypeReferenceDirectives { redirect, fileName := p.projectReferenceFileMapper.getRedirectForResolution(file) resolutionMode := getModeForTypeReferenceDirectiveInFile(ref, file, meta, module.GetCompilerOptionsWithRedirect(p.opts.Config.CompilerOptions(), redirect)) @@ -527,7 +527,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { if len(moduleNames) != 0 { resolutionsInFile := make(module.ModeAwareCache[*module.ResolvedModule], len(moduleNames)) - var resolutionsTrace []string + var resolutionsTrace []module.DiagAndArgs for index, entry := range moduleNames { moduleName := entry.Text() diff --git a/pkg/compiler/filesparser.go b/pkg/compiler/filesparser.go index 07f25b98b..24c4d25ac 100644 --- a/pkg/compiler/filesparser.go +++ b/pkg/compiler/filesparser.go @@ -25,9 +25,9 @@ type parseTask struct { metadata ast.SourceFileMetaData resolutionsInFile module.ModeAwareCache[*module.ResolvedModule] - resolutionsTrace []string + resolutionsTrace []module.DiagAndArgs typeResolutionsInFile module.ModeAwareCache[*module.ResolvedTypeReferenceDirective] - typeResolutionsTrace []string + typeResolutionsTrace []module.DiagAndArgs resolutionDiagnostics []*ast.Diagnostic importHelpersImportSpecifier *ast.Node jsxRuntimeImportSpecifier *jsxRuntimeImportSpecifier @@ -255,10 +255,10 @@ func (w *filesParser) collectWorker(loader *fileLoader, tasks []*parseTask, iter continue } for _, trace := range task.typeResolutionsTrace { - loader.opts.Host.Trace(trace) + loader.opts.Host.Trace(trace.Message, trace.Args...) } for _, trace := range task.resolutionsTrace { - loader.opts.Host.Trace(trace) + loader.opts.Host.Trace(trace.Message, trace.Args...) } if subTasks := task.subTasks; len(subTasks) > 0 { w.collectWorker(loader, subTasks, iterate, seen) diff --git a/pkg/compiler/host.go b/pkg/compiler/host.go index d764bc150..9ffad183a 100644 --- a/pkg/compiler/host.go +++ b/pkg/compiler/host.go @@ -3,6 +3,7 @@ package compiler import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/tsoptions" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -14,7 +15,7 @@ type CompilerHost interface { FS() vfs.FS DefaultLibraryPath() string GetCurrentDirectory() string - Trace(msg string) + Trace(msg *diagnostics.Message, args ...any) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine } @@ -26,7 +27,7 @@ type compilerHost struct { fs vfs.FS defaultLibraryPath string extendedConfigCache tsoptions.ExtendedConfigCache - trace func(msg string) + trace func(msg *diagnostics.Message, args ...any) } func NewCachedFSCompilerHost( @@ -34,7 +35,7 @@ func NewCachedFSCompilerHost( fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, - trace func(msg string), + trace func(msg *diagnostics.Message, args ...any), ) CompilerHost { return NewCompilerHost(currentDirectory, cachedvfs.From(fs), defaultLibraryPath, extendedConfigCache, trace) } @@ -44,10 +45,10 @@ func NewCompilerHost( fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, - trace func(msg string), + trace func(msg *diagnostics.Message, args ...any), ) CompilerHost { if trace == nil { - trace = func(msg string) {} + trace = func(msg *diagnostics.Message, args ...any) {} } return &compilerHost{ currentDirectory: currentDirectory, @@ -70,8 +71,8 @@ func (h *compilerHost) GetCurrentDirectory() string { return h.currentDirectory } -func (h *compilerHost) Trace(msg string) { - h.trace(msg) +func (h *compilerHost) Trace(msg *diagnostics.Message, args ...any) { + h.trace(msg, args...) } func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { diff --git a/pkg/compiler/program.go b/pkg/compiler/program.go index 45897d0be..dffc66089 100644 --- a/pkg/compiler/program.go +++ b/pkg/compiler/program.go @@ -17,6 +17,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/module" "github.com/buke/typescript-go-internal/pkg/modulespecifiers" "github.com/buke/typescript-go-internal/pkg/outputpaths" @@ -67,6 +68,10 @@ type Program struct { // Cached unresolved imports for ATA unresolvedImportsOnce sync.Once unresolvedImports *collections.Set[string] + + // Used by workspace/symbol + hasTSFileOnce sync.Once + hasTSFile bool } // FileExists implements checker.Program. @@ -145,10 +150,19 @@ func (p *Program) GetParseFileRedirect(fileName string) string { return p.projectReferenceFileMapper.getParseFileRedirect(ast.NewHasFileName(fileName, p.toPath(fileName))) } -func (p *Program) ForEachResolvedProjectReference( - fn func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int), -) { - p.projectReferenceFileMapper.forEachResolvedProjectReference(fn) +func (p *Program) GetResolvedProjectReferences() []*tsoptions.ParsedCommandLine { + return p.projectReferenceFileMapper.getResolvedProjectReferences() +} + +func (p *Program) RangeResolvedProjectReference(f func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool) bool { + return p.projectReferenceFileMapper.rangeResolvedProjectReference(f) +} + +func (p *Program) RangeResolvedProjectReferenceInChildConfig( + childConfig *tsoptions.ParsedCommandLine, + f func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool, +) bool { + return p.projectReferenceFileMapper.rangeResolvedProjectReferenceInChildConfig(childConfig, f) } // UseCaseSensitiveFileNames implements checker.Program. @@ -905,13 +919,13 @@ func (p *Program) verifyProjectReferences() { p.programDiagnostics = append(p.programDiagnostics, diag) } - p.ForEachResolvedProjectReference(func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) { + p.RangeResolvedProjectReference(func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool { ref := parent.ProjectReferences()[index] // !!! Deprecated in 5.0 and removed since 5.5 // verifyRemovedProjectReference(ref, parent, index); if config == nil { createDiagnosticForReference(parent, index, diagnostics.File_0_not_found, ref.Path) - return + return true } refOptions := config.CompilerOptions() if !refOptions.Composite.IsTrue() || refOptions.NoEmit.IsTrue() { @@ -928,6 +942,7 @@ func (p *Program) verifyProjectReferences() { createDiagnosticForReference(parent, index, diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoFileName, ref.Path) p.hasEmitBlockingDiagnostics.Add(p.toPath(buildInfoFileName)) } + return true }) } @@ -1558,17 +1573,17 @@ func (p *Program) IsMissingPath(path tspath.Path) bool { }) } -func (p *Program) ExplainFiles(w io.Writer) { +func (p *Program) ExplainFiles(w io.Writer, locale locale.Locale) { toRelativeFileName := func(fileName string) string { return tspath.GetRelativePathFromDirectory(p.GetCurrentDirectory(), fileName, p.comparePathsOptions) } for _, file := range p.GetSourceFiles() { fmt.Fprintln(w, toRelativeFileName(file.FileName())) for _, reason := range p.includeProcessor.fileIncludeReasons[file.Path()] { - fmt.Fprintln(w, " ", reason.toDiagnostic(p, true).Message()) + fmt.Fprintln(w, " ", reason.toDiagnostic(p, true).Localize(locale)) } for _, diag := range p.includeProcessor.explainRedirectAndImpliedFormat(p, file, toRelativeFileName) { - fmt.Fprintln(w, " ", diag.Message()) + fmt.Fprintln(w, " ", diag.Localize(locale)) } } } @@ -1623,6 +1638,23 @@ func (p *Program) SourceFileMayBeEmitted(sourceFile *ast.SourceFile, forceDtsEmi return sourceFileMayBeEmitted(sourceFile, p, forceDtsEmit) } +func (p *Program) IsLibFile(sourceFile *ast.SourceFile) bool { + _, ok := p.libFiles[sourceFile.Path()] + return ok +} + +func (p *Program) HasTSFile() bool { + p.hasTSFileOnce.Do(func() { + for _, file := range p.files { + if tspath.HasImplementationTSFileExtension(file.FileName()) { + p.hasTSFile = true + break + } + } + }) + return p.hasTSFile +} + var plainJSErrors = collections.NewSetFromItems( // binder errors diagnostics.Cannot_redeclare_block_scoped_variable_0.Code(), diff --git a/pkg/compiler/projectreferencefilemapper.go b/pkg/compiler/projectreferencefilemapper.go index 07ccfe6a8..09da82e85 100644 --- a/pkg/compiler/projectreferencefilemapper.go +++ b/pkg/compiler/projectreferencefilemapper.go @@ -46,6 +46,9 @@ func (mapper *projectReferenceFileMapper) getParseFileRedirect(file ast.HasFileN } func (mapper *projectReferenceFileMapper) getResolvedProjectReferences() []*tsoptions.ParsedCommandLine { + if mapper.opts.Config.ConfigFile == nil { + return nil + } refs, ok := mapper.referencesInConfigFile[mapper.opts.Config.ConfigFile.SourceFile.Path()] var result []*tsoptions.ParsedCommandLine if ok { @@ -106,32 +109,50 @@ func (mapper *projectReferenceFileMapper) getResolvedReferenceFor(path tspath.Pa return config, ok } -func (mapper *projectReferenceFileMapper) forEachResolvedProjectReference( - fn func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int), -) { +func (mapper *projectReferenceFileMapper) rangeResolvedProjectReference( + f func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool, +) bool { if mapper.opts.Config.ConfigFile == nil { - return + return false } seenRef := collections.NewSetWithSizeHint[tspath.Path](len(mapper.referencesInConfigFile)) seenRef.Add(mapper.opts.Config.ConfigFile.SourceFile.Path()) refs := mapper.referencesInConfigFile[mapper.opts.Config.ConfigFile.SourceFile.Path()] - mapper.forEachResolvedReferenceWorker(refs, fn, mapper.opts.Config, seenRef) + return mapper.rangeResolvedReferenceWorker(refs, f, mapper.opts.Config, seenRef) } -func (mapper *projectReferenceFileMapper) forEachResolvedReferenceWorker( +func (mapper *projectReferenceFileMapper) rangeResolvedReferenceWorker( references []tspath.Path, - fn func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int), + f func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool, parent *tsoptions.ParsedCommandLine, seenRef *collections.Set[tspath.Path], -) { +) bool { for index, path := range references { if !seenRef.AddIfAbsent(path) { continue } config, _ := mapper.configToProjectReference[path] - fn(path, config, parent, index) - mapper.forEachResolvedReferenceWorker(mapper.referencesInConfigFile[path], fn, config, seenRef) + if !f(path, config, parent, index) { + return false + } + if !mapper.rangeResolvedReferenceWorker(mapper.referencesInConfigFile[path], f, config, seenRef) { + return false + } } + return true +} + +func (mapper *projectReferenceFileMapper) rangeResolvedProjectReferenceInChildConfig( + childConfig *tsoptions.ParsedCommandLine, + f func(path tspath.Path, config *tsoptions.ParsedCommandLine, parent *tsoptions.ParsedCommandLine, index int) bool, +) bool { + if childConfig == nil || childConfig.ConfigFile == nil { + return false + } + seenRef := collections.NewSetWithSizeHint[tspath.Path](len(mapper.referencesInConfigFile)) + seenRef.Add(childConfig.ConfigFile.SourceFile.Path()) + refs := mapper.referencesInConfigFile[childConfig.ConfigFile.SourceFile.Path()] + return mapper.rangeResolvedReferenceWorker(refs, f, mapper.opts.Config, seenRef) } func (mapper *projectReferenceFileMapper) getSourceToDtsIfSymlink(file ast.HasFileName) *tsoptions.SourceOutputAndProjectReference { diff --git a/pkg/core/context.go b/pkg/core/context.go index ddd019208..394fcf456 100644 --- a/pkg/core/context.go +++ b/pkg/core/context.go @@ -2,15 +2,12 @@ package core import ( "context" - - "golang.org/x/text/language" ) type key int const ( requestIDKey key = iota - localeKey ) func WithRequestID(ctx context.Context, id string) context.Context { @@ -23,14 +20,3 @@ func GetRequestID(ctx context.Context) string { } return "" } - -func WithLocale(ctx context.Context, locale language.Tag) context.Context { - return context.WithValue(ctx, localeKey, locale) -} - -func GetLocale(ctx context.Context) language.Tag { - if locale, ok := ctx.Value(localeKey).(language.Tag); ok { - return locale - } - return language.Und -} diff --git a/pkg/diagnostics/diagnostics.go b/pkg/diagnostics/diagnostics.go index f0390590d..8487c1b70 100644 --- a/pkg/diagnostics/diagnostics.go +++ b/pkg/diagnostics/diagnostics.go @@ -1,11 +1,19 @@ // Package diagnostics contains generated localizable diagnostic messages. package diagnostics -import "github.com/buke/typescript-go-internal/pkg/stringutil" +import ( + "fmt" + "regexp" + "strconv" + "sync" -//go:generate go run generate.go -output ./diagnostics_generated.go + "github.com/buke/typescript-go-internal/pkg/locale" + "golang.org/x/text/language" +) + +//go:generate go run generate.go -diagnostics ./diagnostics_generated.go -loc ./loc_generated.go -locdir ./loc //go:generate go run golang.org/x/tools/cmd/stringer@latest -type=Category -output=stringer_generated.go -//go:generate go run mvdan.cc/gofumpt@latest -w diagnostics_generated.go stringer_generated.go +//go:generate go run mvdan.cc/gofumpt@latest -w diagnostics_generated.go loc_generated.go stringer_generated.go type Category int32 @@ -30,10 +38,12 @@ func (category Category) Name() string { panic("Unhandled diagnostic category") } +type Key string + type Message struct { code int32 category Category - key string + key Key text string reportsUnnecessary bool elidedInCompatibilityPyramid bool @@ -42,22 +52,92 @@ type Message struct { func (m *Message) Code() int32 { return m.code } func (m *Message) Category() Category { return m.category } -func (m *Message) Key() string { return m.key } -func (m *Message) Message() string { return m.text } +func (m *Message) Key() Key { return m.key } func (m *Message) ReportsUnnecessary() bool { return m.reportsUnnecessary } func (m *Message) ElidedInCompatibilityPyramid() bool { return m.elidedInCompatibilityPyramid } func (m *Message) ReportsDeprecated() bool { return m.reportsDeprecated } -func (m *Message) Format(args ...any) string { - text := m.Message() - if len(args) != 0 { - text = stringutil.Format(text, args) +// For debugging only. +func (m *Message) String() string { + return m.text +} + +func (m *Message) Localize(locale locale.Locale, args ...any) string { + return Localize(locale, m, "", StringifyArgs(args)...) +} + +func Localize(locale locale.Locale, message *Message, key Key, args ...string) string { + if message == nil { + message = keyToMessage(key) + } + if message == nil { + panic("Unknown diagnostic message: " + string(key)) } - return text + + text := message.text + if localized, ok := getLocalizedMessages(language.Tag(locale))[message.key]; ok { + text = localized + } + + return Format(text, args) } -func FormatMessage(m *Message, args ...any) *Message { - result := *m - result.text = stringutil.Format(m.text, args) - return &result +var localizedMessagesCache sync.Map // map[language.Tag]map[Key]string + +func getLocalizedMessages(loc language.Tag) map[Key]string { + if loc == language.Und { + return nil + } + + // Check cache first + if cached, ok := localizedMessagesCache.Load(loc); ok { + if cached == nil { + return nil + } + return cached.(map[Key]string) + } + + var messages map[Key]string + + _, index, confidence := matcher.Match(loc) + if confidence >= language.Low && index >= 0 && index < len(localeFuncs) { + if fn := localeFuncs[index]; fn != nil { + messages = fn() + } + } + + localizedMessagesCache.Store(loc, messages) + return messages +} + +var placeholderRegexp = regexp.MustCompile(`{(\d+)}`) + +func Format(text string, args []string) string { + if len(args) == 0 { + return text + } + + return placeholderRegexp.ReplaceAllStringFunc(text, func(match string) string { + index, err := strconv.ParseInt(match[1:len(match)-1], 10, 0) + if err != nil || int(index) >= len(args) { + panic("Invalid formatting placeholder") + } + return args[int(index)] + }) +} + +func StringifyArgs(args []any) []string { + if len(args) == 0 { + return nil + } + + result := make([]string, len(args)) + for i, arg := range args { + if s, ok := arg.(string); ok { + result[i] = s + } else { + result[i] = fmt.Sprintf("%v", arg) + } + } + return result } diff --git a/pkg/diagnostics/diagnostics_generated.go b/pkg/diagnostics/diagnostics_generated.go index 7cfec6d21..50df22ce1 100644 --- a/pkg/diagnostics/diagnostics_generated.go +++ b/pkg/diagnostics/diagnostics_generated.go @@ -2436,7 +2436,7 @@ var Unterminated_quoted_string_in_response_file_0 = &Message{code: 6045, categor var Argument_for_0_option_must_be_Colon_1 = &Message{code: 6046, category: CategoryError, key: "Argument_for_0_option_must_be_Colon_1_6046", text: "Argument for '{0}' option must be: {1}."} -var Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1 = &Message{code: 6048, category: CategoryError, key: "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", text: "Locale must be of the form or -. For example '{0}' or '{1}'."} +var Locale_must_be_an_IETF_BCP_47_language_tag_Examples_Colon_0_1 = &Message{code: 6048, category: CategoryError, key: "Locale_must_be_an_IETF_BCP_47_language_tag_Examples_Colon_0_1_6048", text: "Locale must be an IETF BCP 47 language tag. Examples: '{0}', '{1}'."} var Unable_to_open_file_0 = &Message{code: 6050, category: CategoryError, key: "Unable_to_open_file_0_6050", text: "Unable to open file '{0}'."} @@ -4257,3 +4257,4266 @@ var Generate_pprof_CPU_Slashmemory_profiles_to_the_given_directory = &Message{co var Set_the_number_of_checkers_per_project = &Message{code: 100003, category: CategoryMessage, key: "Set_the_number_of_checkers_per_project_100003", text: "Set the number of checkers per project."} var X_4_unless_singleThreaded_is_passed = &Message{code: 100004, category: CategoryMessage, key: "4_unless_singleThreaded_is_passed_100004", text: "4, unless --singleThreaded is passed."} + +func keyToMessage(key Key) *Message { + switch key { + case "Unterminated_string_literal_1002": + return Unterminated_string_literal + case "Identifier_expected_1003": + return Identifier_expected + case "_0_expected_1005": + return X_0_expected + case "A_file_cannot_have_a_reference_to_itself_1006": + return A_file_cannot_have_a_reference_to_itself + case "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007": + return The_parser_expected_to_find_a_1_to_match_the_0_token_here + case "Trailing_comma_not_allowed_1009": + return Trailing_comma_not_allowed + case "Asterisk_Slash_expected_1010": + return Asterisk_Slash_expected + case "An_element_access_expression_should_take_an_argument_1011": + return An_element_access_expression_should_take_an_argument + case "Unexpected_token_1012": + return Unexpected_token + case "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013": + return A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma + case "A_rest_parameter_must_be_last_in_a_parameter_list_1014": + return A_rest_parameter_must_be_last_in_a_parameter_list + case "Parameter_cannot_have_question_mark_and_initializer_1015": + return Parameter_cannot_have_question_mark_and_initializer + case "A_required_parameter_cannot_follow_an_optional_parameter_1016": + return A_required_parameter_cannot_follow_an_optional_parameter + case "An_index_signature_cannot_have_a_rest_parameter_1017": + return An_index_signature_cannot_have_a_rest_parameter + case "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": + return An_index_signature_parameter_cannot_have_an_accessibility_modifier + case "An_index_signature_parameter_cannot_have_a_question_mark_1019": + return An_index_signature_parameter_cannot_have_a_question_mark + case "An_index_signature_parameter_cannot_have_an_initializer_1020": + return An_index_signature_parameter_cannot_have_an_initializer + case "An_index_signature_must_have_a_type_annotation_1021": + return An_index_signature_must_have_a_type_annotation + case "An_index_signature_parameter_must_have_a_type_annotation_1022": + return An_index_signature_parameter_must_have_a_type_annotation + case "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": + return X_readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature + case "An_index_signature_cannot_have_a_trailing_comma_1025": + return An_index_signature_cannot_have_a_trailing_comma + case "Accessibility_modifier_already_seen_1028": + return Accessibility_modifier_already_seen + case "_0_modifier_must_precede_1_modifier_1029": + return X_0_modifier_must_precede_1_modifier + case "_0_modifier_already_seen_1030": + return X_0_modifier_already_seen + case "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": + return X_0_modifier_cannot_appear_on_class_elements_of_this_kind + case "super_must_be_followed_by_an_argument_list_or_member_access_1034": + return X_super_must_be_followed_by_an_argument_list_or_member_access + case "Only_ambient_modules_can_use_quoted_names_1035": + return Only_ambient_modules_can_use_quoted_names + case "Statements_are_not_allowed_in_ambient_contexts_1036": + return Statements_are_not_allowed_in_ambient_contexts + case "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038": + return A_declare_modifier_cannot_be_used_in_an_already_ambient_context + case "Initializers_are_not_allowed_in_ambient_contexts_1039": + return Initializers_are_not_allowed_in_ambient_contexts + case "_0_modifier_cannot_be_used_in_an_ambient_context_1040": + return X_0_modifier_cannot_be_used_in_an_ambient_context + case "_0_modifier_cannot_be_used_here_1042": + return X_0_modifier_cannot_be_used_here + case "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": + return X_0_modifier_cannot_appear_on_a_module_or_namespace_element + case "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": + return Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier + case "A_rest_parameter_cannot_be_optional_1047": + return A_rest_parameter_cannot_be_optional + case "A_rest_parameter_cannot_have_an_initializer_1048": + return A_rest_parameter_cannot_have_an_initializer + case "A_set_accessor_must_have_exactly_one_parameter_1049": + return A_set_accessor_must_have_exactly_one_parameter + case "A_set_accessor_cannot_have_an_optional_parameter_1051": + return A_set_accessor_cannot_have_an_optional_parameter + case "A_set_accessor_parameter_cannot_have_an_initializer_1052": + return A_set_accessor_parameter_cannot_have_an_initializer + case "A_set_accessor_cannot_have_rest_parameter_1053": + return A_set_accessor_cannot_have_rest_parameter + case "A_get_accessor_cannot_have_parameters_1054": + return A_get_accessor_cannot_have_parameters + case "Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compa_1055": + return Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value + case "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": + return Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher + case "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058": + return The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + case "A_promise_must_have_a_then_method_1059": + return A_promise_must_have_a_then_method + case "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060": + return The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback + case "Enum_member_must_have_initializer_1061": + return Enum_member_must_have_initializer + case "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062": + return Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method + case "An_export_assignment_cannot_be_used_in_a_namespace_1063": + return An_export_assignment_cannot_be_used_in_a_namespace + case "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064": + return The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0 + case "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065": + return The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type + case "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": + return In_ambient_enum_declarations_member_initializer_must_be_constant_expression + case "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": + return Unexpected_token_A_constructor_method_accessor_or_property_was_expected + case "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": + return Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces + case "_0_modifier_cannot_appear_on_a_type_member_1070": + return X_0_modifier_cannot_appear_on_a_type_member + case "_0_modifier_cannot_appear_on_an_index_signature_1071": + return X_0_modifier_cannot_appear_on_an_index_signature + case "A_0_modifier_cannot_be_used_with_an_import_declaration_1079": + return A_0_modifier_cannot_be_used_with_an_import_declaration + case "Invalid_reference_directive_syntax_1084": + return Invalid_reference_directive_syntax + case "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": + return X_0_modifier_cannot_appear_on_a_constructor_declaration + case "_0_modifier_cannot_appear_on_a_parameter_1090": + return X_0_modifier_cannot_appear_on_a_parameter + case "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091": + return Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement + case "Type_parameters_cannot_appear_on_a_constructor_declaration_1092": + return Type_parameters_cannot_appear_on_a_constructor_declaration + case "Type_annotation_cannot_appear_on_a_constructor_declaration_1093": + return Type_annotation_cannot_appear_on_a_constructor_declaration + case "An_accessor_cannot_have_type_parameters_1094": + return An_accessor_cannot_have_type_parameters + case "A_set_accessor_cannot_have_a_return_type_annotation_1095": + return A_set_accessor_cannot_have_a_return_type_annotation + case "An_index_signature_must_have_exactly_one_parameter_1096": + return An_index_signature_must_have_exactly_one_parameter + case "_0_list_cannot_be_empty_1097": + return X_0_list_cannot_be_empty + case "Type_parameter_list_cannot_be_empty_1098": + return Type_parameter_list_cannot_be_empty + case "Type_argument_list_cannot_be_empty_1099": + return Type_argument_list_cannot_be_empty + case "Invalid_use_of_0_in_strict_mode_1100": + return Invalid_use_of_0_in_strict_mode + case "with_statements_are_not_allowed_in_strict_mode_1101": + return X_with_statements_are_not_allowed_in_strict_mode + case "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": + return X_delete_cannot_be_called_on_an_identifier_in_strict_mode + case "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103": + return X_for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules + case "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104": + return A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement + case "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105": + return A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement + case "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106": + return The_left_hand_side_of_a_for_of_statement_may_not_be_async + case "Jump_target_cannot_cross_function_boundary_1107": + return Jump_target_cannot_cross_function_boundary + case "A_return_statement_can_only_be_used_within_a_function_body_1108": + return A_return_statement_can_only_be_used_within_a_function_body + case "Expression_expected_1109": + return Expression_expected + case "Type_expected_1110": + return Type_expected + case "Private_field_0_must_be_declared_in_an_enclosing_class_1111": + return Private_field_0_must_be_declared_in_an_enclosing_class + case "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113": + return A_default_clause_cannot_appear_more_than_once_in_a_switch_statement + case "Duplicate_label_0_1114": + return Duplicate_label_0 + case "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115": + return A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement + case "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116": + return A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement + case "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117": + return An_object_literal_cannot_have_multiple_properties_with_the_same_name + case "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118": + return An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name + case "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119": + return An_object_literal_cannot_have_property_and_accessor_with_the_same_name + case "An_export_assignment_cannot_have_modifiers_1120": + return An_export_assignment_cannot_have_modifiers + case "Octal_literals_are_not_allowed_Use_the_syntax_0_1121": + return Octal_literals_are_not_allowed_Use_the_syntax_0 + case "Variable_declaration_list_cannot_be_empty_1123": + return Variable_declaration_list_cannot_be_empty + case "Digit_expected_1124": + return Digit_expected + case "Hexadecimal_digit_expected_1125": + return Hexadecimal_digit_expected + case "Unexpected_end_of_text_1126": + return Unexpected_end_of_text + case "Invalid_character_1127": + return Invalid_character + case "Declaration_or_statement_expected_1128": + return Declaration_or_statement_expected + case "Statement_expected_1129": + return Statement_expected + case "case_or_default_expected_1130": + return X_case_or_default_expected + case "Property_or_signature_expected_1131": + return Property_or_signature_expected + case "Enum_member_expected_1132": + return Enum_member_expected + case "Variable_declaration_expected_1134": + return Variable_declaration_expected + case "Argument_expression_expected_1135": + return Argument_expression_expected + case "Property_assignment_expected_1136": + return Property_assignment_expected + case "Expression_or_comma_expected_1137": + return Expression_or_comma_expected + case "Parameter_declaration_expected_1138": + return Parameter_declaration_expected + case "Type_parameter_declaration_expected_1139": + return Type_parameter_declaration_expected + case "Type_argument_expected_1140": + return Type_argument_expected + case "String_literal_expected_1141": + return String_literal_expected + case "Line_break_not_permitted_here_1142": + return Line_break_not_permitted_here + case "or_expected_1144": + return X_or_expected + case "or_JSX_element_expected_1145": + return X_or_JSX_element_expected + case "Declaration_expected_1146": + return Declaration_expected + case "Import_declarations_in_a_namespace_cannot_reference_a_module_1147": + return Import_declarations_in_a_namespace_cannot_reference_a_module + case "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148": + return Cannot_use_imports_exports_or_module_augmentations_when_module_is_none + case "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": + return File_name_0_differs_from_already_included_file_name_1_only_in_casing + case "_0_declarations_must_be_initialized_1155": + return X_0_declarations_must_be_initialized + case "_0_declarations_can_only_be_declared_inside_a_block_1156": + return X_0_declarations_can_only_be_declared_inside_a_block + case "Unterminated_template_literal_1160": + return Unterminated_template_literal + case "Unterminated_regular_expression_literal_1161": + return Unterminated_regular_expression_literal + case "An_object_member_cannot_be_declared_optional_1162": + return An_object_member_cannot_be_declared_optional + case "A_yield_expression_is_only_allowed_in_a_generator_body_1163": + return A_yield_expression_is_only_allowed_in_a_generator_body + case "Computed_property_names_are_not_allowed_in_enums_1164": + return Computed_property_names_are_not_allowed_in_enums + case "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": + return A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type + case "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166": + return A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type + case "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": + return A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type + case "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": + return A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type + case "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": + return A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type + case "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": + return A_comma_expression_is_not_allowed_in_a_computed_property_name + case "extends_clause_already_seen_1172": + return X_extends_clause_already_seen + case "extends_clause_must_precede_implements_clause_1173": + return X_extends_clause_must_precede_implements_clause + case "Classes_can_only_extend_a_single_class_1174": + return Classes_can_only_extend_a_single_class + case "implements_clause_already_seen_1175": + return X_implements_clause_already_seen + case "Interface_declaration_cannot_have_implements_clause_1176": + return Interface_declaration_cannot_have_implements_clause + case "Binary_digit_expected_1177": + return Binary_digit_expected + case "Octal_digit_expected_1178": + return Octal_digit_expected + case "Unexpected_token_expected_1179": + return Unexpected_token_expected + case "Property_destructuring_pattern_expected_1180": + return Property_destructuring_pattern_expected + case "Array_element_destructuring_pattern_expected_1181": + return Array_element_destructuring_pattern_expected + case "A_destructuring_declaration_must_have_an_initializer_1182": + return A_destructuring_declaration_must_have_an_initializer + case "An_implementation_cannot_be_declared_in_ambient_contexts_1183": + return An_implementation_cannot_be_declared_in_ambient_contexts + case "Modifiers_cannot_appear_here_1184": + return Modifiers_cannot_appear_here + case "Merge_conflict_marker_encountered_1185": + return Merge_conflict_marker_encountered + case "A_rest_element_cannot_have_an_initializer_1186": + return A_rest_element_cannot_have_an_initializer + case "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": + return A_parameter_property_may_not_be_declared_using_a_binding_pattern + case "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188": + return Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement + case "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189": + return The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer + case "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190": + return The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer + case "An_import_declaration_cannot_have_modifiers_1191": + return An_import_declaration_cannot_have_modifiers + case "Module_0_has_no_default_export_1192": + return Module_0_has_no_default_export + case "An_export_declaration_cannot_have_modifiers_1193": + return An_export_declaration_cannot_have_modifiers + case "Export_declarations_are_not_permitted_in_a_namespace_1194": + return Export_declarations_are_not_permitted_in_a_namespace + case "export_Asterisk_does_not_re_export_a_default_1195": + return X_export_Asterisk_does_not_re_export_a_default + case "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196": + return Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified + case "Catch_clause_variable_cannot_have_an_initializer_1197": + return Catch_clause_variable_cannot_have_an_initializer + case "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": + return An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive + case "Unterminated_Unicode_escape_sequence_1199": + return Unterminated_Unicode_escape_sequence + case "Line_terminator_not_permitted_before_arrow_1200": + return Line_terminator_not_permitted_before_arrow + case "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": + return Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead + case "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203": + return Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead + case "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205": + return Re_exporting_a_type_when_0_is_enabled_requires_using_export_type + case "Decorators_are_not_valid_here_1206": + return Decorators_are_not_valid_here + case "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": + return Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name + case "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209": + return Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0 + case "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210": + return Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode + case "A_class_declaration_without_the_default_modifier_must_have_a_name_1211": + return A_class_declaration_without_the_default_modifier_must_have_a_name + case "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212": + return Identifier_expected_0_is_a_reserved_word_in_strict_mode + case "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213": + return Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode + case "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": + return Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode + case "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215": + return Invalid_use_of_0_Modules_are_automatically_in_strict_mode + case "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": + return Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules + case "Export_assignment_is_not_supported_when_module_flag_is_system_1218": + return Export_assignment_is_not_supported_when_module_flag_is_system + case "Generators_are_not_allowed_in_an_ambient_context_1221": + return Generators_are_not_allowed_in_an_ambient_context + case "An_overload_signature_cannot_be_declared_as_a_generator_1222": + return An_overload_signature_cannot_be_declared_as_a_generator + case "_0_tag_already_specified_1223": + return X_0_tag_already_specified + case "Signature_0_must_be_a_type_predicate_1224": + return Signature_0_must_be_a_type_predicate + case "Cannot_find_parameter_0_1225": + return Cannot_find_parameter_0 + case "Type_predicate_0_is_not_assignable_to_1_1226": + return Type_predicate_0_is_not_assignable_to_1 + case "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227": + return Parameter_0_is_not_in_the_same_position_as_parameter_1 + case "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": + return A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods + case "A_type_predicate_cannot_reference_a_rest_parameter_1229": + return A_type_predicate_cannot_reference_a_rest_parameter + case "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": + return A_type_predicate_cannot_reference_element_0_in_a_binding_pattern + case "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231": + return An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration + case "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232": + return An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module + case "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233": + return An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module + case "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234": + return An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file + case "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235": + return A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module + case "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236": + return The_return_type_of_a_property_decorator_function_must_be_either_void_or_any + case "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237": + return The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any + case "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238": + return Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression + case "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239": + return Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression + case "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240": + return Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression + case "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241": + return Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression + case "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242": + return X_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration + case "_0_modifier_cannot_be_used_with_1_modifier_1243": + return X_0_modifier_cannot_be_used_with_1_modifier + case "Abstract_methods_can_only_appear_within_an_abstract_class_1244": + return Abstract_methods_can_only_appear_within_an_abstract_class + case "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245": + return Method_0_cannot_have_an_implementation_because_it_is_marked_abstract + case "An_interface_property_cannot_have_an_initializer_1246": + return An_interface_property_cannot_have_an_initializer + case "A_type_literal_property_cannot_have_an_initializer_1247": + return A_type_literal_property_cannot_have_an_initializer + case "A_class_member_cannot_have_the_0_keyword_1248": + return A_class_member_cannot_have_the_0_keyword + case "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249": + return A_decorator_can_only_decorate_a_method_implementation_not_an_overload + case "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_1250": + return Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5 + case "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definiti_1251": + return Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode + case "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_au_1252": + return Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode + case "Abstract_properties_can_only_appear_within_an_abstract_class_1253": + return Abstract_properties_can_only_appear_within_an_abstract_class + case "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254": + return A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference + case "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255": + return A_definite_assignment_assertion_is_not_permitted_in_this_context + case "A_required_element_cannot_follow_an_optional_element_1257": + return A_required_element_cannot_follow_an_optional_element + case "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258": + return A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration + case "Module_0_can_only_be_default_imported_using_the_1_flag_1259": + return Module_0_can_only_be_default_imported_using_the_1_flag + case "Keywords_cannot_contain_escape_characters_1260": + return Keywords_cannot_contain_escape_characters + case "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261": + return Already_included_file_name_0_differs_from_file_name_1_only_in_casing + case "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262": + return Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module + case "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": + return Declarations_with_initializers_cannot_also_have_definite_assignment_assertions + case "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": + return Declarations_with_definite_assignment_assertions_must_also_have_type_annotations + case "A_rest_element_cannot_follow_another_rest_element_1265": + return A_rest_element_cannot_follow_another_rest_element + case "An_optional_element_cannot_follow_a_rest_element_1266": + return An_optional_element_cannot_follow_a_rest_element + case "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267": + return Property_0_cannot_have_an_initializer_because_it_is_marked_abstract + case "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268": + return An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type + case "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269": + return Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled + case "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270": + return Decorator_function_return_type_0_is_not_assignable_to_type_1 + case "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271": + return Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any + case "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272": + return A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled + case "_0_modifier_cannot_appear_on_a_type_parameter_1273": + return X_0_modifier_cannot_appear_on_a_type_parameter + case "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274": + return X_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias + case "accessor_modifier_can_only_appear_on_a_property_declaration_1275": + return X_accessor_modifier_can_only_appear_on_a_property_declaration + case "An_accessor_property_cannot_be_declared_optional_1276": + return An_accessor_property_cannot_be_declared_optional + case "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277": + return X_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class + case "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278": + return The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 + case "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279": + return The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 + case "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280": + return Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement + case "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281": + return Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead + case "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282": + return An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type + case "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283": + return An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration + case "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284": + return An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type + case "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285": + return An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration + case "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286": + return ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax + case "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287": + return A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled + case "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288": + return An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled + case "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289": + return X_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported + case "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290": + return X_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default + case "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291": + return X_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported + case "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292": + return X_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default + case "ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293": + return ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve + case "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294": + return This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled + case "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295": + return ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript + case "with_statements_are_not_allowed_in_an_async_function_block_1300": + return X_with_statements_are_not_allowed_in_an_async_function_block + case "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308": + return X_await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules + case "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309": + return The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level + case "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312": + return Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern + case "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": + return The_body_of_an_if_statement_cannot_be_the_empty_statement + case "Global_module_exports_may_only_appear_in_module_files_1314": + return Global_module_exports_may_only_appear_in_module_files + case "Global_module_exports_may_only_appear_in_declaration_files_1315": + return Global_module_exports_may_only_appear_in_declaration_files + case "Global_module_exports_may_only_appear_at_top_level_1316": + return Global_module_exports_may_only_appear_at_top_level + case "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": + return A_parameter_property_cannot_be_declared_using_a_rest_parameter + case "An_abstract_accessor_cannot_have_an_implementation_1318": + return An_abstract_accessor_cannot_have_an_implementation + case "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319": + return A_default_export_can_only_be_used_in_an_ECMAScript_style_module + case "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320": + return Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + case "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": + return Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + case "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": + return Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + case "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323": + return Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext + case "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324": + return Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve + case "Argument_of_dynamic_import_cannot_be_spread_element_1325": + return Argument_of_dynamic_import_cannot_be_spread_element + case "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326": + return This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments + case "String_literal_with_double_quotes_expected_1327": + return String_literal_with_double_quotes_expected + case "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": + return Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal + case "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": + return X_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0 + case "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": + return A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly + case "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": + return A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly + case "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": + return A_variable_whose_type_is_a_unique_symbol_type_must_be_const + case "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": + return X_unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name + case "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": + return X_unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement + case "unique_symbol_types_are_not_allowed_here_1335": + return X_unique_symbol_types_are_not_allowed_here + case "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337": + return An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead + case "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": + return X_infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type + case "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339": + return Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here + case "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340": + return Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0 + case "Class_constructor_may_not_be_an_accessor_1341": + return Class_constructor_may_not_be_an_accessor + case "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343": + return The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext + case "A_label_is_not_allowed_here_1344": + return A_label_is_not_allowed_here + case "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": + return An_expression_of_type_void_cannot_be_tested_for_truthiness + case "This_parameter_is_not_allowed_with_use_strict_directive_1346": + return This_parameter_is_not_allowed_with_use_strict_directive + case "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347": + return X_use_strict_directive_cannot_be_used_with_non_simple_parameter_list + case "Non_simple_parameter_declared_here_1348": + return Non_simple_parameter_declared_here + case "use_strict_directive_used_here_1349": + return X_use_strict_directive_used_here + case "Print_the_final_configuration_instead_of_building_1350": + return Print_the_final_configuration_instead_of_building + case "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": + return An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal + case "A_bigint_literal_cannot_use_exponential_notation_1352": + return A_bigint_literal_cannot_use_exponential_notation + case "A_bigint_literal_must_be_an_integer_1353": + return A_bigint_literal_must_be_an_integer + case "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354": + return X_readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types + case "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355": + return A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals + case "Did_you_mean_to_mark_this_function_as_async_1356": + return Did_you_mean_to_mark_this_function_as_async + case "An_enum_member_name_must_be_followed_by_a_or_1357": + return An_enum_member_name_must_be_followed_by_a_or + case "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358": + return Tagged_template_expressions_are_not_permitted_in_an_optional_chain + case "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359": + return Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here + case "Type_0_does_not_satisfy_the_expected_type_1_1360": + return Type_0_does_not_satisfy_the_expected_type_1 + case "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": + return X_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type + case "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": + return X_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type + case "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363": + return A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both + case "Convert_to_type_only_export_1364": + return Convert_to_type_only_export + case "Convert_all_re_exported_types_to_type_only_exports_1365": + return Convert_all_re_exported_types_to_type_only_exports + case "Split_into_two_separate_import_declarations_1366": + return Split_into_two_separate_import_declarations + case "Split_all_invalid_type_only_imports_1367": + return Split_all_invalid_type_only_imports + case "Class_constructor_may_not_be_a_generator_1368": + return Class_constructor_may_not_be_a_generator + case "Did_you_mean_0_1369": + return Did_you_mean_0 + case "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375": + return X_await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module + case "_0_was_imported_here_1376": + return X_0_was_imported_here + case "_0_was_exported_here_1377": + return X_0_was_exported_here + case "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378": + return Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher + case "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379": + return An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type + case "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380": + return An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type + case "Unexpected_token_Did_you_mean_or_rbrace_1381": + return Unexpected_token_Did_you_mean_or_rbrace + case "Unexpected_token_Did_you_mean_or_gt_1382": + return Unexpected_token_Did_you_mean_or_gt + case "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": + return Function_type_notation_must_be_parenthesized_when_used_in_a_union_type + case "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": + return Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type + case "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": + return Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type + case "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": + return Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type + case "_0_is_not_allowed_as_a_variable_declaration_name_1389": + return X_0_is_not_allowed_as_a_variable_declaration_name + case "_0_is_not_allowed_as_a_parameter_name_1390": + return X_0_is_not_allowed_as_a_parameter_name + case "An_import_alias_cannot_use_import_type_1392": + return An_import_alias_cannot_use_import_type + case "Imported_via_0_from_file_1_1393": + return Imported_via_0_from_file_1 + case "Imported_via_0_from_file_1_with_packageId_2_1394": + return Imported_via_0_from_file_1_with_packageId_2 + case "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395": + return Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions + case "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396": + return Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions + case "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397": + return Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions + case "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398": + return Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions + case "File_is_included_via_import_here_1399": + return File_is_included_via_import_here + case "Referenced_via_0_from_file_1_1400": + return Referenced_via_0_from_file_1 + case "File_is_included_via_reference_here_1401": + return File_is_included_via_reference_here + case "Type_library_referenced_via_0_from_file_1_1402": + return Type_library_referenced_via_0_from_file_1 + case "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403": + return Type_library_referenced_via_0_from_file_1_with_packageId_2 + case "File_is_included_via_type_library_reference_here_1404": + return File_is_included_via_type_library_reference_here + case "Library_referenced_via_0_from_file_1_1405": + return Library_referenced_via_0_from_file_1 + case "File_is_included_via_library_reference_here_1406": + return File_is_included_via_library_reference_here + case "Matched_by_include_pattern_0_in_1_1407": + return Matched_by_include_pattern_0_in_1 + case "File_is_matched_by_include_pattern_specified_here_1408": + return File_is_matched_by_include_pattern_specified_here + case "Part_of_files_list_in_tsconfig_json_1409": + return Part_of_files_list_in_tsconfig_json + case "File_is_matched_by_files_list_specified_here_1410": + return File_is_matched_by_files_list_specified_here + case "Output_from_referenced_project_0_included_because_1_specified_1411": + return Output_from_referenced_project_0_included_because_1_specified + case "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412": + return Output_from_referenced_project_0_included_because_module_is_specified_as_none + case "File_is_output_from_referenced_project_specified_here_1413": + return File_is_output_from_referenced_project_specified_here + case "Source_from_referenced_project_0_included_because_1_specified_1414": + return Source_from_referenced_project_0_included_because_1_specified + case "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415": + return Source_from_referenced_project_0_included_because_module_is_specified_as_none + case "File_is_source_from_referenced_project_specified_here_1416": + return File_is_source_from_referenced_project_specified_here + case "Entry_point_of_type_library_0_specified_in_compilerOptions_1417": + return Entry_point_of_type_library_0_specified_in_compilerOptions + case "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418": + return Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1 + case "File_is_entry_point_of_type_library_specified_here_1419": + return File_is_entry_point_of_type_library_specified_here + case "Entry_point_for_implicit_type_library_0_1420": + return Entry_point_for_implicit_type_library_0 + case "Entry_point_for_implicit_type_library_0_with_packageId_1_1421": + return Entry_point_for_implicit_type_library_0_with_packageId_1 + case "Library_0_specified_in_compilerOptions_1422": + return Library_0_specified_in_compilerOptions + case "File_is_library_specified_here_1423": + return File_is_library_specified_here + case "Default_library_1424": + return Default_library + case "Default_library_for_target_0_1425": + return Default_library_for_target_0 + case "File_is_default_library_for_target_specified_here_1426": + return File_is_default_library_for_target_specified_here + case "Root_file_specified_for_compilation_1427": + return Root_file_specified_for_compilation + case "File_is_output_of_project_reference_source_0_1428": + return File_is_output_of_project_reference_source_0 + case "File_redirects_to_file_0_1429": + return File_redirects_to_file_0 + case "The_file_is_in_the_program_because_Colon_1430": + return The_file_is_in_the_program_because_Colon + case "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431": + return X_for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module + case "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432": + return Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher + case "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433": + return Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters + case "Unexpected_keyword_or_identifier_1434": + return Unexpected_keyword_or_identifier + case "Unknown_keyword_or_identifier_Did_you_mean_0_1435": + return Unknown_keyword_or_identifier_Did_you_mean_0 + case "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436": + return Decorators_must_precede_the_name_and_all_keywords_of_property_declarations + case "Namespace_must_be_given_a_name_1437": + return Namespace_must_be_given_a_name + case "Interface_must_be_given_a_name_1438": + return Interface_must_be_given_a_name + case "Type_alias_must_be_given_a_name_1439": + return Type_alias_must_be_given_a_name + case "Variable_declaration_not_allowed_at_this_location_1440": + return Variable_declaration_not_allowed_at_this_location + case "Cannot_start_a_function_call_in_a_type_annotation_1441": + return Cannot_start_a_function_call_in_a_type_annotation + case "Expected_for_property_initializer_1442": + return Expected_for_property_initializer + case "Module_declaration_names_may_only_use_or_quoted_strings_1443": + return Module_declaration_names_may_only_use_or_quoted_strings + case "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448": + return X_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled + case "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449": + return Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed + case "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450": + return Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments + case "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": + return Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression + case "resolution_mode_should_be_either_require_or_import_1453": + return X_resolution_mode_should_be_either_require_or_import + case "resolution_mode_can_only_be_set_for_type_only_imports_1454": + return X_resolution_mode_can_only_be_set_for_type_only_imports + case "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455": + return X_resolution_mode_is_the_only_valid_key_for_type_import_assertions + case "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456": + return Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require + case "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457": + return Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk + case "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458": + return File_is_ECMAScript_module_because_0_has_field_type_with_value_module + case "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459": + return File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module + case "File_is_CommonJS_module_because_0_does_not_have_field_type_1460": + return File_is_CommonJS_module_because_0_does_not_have_field_type + case "File_is_CommonJS_module_because_package_json_was_not_found_1461": + return File_is_CommonJS_module_because_package_json_was_not_found + case "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463": + return X_resolution_mode_is_the_only_valid_key_for_type_import_attributes + case "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464": + return Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require + case "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470": + return The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output + case "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471": + return Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead + case "catch_or_finally_expected_1472": + return X_catch_or_finally_expected + case "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473": + return An_import_declaration_can_only_be_used_at_the_top_level_of_a_module + case "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474": + return An_export_declaration_can_only_be_used_at_the_top_level_of_a_module + case "Control_what_method_is_used_to_detect_module_format_JS_files_1475": + return Control_what_method_is_used_to_detect_module_format_JS_files + case "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476": + return X_auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules + case "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477": + return An_instantiation_expression_cannot_be_followed_by_a_property_access + case "Identifier_or_string_literal_expected_1478": + return Identifier_or_string_literal_expected + case "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479": + return The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead + case "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480": + return To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module + case "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481": + return To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1 + case "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482": + return To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0 + case "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483": + return To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module + case "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484": + return X_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled + case "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485": + return X_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled + case "Decorator_used_before_export_here_1486": + return Decorator_used_before_export_here + case "Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487": + return Octal_escape_sequences_are_not_allowed_Use_the_syntax_0 + case "Escape_sequence_0_is_not_allowed_1488": + return Escape_sequence_0_is_not_allowed + case "Decimals_with_leading_zeros_are_not_allowed_1489": + return Decimals_with_leading_zeros_are_not_allowed + case "File_appears_to_be_binary_1490": + return File_appears_to_be_binary + case "_0_modifier_cannot_appear_on_a_using_declaration_1491": + return X_0_modifier_cannot_appear_on_a_using_declaration + case "_0_declarations_may_not_have_binding_patterns_1492": + return X_0_declarations_may_not_have_binding_patterns + case "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493": + return The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration + case "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494": + return The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration + case "_0_modifier_cannot_appear_on_an_await_using_declaration_1495": + return X_0_modifier_cannot_appear_on_an_await_using_declaration + case "Identifier_string_literal_or_number_literal_expected_1496": + return Identifier_string_literal_or_number_literal_expected + case "Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497": + return Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator + case "Invalid_syntax_in_decorator_1498": + return Invalid_syntax_in_decorator + case "Unknown_regular_expression_flag_1499": + return Unknown_regular_expression_flag + case "Duplicate_regular_expression_flag_1500": + return Duplicate_regular_expression_flag + case "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1501": + return This_regular_expression_flag_is_only_available_when_targeting_0_or_later + case "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1502": + return The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously + case "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1503": + return Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later + case "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1504": + return Subpattern_flags_must_be_present_when_there_is_a_minus_sign + case "Incomplete_quantifier_Digit_expected_1505": + return Incomplete_quantifier_Digit_expected + case "Numbers_out_of_order_in_quantifier_1506": + return Numbers_out_of_order_in_quantifier + case "There_is_nothing_available_for_repetition_1507": + return There_is_nothing_available_for_repetition + case "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1508": + return Unexpected_0_Did_you_mean_to_escape_it_with_backslash + case "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1509": + return This_regular_expression_flag_cannot_be_toggled_within_a_subpattern + case "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": + return X_k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets + case "q_is_only_available_inside_character_class_1511": + return X_q_is_only_available_inside_character_class + case "c_must_be_followed_by_an_ASCII_letter_1512": + return X_c_must_be_followed_by_an_ASCII_letter + case "Undetermined_character_escape_1513": + return Undetermined_character_escape + case "Expected_a_capturing_group_name_1514": + return Expected_a_capturing_group_name + case "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1515": + return Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other + case "A_character_class_range_must_not_be_bounded_by_another_character_class_1516": + return A_character_class_range_must_not_be_bounded_by_another_character_class + case "Range_out_of_order_in_character_class_1517": + return Range_out_of_order_in_character_class + case "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1518": + return Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class + case "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1519": + return Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead + case "Expected_a_class_set_operand_1520": + return Expected_a_class_set_operand + case "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1521": + return X_q_must_be_followed_by_string_alternatives_enclosed_in_braces + case "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1522": + return A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash + case "Expected_a_Unicode_property_name_1523": + return Expected_a_Unicode_property_name + case "Unknown_Unicode_property_name_1524": + return Unknown_Unicode_property_name + case "Expected_a_Unicode_property_value_1525": + return Expected_a_Unicode_property_value + case "Unknown_Unicode_property_value_1526": + return Unknown_Unicode_property_value + case "Expected_a_Unicode_property_name_or_value_1527": + return Expected_a_Unicode_property_name_or_value + case "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1528": + return Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set + case "Unknown_Unicode_property_name_or_value_1529": + return Unknown_Unicode_property_name_or_value + case "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1530": + return Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set + case "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1531": + return X_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces + case "There_is_no_capturing_group_named_0_in_this_regular_expression_1532": + return There_is_no_capturing_group_named_0_in_this_regular_expression + case "This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_r_1533": + return This_backreference_refers_to_a_group_that_does_not_exist_There_are_only_0_capturing_groups_in_this_regular_expression + case "This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regul_1534": + return This_backreference_refers_to_a_group_that_does_not_exist_There_are_no_capturing_groups_in_this_regular_expression + case "This_character_cannot_be_escaped_in_a_regular_expression_1535": + return This_character_cannot_be_escaped_in_a_regular_expression + case "Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended__1536": + return Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead + case "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537": + return Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class + case "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538": + return Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set + case "A_bigint_literal_cannot_be_used_as_a_property_name_1539": + return A_bigint_literal_cannot_be_used_as_a_property_name + case "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540": + return A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead + case "Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541": + return Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute + case "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542": + return Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute + case "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543": + return Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0 + case "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544": + return Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0 + case "using_declarations_are_not_allowed_in_ambient_contexts_1545": + return X_using_declarations_are_not_allowed_in_ambient_contexts + case "await_using_declarations_are_not_allowed_in_ambient_contexts_1546": + return X_await_using_declarations_are_not_allowed_in_ambient_contexts + case "The_types_of_0_are_incompatible_between_these_types_2200": + return The_types_of_0_are_incompatible_between_these_types + case "The_types_returned_by_0_are_incompatible_between_these_types_2201": + return The_types_returned_by_0_are_incompatible_between_these_types + case "Call_signature_return_types_0_and_1_are_incompatible_2202": + return Call_signature_return_types_0_and_1_are_incompatible + case "Construct_signature_return_types_0_and_1_are_incompatible_2203": + return Construct_signature_return_types_0_and_1_are_incompatible + case "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": + return Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1 + case "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205": + return Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1 + case "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206": + return The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement + case "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207": + return The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement + case "This_type_parameter_might_need_an_extends_0_constraint_2208": + return This_type_parameter_might_need_an_extends_0_constraint + case "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209": + return The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate + case "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210": + return The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate + case "Add_extends_constraint_2211": + return Add_extends_constraint + case "Add_extends_constraint_to_all_type_parameters_2212": + return Add_extends_constraint_to_all_type_parameters + case "Duplicate_identifier_0_2300": + return Duplicate_identifier_0 + case "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": + return Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor + case "Static_members_cannot_reference_class_type_parameters_2302": + return Static_members_cannot_reference_class_type_parameters + case "Circular_definition_of_import_alias_0_2303": + return Circular_definition_of_import_alias_0 + case "Cannot_find_name_0_2304": + return Cannot_find_name_0 + case "Module_0_has_no_exported_member_1_2305": + return Module_0_has_no_exported_member_1 + case "File_0_is_not_a_module_2306": + return File_0_is_not_a_module + case "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": + return Cannot_find_module_0_or_its_corresponding_type_declarations + case "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308": + return Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity + case "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309": + return An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements + case "Type_0_recursively_references_itself_as_a_base_type_2310": + return Type_0_recursively_references_itself_as_a_base_type + case "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311": + return Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function + case "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312": + return An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members + case "Type_parameter_0_has_a_circular_constraint_2313": + return Type_parameter_0_has_a_circular_constraint + case "Generic_type_0_requires_1_type_argument_s_2314": + return Generic_type_0_requires_1_type_argument_s + case "Type_0_is_not_generic_2315": + return Type_0_is_not_generic + case "Global_type_0_must_be_a_class_or_interface_type_2316": + return Global_type_0_must_be_a_class_or_interface_type + case "Global_type_0_must_have_1_type_parameter_s_2317": + return Global_type_0_must_have_1_type_parameter_s + case "Cannot_find_global_type_0_2318": + return Cannot_find_global_type_0 + case "Named_property_0_of_types_1_and_2_are_not_identical_2319": + return Named_property_0_of_types_1_and_2_are_not_identical + case "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320": + return Interface_0_cannot_simultaneously_extend_types_1_and_2 + case "Excessive_stack_depth_comparing_types_0_and_1_2321": + return Excessive_stack_depth_comparing_types_0_and_1 + case "Type_0_is_not_assignable_to_type_1_2322": + return Type_0_is_not_assignable_to_type_1 + case "Cannot_redeclare_exported_variable_0_2323": + return Cannot_redeclare_exported_variable_0 + case "Property_0_is_missing_in_type_1_2324": + return Property_0_is_missing_in_type_1 + case "Property_0_is_private_in_type_1_but_not_in_type_2_2325": + return Property_0_is_private_in_type_1_but_not_in_type_2 + case "Types_of_property_0_are_incompatible_2326": + return Types_of_property_0_are_incompatible + case "Property_0_is_optional_in_type_1_but_required_in_type_2_2327": + return Property_0_is_optional_in_type_1_but_required_in_type_2 + case "Types_of_parameters_0_and_1_are_incompatible_2328": + return Types_of_parameters_0_and_1_are_incompatible + case "Index_signature_for_type_0_is_missing_in_type_1_2329": + return Index_signature_for_type_0_is_missing_in_type_1 + case "_0_and_1_index_signatures_are_incompatible_2330": + return X_0_and_1_index_signatures_are_incompatible + case "this_cannot_be_referenced_in_a_module_or_namespace_body_2331": + return X_this_cannot_be_referenced_in_a_module_or_namespace_body + case "this_cannot_be_referenced_in_current_location_2332": + return X_this_cannot_be_referenced_in_current_location + case "this_cannot_be_referenced_in_a_static_property_initializer_2334": + return X_this_cannot_be_referenced_in_a_static_property_initializer + case "super_can_only_be_referenced_in_a_derived_class_2335": + return X_super_can_only_be_referenced_in_a_derived_class + case "super_cannot_be_referenced_in_constructor_arguments_2336": + return X_super_cannot_be_referenced_in_constructor_arguments + case "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337": + return Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors + case "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338": + return X_super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class + case "Property_0_does_not_exist_on_type_1_2339": + return Property_0_does_not_exist_on_type_1 + case "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": + return Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword + case "Property_0_is_private_and_only_accessible_within_class_1_2341": + return Property_0_is_private_and_only_accessible_within_class_1 + case "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": + return This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0 + case "Type_0_does_not_satisfy_the_constraint_1_2344": + return Type_0_does_not_satisfy_the_constraint_1 + case "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": + return Argument_of_type_0_is_not_assignable_to_parameter_of_type_1 + case "Call_target_does_not_contain_any_signatures_2346": + return Call_target_does_not_contain_any_signatures + case "Untyped_function_calls_may_not_accept_type_arguments_2347": + return Untyped_function_calls_may_not_accept_type_arguments + case "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348": + return Value_of_type_0_is_not_callable_Did_you_mean_to_include_new + case "This_expression_is_not_callable_2349": + return This_expression_is_not_callable + case "Only_a_void_function_can_be_called_with_the_new_keyword_2350": + return Only_a_void_function_can_be_called_with_the_new_keyword + case "This_expression_is_not_constructable_2351": + return This_expression_is_not_constructable + case "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": + return Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first + case "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353": + return Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1 + case "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": + return This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found + case "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355": + return A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value + case "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356": + return An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type + case "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357": + return The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access + case "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": + return The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter + case "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359": + return The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method + case "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": + return The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type + case "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363": + return The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type + case "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": + return The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access + case "Operator_0_cannot_be_applied_to_types_1_and_2_2365": + return Operator_0_cannot_be_applied_to_types_1_and_2 + case "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": + return Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined + case "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367": + return This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap + case "Type_parameter_name_cannot_be_0_2368": + return Type_parameter_name_cannot_be_0 + case "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": + return A_parameter_property_is_only_allowed_in_a_constructor_implementation + case "A_rest_parameter_must_be_of_an_array_type_2370": + return A_rest_parameter_must_be_of_an_array_type + case "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": + return A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation + case "Parameter_0_cannot_reference_itself_2372": + return Parameter_0_cannot_reference_itself + case "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373": + return Parameter_0_cannot_reference_identifier_1_declared_after_it + case "Duplicate_index_signature_for_type_0_2374": + return Duplicate_index_signature_for_type_0 + case "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375": + return Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties + case "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376": + return A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers + case "Constructors_for_derived_classes_must_contain_a_super_call_2377": + return Constructors_for_derived_classes_must_contain_a_super_call + case "A_get_accessor_must_return_a_value_2378": + return A_get_accessor_must_return_a_value + case "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379": + return Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties + case "Overload_signatures_must_all_be_exported_or_non_exported_2383": + return Overload_signatures_must_all_be_exported_or_non_exported + case "Overload_signatures_must_all_be_ambient_or_non_ambient_2384": + return Overload_signatures_must_all_be_ambient_or_non_ambient + case "Overload_signatures_must_all_be_public_private_or_protected_2385": + return Overload_signatures_must_all_be_public_private_or_protected + case "Overload_signatures_must_all_be_optional_or_required_2386": + return Overload_signatures_must_all_be_optional_or_required + case "Function_overload_must_be_static_2387": + return Function_overload_must_be_static + case "Function_overload_must_not_be_static_2388": + return Function_overload_must_not_be_static + case "Function_implementation_name_must_be_0_2389": + return Function_implementation_name_must_be_0 + case "Constructor_implementation_is_missing_2390": + return Constructor_implementation_is_missing + case "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391": + return Function_implementation_is_missing_or_not_immediately_following_the_declaration + case "Multiple_constructor_implementations_are_not_allowed_2392": + return Multiple_constructor_implementations_are_not_allowed + case "Duplicate_function_implementation_2393": + return Duplicate_function_implementation + case "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394": + return This_overload_signature_is_not_compatible_with_its_implementation_signature + case "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": + return Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local + case "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396": + return Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters + case "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": + return Declaration_name_conflicts_with_built_in_global_identifier_0 + case "constructor_cannot_be_used_as_a_parameter_property_name_2398": + return X_constructor_cannot_be_used_as_a_parameter_property_name + case "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399": + return Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference + case "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": + return Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference + case "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401": + return A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers + case "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402": + return Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference + case "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": + return Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2 + case "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404": + return The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation + case "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405": + return The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any + case "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406": + return The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access + case "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407": + return The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0 + case "Setters_cannot_return_a_value_2408": + return Setters_cannot_return_a_value + case "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409": + return Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class + case "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410": + return The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any + case "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411": + return Property_0_of_type_1_is_not_assignable_to_2_index_type_3 + case "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412": + return Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target + case "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413": + return X_0_index_type_1_is_not_assignable_to_2_index_type_3 + case "Class_name_cannot_be_0_2414": + return Class_name_cannot_be_0 + case "Class_0_incorrectly_extends_base_class_1_2415": + return Class_0_incorrectly_extends_base_class_1 + case "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": + return Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2 + case "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": + return Class_static_side_0_incorrectly_extends_base_class_static_side_1 + case "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418": + return Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 + case "Types_of_construct_signatures_are_incompatible_2419": + return Types_of_construct_signatures_are_incompatible + case "Class_0_incorrectly_implements_interface_1_2420": + return Class_0_incorrectly_implements_interface_1 + case "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422": + return A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members + case "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423": + return Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor + case "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": + return Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function + case "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426": + return Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function + case "Interface_name_cannot_be_0_2427": + return Interface_name_cannot_be_0 + case "All_declarations_of_0_must_have_identical_type_parameters_2428": + return All_declarations_of_0_must_have_identical_type_parameters + case "Interface_0_incorrectly_extends_interface_1_2430": + return Interface_0_incorrectly_extends_interface_1 + case "Enum_name_cannot_be_0_2431": + return Enum_name_cannot_be_0 + case "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": + return In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element + case "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": + return A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged + case "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": + return A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged + case "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435": + return Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces + case "Ambient_module_declaration_cannot_specify_relative_module_name_2436": + return Ambient_module_declaration_cannot_specify_relative_module_name + case "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": + return Module_0_is_hidden_by_a_local_declaration_with_the_same_name + case "Import_name_cannot_be_0_2438": + return Import_name_cannot_be_0 + case "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": + return Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name + case "Import_declaration_conflicts_with_local_declaration_of_0_2440": + return Import_declaration_conflicts_with_local_declaration_of_0 + case "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441": + return Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module + case "Types_have_separate_declarations_of_a_private_property_0_2442": + return Types_have_separate_declarations_of_a_private_property_0 + case "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443": + return Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2 + case "Property_0_is_protected_in_type_1_but_public_in_type_2_2444": + return Property_0_is_protected_in_type_1_but_public_in_type_2 + case "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445": + return Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses + case "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446": + return Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2 + case "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447": + return The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead + case "Block_scoped_variable_0_used_before_its_declaration_2448": + return Block_scoped_variable_0_used_before_its_declaration + case "Class_0_used_before_its_declaration_2449": + return Class_0_used_before_its_declaration + case "Enum_0_used_before_its_declaration_2450": + return Enum_0_used_before_its_declaration + case "Cannot_redeclare_block_scoped_variable_0_2451": + return Cannot_redeclare_block_scoped_variable_0 + case "An_enum_member_cannot_have_a_numeric_name_2452": + return An_enum_member_cannot_have_a_numeric_name + case "Variable_0_is_used_before_being_assigned_2454": + return Variable_0_is_used_before_being_assigned + case "Type_alias_0_circularly_references_itself_2456": + return Type_alias_0_circularly_references_itself + case "Type_alias_name_cannot_be_0_2457": + return Type_alias_name_cannot_be_0 + case "An_AMD_module_cannot_have_multiple_name_assignments_2458": + return An_AMD_module_cannot_have_multiple_name_assignments + case "Module_0_declares_1_locally_but_it_is_not_exported_2459": + return Module_0_declares_1_locally_but_it_is_not_exported + case "Module_0_declares_1_locally_but_it_is_exported_as_2_2460": + return Module_0_declares_1_locally_but_it_is_exported_as_2 + case "Type_0_is_not_an_array_type_2461": + return Type_0_is_not_an_array_type + case "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": + return A_rest_element_must_be_last_in_a_destructuring_pattern + case "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463": + return A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature + case "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": + return A_computed_property_name_must_be_of_type_string_number_symbol_or_any + case "this_cannot_be_referenced_in_a_computed_property_name_2465": + return X_this_cannot_be_referenced_in_a_computed_property_name + case "super_cannot_be_referenced_in_a_computed_property_name_2466": + return X_super_cannot_be_referenced_in_a_computed_property_name + case "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": + return A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type + case "Cannot_find_global_value_0_2468": + return Cannot_find_global_value_0 + case "The_0_operator_cannot_be_applied_to_type_symbol_2469": + return The_0_operator_cannot_be_applied_to_type_symbol + case "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": + return Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher + case "Enum_declarations_must_all_be_const_or_non_const_2473": + return Enum_declarations_must_all_be_const_or_non_const + case "const_enum_member_initializers_must_be_constant_expressions_2474": + return X_const_enum_member_initializers_must_be_constant_expressions + case "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": + return X_const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query + case "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": + return A_const_enum_member_can_only_be_accessed_using_a_string_literal + case "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": + return X_const_enum_member_initializer_was_evaluated_to_a_non_finite_value + case "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": + return X_const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN + case "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": + return X_let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations + case "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": + return Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1 + case "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483": + return The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation + case "Export_declaration_conflicts_with_exported_declaration_of_0_2484": + return Export_declaration_conflicts_with_exported_declaration_of_0 + case "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487": + return The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access + case "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488": + return Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator + case "An_iterator_must_have_a_next_method_2489": + return An_iterator_must_have_a_next_method + case "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490": + return The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property + case "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491": + return The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern + case "Cannot_redeclare_identifier_0_in_catch_clause_2492": + return Cannot_redeclare_identifier_0_in_catch_clause + case "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493": + return Tuple_type_0_of_length_1_has_no_element_at_index_2 + case "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": + return Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher + case "Type_0_is_not_an_array_type_or_a_string_type_2495": + return Type_0_is_not_an_array_type_or_a_string_type + case "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_func_2496": + return The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression + case "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497": + return This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export + case "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": + return Module_0_uses_export_and_cannot_be_used_with_export_Asterisk + case "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": + return An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments + case "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500": + return A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments + case "A_rest_element_cannot_contain_a_binding_pattern_2501": + return A_rest_element_cannot_contain_a_binding_pattern + case "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": + return X_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation + case "Cannot_find_namespace_0_2503": + return Cannot_find_namespace_0 + case "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504": + return Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator + case "A_generator_cannot_have_a_void_type_annotation_2505": + return A_generator_cannot_have_a_void_type_annotation + case "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": + return X_0_is_referenced_directly_or_indirectly_in_its_own_base_expression + case "Type_0_is_not_a_constructor_function_type_2507": + return Type_0_is_not_a_constructor_function_type + case "No_base_constructor_has_the_specified_number_of_type_arguments_2508": + return No_base_constructor_has_the_specified_number_of_type_arguments + case "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509": + return Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members + case "Base_constructors_must_all_have_the_same_return_type_2510": + return Base_constructors_must_all_have_the_same_return_type + case "Cannot_create_an_instance_of_an_abstract_class_2511": + return Cannot_create_an_instance_of_an_abstract_class + case "Overload_signatures_must_all_be_abstract_or_non_abstract_2512": + return Overload_signatures_must_all_be_abstract_or_non_abstract + case "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": + return Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression + case "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514": + return A_tuple_type_cannot_be_indexed_with_a_negative_value + case "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": + return Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2 + case "All_declarations_of_an_abstract_method_must_be_consecutive_2516": + return All_declarations_of_an_abstract_method_must_be_consecutive + case "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517": + return Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type + case "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518": + return A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard + case "An_async_iterator_must_have_a_next_method_2519": + return An_async_iterator_must_have_a_next_method + case "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520": + return Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions + case "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_sta_2522": + return The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method + case "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": + return X_yield_expressions_cannot_be_used_in_a_parameter_initializer + case "await_expressions_cannot_be_used_in_a_parameter_initializer_2524": + return X_await_expressions_cannot_be_used_in_a_parameter_initializer + case "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526": + return A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface + case "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": + return The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary + case "A_module_cannot_have_multiple_default_exports_2528": + return A_module_cannot_have_multiple_default_exports + case "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529": + return Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions + case "Property_0_is_incompatible_with_index_signature_2530": + return Property_0_is_incompatible_with_index_signature + case "Object_is_possibly_null_2531": + return Object_is_possibly_null + case "Object_is_possibly_undefined_2532": + return Object_is_possibly_undefined + case "Object_is_possibly_null_or_undefined_2533": + return Object_is_possibly_null_or_undefined + case "A_function_returning_never_cannot_have_a_reachable_end_point_2534": + return A_function_returning_never_cannot_have_a_reachable_end_point + case "Type_0_cannot_be_used_to_index_type_1_2536": + return Type_0_cannot_be_used_to_index_type_1 + case "Type_0_has_no_matching_index_signature_for_type_1_2537": + return Type_0_has_no_matching_index_signature_for_type_1 + case "Type_0_cannot_be_used_as_an_index_type_2538": + return Type_0_cannot_be_used_as_an_index_type + case "Cannot_assign_to_0_because_it_is_not_a_variable_2539": + return Cannot_assign_to_0_because_it_is_not_a_variable + case "Cannot_assign_to_0_because_it_is_a_read_only_property_2540": + return Cannot_assign_to_0_because_it_is_a_read_only_property + case "Index_signature_in_type_0_only_permits_reading_2542": + return Index_signature_in_type_0_only_permits_reading + case "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543": + return Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference + case "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544": + return Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference + case "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": + return A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any + case "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547": + return The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + case "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": + return Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + case "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": + return Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator + case "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": + return Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later + case "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": + return Property_0_does_not_exist_on_type_1_Did_you_mean_2 + case "Cannot_find_name_0_Did_you_mean_1_2552": + return Cannot_find_name_0_Did_you_mean_1 + case "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": + return Computed_values_are_not_permitted_in_an_enum_with_string_valued_members + case "Expected_0_arguments_but_got_1_2554": + return Expected_0_arguments_but_got_1 + case "Expected_at_least_0_arguments_but_got_1_2555": + return Expected_at_least_0_arguments_but_got_1 + case "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556": + return A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter + case "Expected_0_type_arguments_but_got_1_2558": + return Expected_0_type_arguments_but_got_1 + case "Type_0_has_no_properties_in_common_with_type_1_2559": + return Type_0_has_no_properties_in_common_with_type_1 + case "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": + return Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it + case "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561": + return Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2 + case "Base_class_expressions_cannot_reference_class_type_parameters_2562": + return Base_class_expressions_cannot_reference_class_type_parameters + case "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": + return The_containing_function_or_module_body_is_too_large_for_control_flow_analysis + case "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": + return Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor + case "Property_0_is_used_before_being_assigned_2565": + return Property_0_is_used_before_being_assigned + case "A_rest_element_cannot_have_a_property_name_2566": + return A_rest_element_cannot_have_a_property_name + case "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567": + return Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + case "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568": + return Property_0_may_not_exist_on_type_1_Did_you_mean_2 + case "Could_not_find_name_0_Did_you_mean_1_2570": + return Could_not_find_name_0_Did_you_mean_1 + case "Object_is_of_type_unknown_2571": + return Object_is_of_type_unknown + case "A_rest_element_type_must_be_an_array_type_2574": + return A_rest_element_type_must_be_an_array_type + case "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575": + return No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments + case "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576": + return Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead + case "Return_type_annotation_circularly_references_itself_2577": + return Return_type_annotation_circularly_references_itself + case "Unused_ts_expect_error_directive_2578": + return Unused_ts_expect_error_directive + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha + case "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": + return Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later + case "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": + return Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom + case "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": + return X_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + case "Cannot_assign_to_0_because_it_is_a_constant_2588": + return Cannot_assign_to_0_because_it_is_a_constant + case "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589": + return Type_instantiation_is_excessively_deep_and_possibly_infinite + case "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590": + return Expression_produces_a_union_type_that_is_too_complex_to_represent + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + case "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594": + return This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag + case "_0_can_only_be_imported_by_using_a_default_import_2595": + return X_0_can_only_be_imported_by_using_a_default_import + case "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596": + return X_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import + case "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": + return X_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import + case "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598": + return X_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import + case "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602": + return JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist + case "Property_0_in_type_1_is_not_assignable_to_type_2_2603": + return Property_0_in_type_1_is_not_assignable_to_type_2 + case "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604": + return JSX_element_type_0_does_not_have_any_construct_or_call_signatures + case "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606": + return Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property + case "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607": + return JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property + case "The_global_type_JSX_0_may_not_have_more_than_one_property_2608": + return The_global_type_JSX_0_may_not_have_more_than_one_property + case "JSX_spread_child_must_be_an_array_type_2609": + return JSX_spread_child_must_be_an_array_type + case "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": + return X_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property + case "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611": + return X_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor + case "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612": + return Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration + case "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": + return Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead + case "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": + return Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead + case "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615": + return Type_of_property_0_circularly_references_itself_in_mapped_type_1 + case "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": + return X_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import + case "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": + return X_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import + case "Source_has_0_element_s_but_target_requires_1_2618": + return Source_has_0_element_s_but_target_requires_1 + case "Source_has_0_element_s_but_target_allows_only_1_2619": + return Source_has_0_element_s_but_target_allows_only_1 + case "Target_requires_0_element_s_but_source_may_have_fewer_2620": + return Target_requires_0_element_s_but_source_may_have_fewer + case "Target_allows_only_0_element_s_but_source_may_have_more_2621": + return Target_allows_only_0_element_s_but_source_may_have_more + case "Source_provides_no_match_for_required_element_at_position_0_in_target_2623": + return Source_provides_no_match_for_required_element_at_position_0_in_target + case "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624": + return Source_provides_no_match_for_variadic_element_at_position_0_in_target + case "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": + return Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target + case "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626": + return Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target + case "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627": + return Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target + case "Cannot_assign_to_0_because_it_is_an_enum_2628": + return Cannot_assign_to_0_because_it_is_an_enum + case "Cannot_assign_to_0_because_it_is_a_class_2629": + return Cannot_assign_to_0_because_it_is_a_class + case "Cannot_assign_to_0_because_it_is_a_function_2630": + return Cannot_assign_to_0_because_it_is_a_function + case "Cannot_assign_to_0_because_it_is_a_namespace_2631": + return Cannot_assign_to_0_because_it_is_a_namespace + case "Cannot_assign_to_0_because_it_is_an_import_2632": + return Cannot_assign_to_0_because_it_is_an_import + case "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633": + return JSX_property_access_expressions_cannot_include_JSX_namespace_names + case "_0_index_signatures_are_incompatible_2634": + return X_0_index_signatures_are_incompatible + case "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635": + return Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable + case "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636": + return Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation + case "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": + return Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types + case "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638": + return Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator + case "React_components_cannot_include_JSX_namespace_names_2639": + return React_components_cannot_include_JSX_namespace_names + case "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649": + return Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity + case "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650": + return Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more + case "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": + return A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums + case "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": + return Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead + case "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": + return Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1 + case "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654": + return Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2 + case "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655": + return Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more + case "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656": + return Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1 + case "JSX_expressions_must_have_one_parent_element_2657": + return JSX_expressions_must_have_one_parent_element + case "Type_0_provides_no_match_for_the_signature_1_2658": + return Type_0_provides_no_match_for_the_signature_1 + case "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659": + return X_super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher + case "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660": + return X_super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions + case "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661": + return Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module + case "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": + return Cannot_find_name_0_Did_you_mean_the_static_member_1_0 + case "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": + return Cannot_find_name_0_Did_you_mean_the_instance_member_this_0 + case "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664": + return Invalid_module_name_in_augmentation_module_0_cannot_be_found + case "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665": + return Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented + case "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666": + return Exports_and_export_assignments_are_not_permitted_in_module_augmentations + case "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": + return Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module + case "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": + return X_export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible + case "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669": + return Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations + case "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670": + return Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context + case "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671": + return Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity + case "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672": + return Cannot_assign_a_0_constructor_type_to_a_1_constructor_type + case "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": + return Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration + case "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": + return Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration + case "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675": + return Cannot_extend_a_class_0_Class_constructor_is_marked_as_private + case "Accessors_must_both_be_abstract_or_non_abstract_2676": + return Accessors_must_both_be_abstract_or_non_abstract + case "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": + return A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type + case "Type_0_is_not_comparable_to_type_1_2678": + return Type_0_is_not_comparable_to_type_1 + case "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679": + return A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void + case "A_0_parameter_must_be_the_first_parameter_2680": + return A_0_parameter_must_be_the_first_parameter + case "A_constructor_cannot_have_a_this_parameter_2681": + return A_constructor_cannot_have_a_this_parameter + case "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683": + return X_this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation + case "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684": + return The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1 + case "The_this_types_of_each_signature_are_incompatible_2685": + return The_this_types_of_each_signature_are_incompatible + case "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": + return X_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead + case "All_declarations_of_0_must_have_identical_modifiers_2687": + return All_declarations_of_0_must_have_identical_modifiers + case "Cannot_find_type_definition_file_for_0_2688": + return Cannot_find_type_definition_file_for_0 + case "Cannot_extend_an_interface_0_Did_you_mean_implements_2689": + return Cannot_extend_an_interface_0_Did_you_mean_implements + case "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": + return X_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0 + case "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692": + return X_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible + case "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": + return X_0_only_refers_to_a_type_but_is_being_used_as_a_value_here + case "Namespace_0_has_no_exported_member_1_2694": + return Namespace_0_has_no_exported_member_1 + case "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695": + return Left_side_of_comma_operator_is_unused_and_has_no_side_effects + case "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696": + return The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead + case "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": + return An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option + case "Spread_types_may_only_be_created_from_object_types_2698": + return Spread_types_may_only_be_created_from_object_types + case "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699": + return Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1 + case "Rest_types_may_only_be_created_from_object_types_2700": + return Rest_types_may_only_be_created_from_object_types + case "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701": + return The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access + case "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": + return X_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here + case "The_operand_of_a_delete_operator_must_be_a_property_reference_2703": + return The_operand_of_a_delete_operator_must_be_a_property_reference + case "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704": + return The_operand_of_a_delete_operator_cannot_be_a_read_only_property + case "An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_2705": + return An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option + case "Required_type_parameters_may_not_follow_optional_type_parameters_2706": + return Required_type_parameters_may_not_follow_optional_type_parameters + case "Generic_type_0_requires_between_1_and_2_type_arguments_2707": + return Generic_type_0_requires_between_1_and_2_type_arguments + case "Cannot_use_namespace_0_as_a_value_2708": + return Cannot_use_namespace_0_as_a_value + case "Cannot_use_namespace_0_as_a_type_2709": + return Cannot_use_namespace_0_as_a_type + case "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": + return X_0_are_specified_twice_The_attribute_named_0_will_be_overwritten + case "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711": + return A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option + case "A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_t_2712": + return A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option + case "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": + return Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1 + case "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714": + return The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context + case "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": + return Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor + case "Type_parameter_0_has_a_circular_default_2716": + return Type_parameter_0_has_a_circular_default + case "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": + return Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 + case "Duplicate_property_0_2718": + return Duplicate_property_0 + case "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": + return Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated + case "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": + return Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass + case "Cannot_invoke_an_object_which_is_possibly_null_2721": + return Cannot_invoke_an_object_which_is_possibly_null + case "Cannot_invoke_an_object_which_is_possibly_undefined_2722": + return Cannot_invoke_an_object_which_is_possibly_undefined + case "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": + return Cannot_invoke_an_object_which_is_possibly_null_or_undefined + case "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": + return X_0_has_no_exported_member_named_1_Did_you_mean_2 + case "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725": + return Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0 + case "Cannot_find_lib_definition_for_0_2726": + return Cannot_find_lib_definition_for_0 + case "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": + return Cannot_find_lib_definition_for_0_Did_you_mean_1 + case "_0_is_declared_here_2728": + return X_0_is_declared_here + case "Property_0_is_used_before_its_initialization_2729": + return Property_0_is_used_before_its_initialization + case "An_arrow_function_cannot_have_a_this_parameter_2730": + return An_arrow_function_cannot_have_a_this_parameter + case "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731": + return Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String + case "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": + return Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension + case "Property_0_was_also_declared_here_2733": + return Property_0_was_also_declared_here + case "Are_you_missing_a_semicolon_2734": + return Are_you_missing_a_semicolon + case "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735": + return Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1 + case "Operator_0_cannot_be_applied_to_type_1_2736": + return Operator_0_cannot_be_applied_to_type_1 + case "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737": + return BigInt_literals_are_not_available_when_targeting_lower_than_ES2020 + case "An_outer_value_of_this_is_shadowed_by_this_container_2738": + return An_outer_value_of_this_is_shadowed_by_this_container + case "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739": + return Type_0_is_missing_the_following_properties_from_type_1_Colon_2 + case "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740": + return Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more + case "Property_0_is_missing_in_type_1_but_required_in_type_2_2741": + return Property_0_is_missing_in_type_1_but_required_in_type_2 + case "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": + return The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary + case "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743": + return No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments + case "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744": + return Type_parameter_defaults_can_only_reference_previously_declared_type_parameters + case "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745": + return This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided + case "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746": + return This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided + case "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747": + return X_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2 + case "Cannot_access_ambient_const_enums_when_0_is_enabled_2748": + return Cannot_access_ambient_const_enums_when_0_is_enabled + case "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": + return X_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0 + case "The_implementation_signature_is_declared_here_2750": + return The_implementation_signature_is_declared_here + case "Circularity_originates_in_type_at_this_location_2751": + return Circularity_originates_in_type_at_this_location + case "The_first_export_default_is_here_2752": + return The_first_export_default_is_here + case "Another_export_default_is_here_2753": + return Another_export_default_is_here + case "super_may_not_use_type_arguments_2754": + return X_super_may_not_use_type_arguments + case "No_constituent_of_type_0_is_callable_2755": + return No_constituent_of_type_0_is_callable + case "Not_all_constituents_of_type_0_are_callable_2756": + return Not_all_constituents_of_type_0_are_callable + case "Type_0_has_no_call_signatures_2757": + return Type_0_has_no_call_signatures + case "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758": + return Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other + case "No_constituent_of_type_0_is_constructable_2759": + return No_constituent_of_type_0_is_constructable + case "Not_all_constituents_of_type_0_are_constructable_2760": + return Not_all_constituents_of_type_0_are_constructable + case "Type_0_has_no_construct_signatures_2761": + return Type_0_has_no_construct_signatures + case "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762": + return Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other + case "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763": + return Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 + case "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764": + return Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 + case "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765": + return Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 + case "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766": + return Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 + case "The_0_property_of_an_iterator_must_be_a_method_2767": + return The_0_property_of_an_iterator_must_be_a_method + case "The_0_property_of_an_async_iterator_must_be_a_method_2768": + return The_0_property_of_an_async_iterator_must_be_a_method + case "No_overload_matches_this_call_2769": + return No_overload_matches_this_call + case "The_last_overload_gave_the_following_error_2770": + return The_last_overload_gave_the_following_error + case "The_last_overload_is_declared_here_2771": + return The_last_overload_is_declared_here + case "Overload_0_of_1_2_gave_the_following_error_2772": + return Overload_0_of_1_2_gave_the_following_error + case "Did_you_forget_to_use_await_2773": + return Did_you_forget_to_use_await + case "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": + return This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead + case "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": + return Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation + case "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": + return Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name + case "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777": + return The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access + case "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778": + return The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access + case "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": + return The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access + case "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780": + return The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access + case "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781": + return The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access + case "_0_needs_an_explicit_type_annotation_2782": + return X_0_needs_an_explicit_type_annotation + case "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": + return X_0_is_specified_more_than_once_so_this_usage_will_be_overwritten + case "get_and_set_accessors_cannot_declare_this_parameters_2784": + return X_get_and_set_accessors_cannot_declare_this_parameters + case "This_spread_always_overwrites_this_property_2785": + return This_spread_always_overwrites_this_property + case "_0_cannot_be_used_as_a_JSX_component_2786": + return X_0_cannot_be_used_as_a_JSX_component + case "Its_return_type_0_is_not_a_valid_JSX_element_2787": + return Its_return_type_0_is_not_a_valid_JSX_element + case "Its_instance_type_0_is_not_a_valid_JSX_element_2788": + return Its_instance_type_0_is_not_a_valid_JSX_element + case "Its_element_type_0_is_not_a_valid_JSX_element_2789": + return Its_element_type_0_is_not_a_valid_JSX_element + case "The_operand_of_a_delete_operator_must_be_optional_2790": + return The_operand_of_a_delete_operator_must_be_optional + case "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791": + return Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later + case "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792": + return Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option + case "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": + return The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible + case "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": + return Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise + case "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": + return The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types + case "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": + return It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked + case "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797": + return A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract + case "The_declaration_was_marked_as_deprecated_here_2798": + return The_declaration_was_marked_as_deprecated_here + case "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799": + return Type_produces_a_tuple_type_that_is_too_large_to_represent + case "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800": + return Expression_produces_a_tuple_type_that_is_too_large_to_represent + case "This_condition_will_always_return_true_since_this_0_is_always_defined_2801": + return This_condition_will_always_return_true_since_this_0_is_always_defined + case "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802": + return Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher + case "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803": + return Cannot_assign_to_private_method_0_Private_methods_are_not_writable + case "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804": + return Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name + case "Private_accessor_was_defined_without_a_getter_2806": + return Private_accessor_was_defined_without_a_getter + case "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": + return This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0 + case "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808": + return A_get_accessor_must_be_at_least_as_accessible_as_the_setter + case "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809": + return Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses + case "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810": + return Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments + case "Initializer_for_property_0_2811": + return Initializer_for_property_0 + case "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812": + return Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom + case "Class_declaration_cannot_implement_overload_list_for_0_2813": + return Class_declaration_cannot_implement_overload_list_for_0 + case "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814": + return Function_with_bodies_can_only_merge_with_classes_that_are_ambient + case "arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks_2815": + return X_arguments_cannot_be_referenced_in_property_initializers_or_class_static_initialization_blocks + case "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816": + return Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class + case "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817": + return Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block + case "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818": + return Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers + case "Namespace_name_cannot_be_0_2819": + return Namespace_name_cannot_be_0 + case "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820": + return Type_0_is_not_assignable_to_type_1_Did_you_mean_2 + case "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2821": + return Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve + case "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822": + return Import_assertions_cannot_be_used_with_type_only_imports_or_exports + case "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext__2823": + return Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve + case "Cannot_find_namespace_0_Did_you_mean_1_2833": + return Cannot_find_namespace_0_Did_you_mean_1 + case "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834": + return Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path + case "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835": + return Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0 + case "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836": + return Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls + case "Import_assertion_values_must_be_string_literal_expressions_2837": + return Import_assertion_values_must_be_string_literal_expressions + case "All_declarations_of_0_must_have_identical_constraints_2838": + return All_declarations_of_0_must_have_identical_constraints + case "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839": + return This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value + case "An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840": + return An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types + case "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842": + return X_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation + case "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843": + return We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here + case "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844": + return Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor + case "This_condition_will_always_return_0_2845": + return This_condition_will_always_return_0 + case "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846": + return A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead + case "The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848": + return The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression + case "Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849": + return Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1 + case "The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850": + return The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined + case "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851": + return The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined + case "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852": + return X_await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules + case "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853": + return X_await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module + case "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854": + return Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher + case "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855": + return Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super + case "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856": + return Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls + case "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857": + return Import_attributes_cannot_be_used_with_type_only_imports_or_exports + case "Import_attribute_values_must_be_string_literal_expressions_2858": + return Import_attribute_values_must_be_string_literal_expressions + case "Excessive_complexity_comparing_types_0_and_1_2859": + return Excessive_complexity_comparing_types_0_and_1 + case "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860": + return The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method + case "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861": + return An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression + case "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862": + return Type_0_is_generic_and_can_only_be_indexed_for_reading + case "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863": + return A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values + case "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864": + return A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types + case "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865": + return Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled + case "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866": + return Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun + case "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868": + return Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig + case "Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish_2869": + return Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish + case "This_binary_expression_is_never_nullish_Are_you_missing_parentheses_2870": + return This_binary_expression_is_never_nullish_Are_you_missing_parentheses + case "This_expression_is_always_nullish_2871": + return This_expression_is_always_nullish + case "This_kind_of_expression_is_always_truthy_2872": + return This_kind_of_expression_is_always_truthy + case "This_kind_of_expression_is_always_falsy_2873": + return This_kind_of_expression_is_always_falsy + case "This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found_2874": + return This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found + case "This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_fo_2875": + return This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed + case "This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolv_2876": + return This_relative_import_path_is_unsafe_to_rewrite_because_it_looks_like_a_file_name_but_actually_resolves_to_0 + case "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877": + return This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path + case "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878": + return This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files + case "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879": + return Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found + case "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880": + return Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert + case "This_expression_is_never_nullish_2881": + return This_expression_is_never_nullish + case "Import_declaration_0_is_using_private_name_1_4000": + return Import_declaration_0_is_using_private_name_1 + case "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": + return Type_parameter_0_of_exported_class_has_or_is_using_private_name_1 + case "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004": + return Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1 + case "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": + return Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 + case "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": + return Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 + case "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010": + return Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 + case "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012": + return Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 + case "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014": + return Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 + case "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016": + return Type_parameter_0_of_exported_function_has_or_is_using_private_name_1 + case "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": + return Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 + case "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": + return X_extends_clause_of_exported_class_0_has_or_is_using_private_name_1 + case "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": + return X_extends_clause_of_exported_class_has_or_is_using_private_name_0 + case "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": + return X_extends_clause_of_exported_interface_0_has_or_is_using_private_name_1 + case "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": + return Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": + return Exported_variable_0_has_or_is_using_name_1_from_private_module_2 + case "Exported_variable_0_has_or_is_using_private_name_1_4025": + return Exported_variable_0_has_or_is_using_private_name_1 + case "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026": + return Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027": + return Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028": + return Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 + case "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029": + return Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030": + return Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031": + return Public_property_0_of_exported_class_has_or_is_using_private_name_1 + case "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032": + return Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033": + return Property_0_of_exported_interface_has_or_is_using_private_name_1 + case "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034": + return Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": + return Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1 + case "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036": + return Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037": + return Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1 + case "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": + return Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": + return Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": + return Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1 + case "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041": + return Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042": + return Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043": + return Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1 + case "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044": + return Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045": + return Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0 + case "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046": + return Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047": + return Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0 + case "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048": + return Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049": + return Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0 + case "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050": + return Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named + case "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051": + return Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": + return Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0 + case "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053": + return Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named + case "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054": + return Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055": + return Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0 + case "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056": + return Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057": + return Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0 + case "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058": + return Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named + case "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059": + return Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 + case "Return_type_of_exported_function_has_or_is_using_private_name_0_4060": + return Return_type_of_exported_function_has_or_is_using_private_name_0 + case "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061": + return Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062": + return Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063": + return Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1 + case "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064": + return Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065": + return Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 + case "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066": + return Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067": + return Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 + case "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068": + return Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069": + return Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070": + return Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 + case "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071": + return Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072": + return Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073": + return Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 + case "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074": + return Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075": + return Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 + case "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076": + return Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077": + return Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078": + return Parameter_0_of_exported_function_has_or_is_using_private_name_1 + case "Exported_type_alias_0_has_or_is_using_private_name_1_4081": + return Exported_type_alias_0_has_or_is_using_private_name_1 + case "Default_export_of_the_module_has_or_is_using_private_name_0_4082": + return Default_export_of_the_module_has_or_is_using_private_name_0 + case "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083": + return Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1 + case "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084": + return Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 + case "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085": + return Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1 + case "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091": + return Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092": + return Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1 + case "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094": + return Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected + case "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095": + return Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096": + return Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097": + return Public_static_method_0_of_exported_class_has_or_is_using_private_name_1 + case "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": + return Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": + return Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 + case "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": + return Public_method_0_of_exported_class_has_or_is_using_private_name_1 + case "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101": + return Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 + case "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102": + return Method_0_of_exported_interface_has_or_is_using_private_name_1 + case "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103": + return Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1 + case "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104": + return The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1 + case "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": + return Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter + case "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106": + return Parameter_0_of_accessor_has_or_is_using_private_name_1 + case "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107": + return Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 + case "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108": + return Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named + case "Type_arguments_for_0_circularly_reference_themselves_4109": + return Type_arguments_for_0_circularly_reference_themselves + case "Tuple_type_arguments_circularly_reference_themselves_4110": + return Tuple_type_arguments_circularly_reference_themselves + case "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111": + return Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0 + case "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112": + return This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class + case "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113": + return This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0 + case "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114": + return This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0 + case "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115": + return This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 + case "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116": + return This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0 + case "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117": + return This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 + case "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118": + return The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized + case "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119": + return This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 + case "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120": + return This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 + case "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121": + return This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class + case "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122": + return This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 + case "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123": + return This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 + case "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124": + return Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next + case "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125": + return Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given + case "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126": + return One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value + case "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127": + return This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic + case "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128": + return This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic + case "The_current_host_does_not_support_the_0_option_5001": + return The_current_host_does_not_support_the_0_option + case "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": + return Cannot_find_the_common_subdirectory_path_for_the_input_files + case "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": + return File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0 + case "Cannot_read_file_0_Colon_1_5012": + return Cannot_read_file_0_Colon_1 + case "Unknown_compiler_option_0_5023": + return Unknown_compiler_option_0 + case "Compiler_option_0_requires_a_value_of_type_1_5024": + return Compiler_option_0_requires_a_value_of_type_1 + case "Unknown_compiler_option_0_Did_you_mean_1_5025": + return Unknown_compiler_option_0_Did_you_mean_1 + case "Could_not_write_file_0_Colon_1_5033": + return Could_not_write_file_0_Colon_1 + case "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": + return Option_project_cannot_be_mixed_with_source_files_on_a_command_line + case "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": + return Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher + case "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": + return Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided + case "Option_0_cannot_be_specified_without_specifying_option_1_5052": + return Option_0_cannot_be_specified_without_specifying_option_1 + case "Option_0_cannot_be_specified_with_option_1_5053": + return Option_0_cannot_be_specified_with_option_1 + case "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054": + return A_tsconfig_json_file_is_already_defined_at_Colon_0 + case "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": + return Cannot_write_file_0_because_it_would_overwrite_input_file + case "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056": + return Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files + case "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057": + return Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0 + case "The_specified_path_does_not_exist_Colon_0_5058": + return The_specified_path_does_not_exist_Colon_0 + case "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": + return Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier + case "Pattern_0_can_have_at_most_one_Asterisk_character_5061": + return Pattern_0_can_have_at_most_one_Asterisk_character + case "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062": + return Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character + case "Substitutions_for_pattern_0_should_be_an_array_5063": + return Substitutions_for_pattern_0_should_be_an_array + case "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": + return Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2 + case "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": + return File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0 + case "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066": + return Substitutions_for_pattern_0_shouldn_t_be_an_empty_array + case "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": + return Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name + case "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": + return Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig + case "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069": + return Option_0_cannot_be_specified_without_specifying_option_1_or_option_2 + case "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070": + return Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic + case "Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071": + return Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd + case "Unknown_build_option_0_5072": + return Unknown_build_option_0 + case "Build_option_0_requires_a_value_of_type_1_5073": + return Build_option_0_requires_a_value_of_type_1 + case "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": + return Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified + case "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075": + return X_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2 + case "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076": + return X_0_and_1_operations_cannot_be_mixed_without_parentheses + case "Unknown_build_option_0_Did_you_mean_1_5077": + return Unknown_build_option_0_Did_you_mean_1 + case "Unknown_watch_option_0_5078": + return Unknown_watch_option_0 + case "Unknown_watch_option_0_Did_you_mean_1_5079": + return Unknown_watch_option_0_Did_you_mean_1 + case "Watch_option_0_requires_a_value_of_type_1_5080": + return Watch_option_0_requires_a_value_of_type_1 + case "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081": + return Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0 + case "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": + return X_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1 + case "Cannot_read_file_0_5083": + return Cannot_read_file_0 + case "A_tuple_member_cannot_be_both_optional_and_rest_5085": + return A_tuple_member_cannot_be_both_optional_and_rest + case "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086": + return A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type + case "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087": + return A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type + case "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": + return The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary + case "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": + return Option_0_cannot_be_specified_when_option_jsx_is_1 + case "Non_relative_paths_are_not_allowed_Did_you_forget_a_leading_Slash_5090": + return Non_relative_paths_are_not_allowed_Did_you_forget_a_leading_Slash + case "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091": + return Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled + case "The_root_value_of_a_0_file_must_be_an_object_5092": + return The_root_value_of_a_0_file_must_be_an_object + case "Compiler_option_0_may_only_be_used_with_build_5093": + return Compiler_option_0_may_only_be_used_with_build + case "Compiler_option_0_may_not_be_used_with_build_5094": + return Compiler_option_0_may_not_be_used_with_build + case "Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095": + return Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later + case "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096": + return Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set + case "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097": + return An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled + case "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098": + return Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler + case "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101": + return Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error + case "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102": + return Option_0_has_been_removed_Please_remove_it_from_your_configuration + case "Invalid_value_for_ignoreDeprecations_5103": + return Invalid_value_for_ignoreDeprecations + case "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104": + return Option_0_is_redundant_and_cannot_be_specified_with_option_1 + case "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105": + return Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System + case "Use_0_instead_5106": + return Use_0_instead + case "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107": + return Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error + case "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108": + return Option_0_1_has_been_removed_Please_remove_it_from_your_configuration + case "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109": + return Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1 + case "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110": + return Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1 + case "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": + return Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information + case "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": + return Generates_a_sourcemap_for_each_corresponding_d_ts_file + case "Concatenate_and_emit_output_to_single_file_6001": + return Concatenate_and_emit_output_to_single_file + case "Generates_corresponding_d_ts_file_6002": + return Generates_corresponding_d_ts_file + case "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": + return Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations + case "Watch_input_files_6005": + return Watch_input_files + case "Redirect_output_structure_to_the_directory_6006": + return Redirect_output_structure_to_the_directory + case "Do_not_erase_const_enum_declarations_in_generated_code_6007": + return Do_not_erase_const_enum_declarations_in_generated_code + case "Do_not_emit_outputs_if_any_errors_were_reported_6008": + return Do_not_emit_outputs_if_any_errors_were_reported + case "Do_not_emit_comments_to_output_6009": + return Do_not_emit_comments_to_output + case "Do_not_emit_outputs_6010": + return Do_not_emit_outputs + case "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": + return Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking + case "Skip_type_checking_of_declaration_files_6012": + return Skip_type_checking_of_declaration_files + case "Do_not_resolve_the_real_path_of_symlinks_6013": + return Do_not_resolve_the_real_path_of_symlinks + case "Only_emit_d_ts_declaration_files_6014": + return Only_emit_d_ts_declaration_files + case "Specify_ECMAScript_target_version_6015": + return Specify_ECMAScript_target_version + case "Specify_module_code_generation_6016": + return Specify_module_code_generation + case "Print_this_message_6017": + return Print_this_message + case "Print_the_compiler_s_version_6019": + return Print_the_compiler_s_version + case "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020": + return Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json + case "Syntax_Colon_0_6023": + return Syntax_Colon_0 + case "options_6024": + return X_options + case "file_6025": + return X_file + case "Examples_Colon_0_6026": + return Examples_Colon_0 + case "Options_Colon_6027": + return Options_Colon + case "Version_0_6029": + return Version_0 + case "Insert_command_line_options_and_files_from_a_file_6030": + return Insert_command_line_options_and_files_from_a_file + case "Starting_compilation_in_watch_mode_6031": + return Starting_compilation_in_watch_mode + case "File_change_detected_Starting_incremental_compilation_6032": + return File_change_detected_Starting_incremental_compilation + case "KIND_6034": + return KIND + case "FILE_6035": + return FILE + case "VERSION_6036": + return VERSION + case "LOCATION_6037": + return LOCATION + case "DIRECTORY_6038": + return DIRECTORY + case "STRATEGY_6039": + return STRATEGY + case "FILE_OR_DIRECTORY_6040": + return FILE_OR_DIRECTORY + case "Errors_Files_6041": + return Errors_Files + case "Generates_corresponding_map_file_6043": + return Generates_corresponding_map_file + case "Compiler_option_0_expects_an_argument_6044": + return Compiler_option_0_expects_an_argument + case "Unterminated_quoted_string_in_response_file_0_6045": + return Unterminated_quoted_string_in_response_file_0 + case "Argument_for_0_option_must_be_Colon_1_6046": + return Argument_for_0_option_must_be_Colon_1 + case "Locale_must_be_an_IETF_BCP_47_language_tag_Examples_Colon_0_1_6048": + return Locale_must_be_an_IETF_BCP_47_language_tag_Examples_Colon_0_1 + case "Unable_to_open_file_0_6050": + return Unable_to_open_file_0 + case "Corrupted_locale_file_0_6051": + return Corrupted_locale_file_0 + case "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": + return Raise_error_on_expressions_and_declarations_with_an_implied_any_type + case "File_0_not_found_6053": + return File_0_not_found + case "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054": + return File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1 + case "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055": + return Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures + case "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056": + return Do_not_emit_declarations_for_code_that_has_an_internal_annotation + case "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": + return Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir + case "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059": + return File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files + case "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": + return Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix + case "NEWLINE_6061": + return NEWLINE + case "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": + return Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line + case "Enables_experimental_support_for_ES7_decorators_6065": + return Enables_experimental_support_for_ES7_decorators + case "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": + return Enables_experimental_support_for_emitting_type_metadata_for_decorators + case "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070": + return Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file + case "Successfully_created_a_tsconfig_json_file_6071": + return Successfully_created_a_tsconfig_json_file + case "Suppress_excess_property_checks_for_object_literals_6072": + return Suppress_excess_property_checks_for_object_literals + case "Stylize_errors_and_messages_using_color_and_context_experimental_6073": + return Stylize_errors_and_messages_using_color_and_context_experimental + case "Do_not_report_errors_on_unused_labels_6074": + return Do_not_report_errors_on_unused_labels + case "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": + return Report_error_when_not_all_code_paths_in_function_return_a_value + case "Report_errors_for_fallthrough_cases_in_switch_statement_6076": + return Report_errors_for_fallthrough_cases_in_switch_statement + case "Do_not_report_errors_on_unreachable_code_6077": + return Do_not_report_errors_on_unreachable_code + case "Disallow_inconsistently_cased_references_to_the_same_file_6078": + return Disallow_inconsistently_cased_references_to_the_same_file + case "Specify_library_files_to_be_included_in_the_compilation_6079": + return Specify_library_files_to_be_included_in_the_compilation + case "Specify_JSX_code_generation_6080": + return Specify_JSX_code_generation + case "Only_amd_and_system_modules_are_supported_alongside_0_6082": + return Only_amd_and_system_modules_are_supported_alongside_0 + case "Base_directory_to_resolve_non_absolute_module_names_6083": + return Base_directory_to_resolve_non_absolute_module_names + case "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": + return Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit + case "Enable_tracing_of_the_name_resolution_process_6085": + return Enable_tracing_of_the_name_resolution_process + case "Resolving_module_0_from_1_6086": + return Resolving_module_0_from_1 + case "Explicitly_specified_module_resolution_kind_Colon_0_6087": + return Explicitly_specified_module_resolution_kind_Colon_0 + case "Module_resolution_kind_is_not_specified_using_0_6088": + return Module_resolution_kind_is_not_specified_using_0 + case "Module_name_0_was_successfully_resolved_to_1_6089": + return Module_name_0_was_successfully_resolved_to_1 + case "Module_name_0_was_not_resolved_6090": + return Module_name_0_was_not_resolved + case "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091": + return X_paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0 + case "Module_name_0_matched_pattern_1_6092": + return Module_name_0_matched_pattern_1 + case "Trying_substitution_0_candidate_module_location_Colon_1_6093": + return Trying_substitution_0_candidate_module_location_Colon_1 + case "Resolving_module_name_0_relative_to_base_url_1_2_6094": + return Resolving_module_name_0_relative_to_base_url_1_2 + case "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095": + return Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1 + case "File_0_does_not_exist_6096": + return File_0_does_not_exist + case "File_0_exists_use_it_as_a_name_resolution_result_6097": + return File_0_exists_use_it_as_a_name_resolution_result + case "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098": + return Loading_module_0_from_node_modules_folder_target_file_types_Colon_1 + case "Found_package_json_at_0_6099": + return Found_package_json_at_0 + case "package_json_does_not_have_a_0_field_6100": + return X_package_json_does_not_have_a_0_field + case "package_json_has_0_field_1_that_references_2_6101": + return X_package_json_has_0_field_1_that_references_2 + case "Allow_javascript_files_to_be_compiled_6102": + return Allow_javascript_files_to_be_compiled + case "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": + return Checking_if_0_is_the_longest_matching_prefix_for_1_2 + case "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105": + return Expected_type_of_0_field_in_package_json_to_be_1_got_2 + case "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106": + return X_baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1 + case "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": + return X_rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0 + case "Longest_matching_prefix_for_0_is_1_6108": + return Longest_matching_prefix_for_0_is_1 + case "Loading_0_from_the_root_dir_1_candidate_location_2_6109": + return Loading_0_from_the_root_dir_1_candidate_location_2 + case "Trying_other_entries_in_rootDirs_6110": + return Trying_other_entries_in_rootDirs + case "Module_resolution_using_rootDirs_has_failed_6111": + return Module_resolution_using_rootDirs_has_failed + case "Do_not_emit_use_strict_directives_in_module_output_6112": + return Do_not_emit_use_strict_directives_in_module_output + case "Enable_strict_null_checks_6113": + return Enable_strict_null_checks + case "Unknown_option_excludes_Did_you_mean_exclude_6114": + return Unknown_option_excludes_Did_you_mean_exclude + case "Raise_error_on_this_expressions_with_an_implied_any_type_6115": + return Raise_error_on_this_expressions_with_an_implied_any_type + case "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116": + return Resolving_type_reference_directive_0_containing_file_1_root_directory_2 + case "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": + return Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2 + case "Type_reference_directive_0_was_not_resolved_6120": + return Type_reference_directive_0_was_not_resolved + case "Resolving_with_primary_search_path_0_6121": + return Resolving_with_primary_search_path_0 + case "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": + return Root_directory_cannot_be_determined_skipping_primary_search_paths + case "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123": + return Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set + case "Type_declaration_files_to_be_included_in_compilation_6124": + return Type_declaration_files_to_be_included_in_compilation + case "Looking_up_in_node_modules_folder_initial_location_0_6125": + return Looking_up_in_node_modules_folder_initial_location_0 + case "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": + return Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder + case "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127": + return Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1 + case "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128": + return Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set + case "Resolving_real_path_for_0_result_1_6130": + return Resolving_real_path_for_0_result_1 + case "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131": + return Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system + case "File_name_0_has_a_1_extension_stripping_it_6132": + return File_name_0_has_a_1_extension_stripping_it + case "_0_is_declared_but_its_value_is_never_read_6133": + return X_0_is_declared_but_its_value_is_never_read + case "Report_errors_on_unused_locals_6134": + return Report_errors_on_unused_locals + case "Report_errors_on_unused_parameters_6135": + return Report_errors_on_unused_parameters + case "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": + return The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + case "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": + return Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1 + case "Property_0_is_declared_but_its_value_is_never_read_6138": + return Property_0_is_declared_but_its_value_is_never_read + case "Import_emit_helpers_from_tslib_6139": + return Import_emit_helpers_from_tslib + case "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140": + return Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2 + case "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": + return Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + case "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142": + return Module_0_was_resolved_to_1_but_jsx_is_not_set + case "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144": + return Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1 + case "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": + return Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + case "Resolution_for_module_0_was_found_in_cache_from_location_1_6147": + return Resolution_for_module_0_was_found_in_cache_from_location_1 + case "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": + return Directory_0_does_not_exist_skipping_all_lookups_in_it + case "Show_diagnostic_information_6149": + return Show_diagnostic_information + case "Show_verbose_diagnostic_information_6150": + return Show_verbose_diagnostic_information + case "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": + return Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + case "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": + return Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + case "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": + return Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule + case "Print_names_of_generated_files_part_of_the_compilation_6154": + return Print_names_of_generated_files_part_of_the_compilation + case "Print_names_of_files_part_of_the_compilation_6155": + return Print_names_of_files_part_of_the_compilation + case "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": + return The_locale_used_when_displaying_messages_to_the_user_e_g_en_us + case "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157": + return Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + case "Do_not_include_the_default_library_file_lib_d_ts_6158": + return Do_not_include_the_default_library_file_lib_d_ts + case "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159": + return Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files + case "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": + return Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files + case "List_of_folders_to_include_type_definitions_from_6161": + return List_of_folders_to_include_type_definitions_from + case "Disable_size_limitations_on_JavaScript_projects_6162": + return Disable_size_limitations_on_JavaScript_projects + case "The_character_set_of_the_input_files_6163": + return The_character_set_of_the_input_files + case "Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164": + return Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1 + case "Do_not_truncate_error_messages_6165": + return Do_not_truncate_error_messages + case "Output_directory_for_generated_declaration_files_6166": + return Output_directory_for_generated_declaration_files + case "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167": + return A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl + case "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": + return List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime + case "Show_all_compiler_options_6169": + return Show_all_compiler_options + case "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": + return Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file + case "Command_line_Options_6171": + return Command_line_Options + case "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_6179": + return Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5 + case "Enable_all_strict_type_checking_options_6180": + return Enable_all_strict_type_checking_options + case "Scoped_package_detected_looking_in_0_6182": + return Scoped_package_detected_looking_in_0 + case "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183": + return Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 + case "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184": + return Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 + case "Enable_strict_checking_of_function_types_6186": + return Enable_strict_checking_of_function_types + case "Enable_strict_checking_of_property_initialization_in_classes_6187": + return Enable_strict_checking_of_property_initialization_in_classes + case "Numeric_separators_are_not_allowed_here_6188": + return Numeric_separators_are_not_allowed_here + case "Multiple_consecutive_numeric_separators_are_not_permitted_6189": + return Multiple_consecutive_numeric_separators_are_not_permitted + case "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191": + return Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen + case "All_imports_in_import_declaration_are_unused_6192": + return All_imports_in_import_declaration_are_unused + case "Found_1_error_Watching_for_file_changes_6193": + return Found_1_error_Watching_for_file_changes + case "Found_0_errors_Watching_for_file_changes_6194": + return Found_0_errors_Watching_for_file_changes + case "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": + return Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols + case "_0_is_declared_but_never_used_6196": + return X_0_is_declared_but_never_used + case "Include_modules_imported_with_json_extension_6197": + return Include_modules_imported_with_json_extension + case "All_destructured_elements_are_unused_6198": + return All_destructured_elements_are_unused + case "All_variables_are_unused_6199": + return All_variables_are_unused + case "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": + return Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0 + case "Conflicts_are_in_this_file_6201": + return Conflicts_are_in_this_file + case "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": + return Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0 + case "_0_was_also_declared_here_6203": + return X_0_was_also_declared_here + case "and_here_6204": + return X_and_here + case "All_type_parameters_are_unused_6205": + return All_type_parameters_are_unused + case "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206": + return X_package_json_has_a_typesVersions_field_with_version_specific_path_mappings + case "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207": + return X_package_json_does_not_have_a_typesVersions_entry_that_matches_version_0 + case "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208": + return X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2 + case "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209": + return X_package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range + case "An_argument_for_0_was_not_provided_6210": + return An_argument_for_0_was_not_provided + case "An_argument_matching_this_binding_pattern_was_not_provided_6211": + return An_argument_matching_this_binding_pattern_was_not_provided + case "Did_you_mean_to_call_this_expression_6212": + return Did_you_mean_to_call_this_expression + case "Did_you_mean_to_use_new_with_this_expression_6213": + return Did_you_mean_to_use_new_with_this_expression + case "Enable_strict_bind_call_and_apply_methods_on_functions_6214": + return Enable_strict_bind_call_and_apply_methods_on_functions + case "Using_compiler_options_of_project_reference_redirect_0_6215": + return Using_compiler_options_of_project_reference_redirect_0 + case "Found_1_error_6216": + return Found_1_error + case "Found_0_errors_6217": + return Found_0_errors + case "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218": + return Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2 + case "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": + return Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3 + case "package_json_had_a_falsy_0_field_6220": + return X_package_json_had_a_falsy_0_field + case "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221": + return Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects + case "Emit_class_fields_with_Define_instead_of_Set_6222": + return Emit_class_fields_with_Define_instead_of_Set + case "Generates_a_CPU_profile_6223": + return Generates_a_CPU_profile + case "Disable_solution_searching_for_this_project_6224": + return Disable_solution_searching_for_this_project + case "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225": + return Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory + case "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226": + return Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling + case "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227": + return Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize + case "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229": + return Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3 + case "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": + return Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line + case "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": + return Could_not_resolve_the_path_0_with_the_extensions_Colon_1 + case "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232": + return Declaration_augments_declaration_in_another_file_This_cannot_be_serialized + case "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233": + return This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file + case "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": + return This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without + case "Disable_loading_referenced_projects_6235": + return Disable_loading_referenced_projects + case "Arguments_for_the_rest_parameter_0_were_not_provided_6236": + return Arguments_for_the_rest_parameter_0_were_not_provided + case "Generates_an_event_trace_and_a_list_of_types_6237": + return Generates_an_event_trace_and_a_list_of_types + case "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": + return Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react + case "File_0_exists_according_to_earlier_cached_lookups_6239": + return File_0_exists_according_to_earlier_cached_lookups + case "File_0_does_not_exist_according_to_earlier_cached_lookups_6240": + return File_0_does_not_exist_according_to_earlier_cached_lookups + case "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": + return Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1 + case "Resolving_type_reference_directive_0_containing_file_1_6242": + return Resolving_type_reference_directive_0_containing_file_1 + case "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243": + return Interpret_optional_property_types_as_written_rather_than_adding_undefined + case "Modules_6244": + return Modules + case "File_Management_6245": + return File_Management + case "Emit_6246": + return Emit + case "JavaScript_Support_6247": + return JavaScript_Support + case "Type_Checking_6248": + return Type_Checking + case "Editor_Support_6249": + return Editor_Support + case "Watch_and_Build_Modes_6250": + return Watch_and_Build_Modes + case "Compiler_Diagnostics_6251": + return Compiler_Diagnostics + case "Interop_Constraints_6252": + return Interop_Constraints + case "Backwards_Compatibility_6253": + return Backwards_Compatibility + case "Language_and_Environment_6254": + return Language_and_Environment + case "Projects_6255": + return Projects + case "Output_Formatting_6256": + return Output_Formatting + case "Completeness_6257": + return Completeness + case "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258": + return X_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file + case "Found_1_error_in_0_6259": + return Found_1_error_in_0 + case "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260": + return Found_0_errors_in_the_same_file_starting_at_Colon_1 + case "Found_0_errors_in_1_files_6261": + return Found_0_errors_in_1_files + case "File_name_0_has_a_1_extension_looking_up_2_instead_6262": + return File_name_0_has_a_1_extension_looking_up_2_instead + case "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263": + return Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set + case "Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264": + return Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present + case "Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265": + return Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder + case "Option_0_can_only_be_specified_on_command_line_6266": + return Option_0_can_only_be_specified_on_command_line + case "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270": + return Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve + case "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271": + return Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1 + case "Invalid_import_specifier_0_has_no_possible_resolutions_6272": + return Invalid_import_specifier_0_has_no_possible_resolutions + case "package_json_scope_0_has_no_imports_defined_6273": + return X_package_json_scope_0_has_no_imports_defined + case "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274": + return X_package_json_scope_0_explicitly_maps_specifier_1_to_null + case "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275": + return X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1 + case "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276": + return Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1 + case "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277": + return Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update + case "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278": + return There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings + case "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279": + return Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update + case "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280": + return There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler + case "package_json_has_a_peerDependencies_field_6281": + return X_package_json_has_a_peerDependencies_field + case "Found_peerDependency_0_with_1_version_6282": + return Found_peerDependency_0_with_1_version + case "Failed_to_find_peerDependency_0_6283": + return Failed_to_find_peerDependency_0 + case "File_Layout_6284": + return File_Layout + case "Environment_Settings_6285": + return Environment_Settings + case "See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule_6286": + return See_also_https_Colon_Slash_Slashaka_ms_Slashtsconfig_Slashmodule + case "For_nodejs_Colon_6287": + return For_nodejs_Colon + case "and_npm_install_D_types_Slashnode_6290": + return X_and_npm_install_D_types_Slashnode + case "Other_Outputs_6291": + return Other_Outputs + case "Stricter_Typechecking_Options_6292": + return Stricter_Typechecking_Options + case "Style_Options_6293": + return Style_Options + case "Recommended_Options_6294": + return Recommended_Options + case "Enable_project_compilation_6302": + return Enable_project_compilation + case "Composite_projects_may_not_disable_declaration_emit_6304": + return Composite_projects_may_not_disable_declaration_emit + case "Output_file_0_has_not_been_built_from_source_file_1_6305": + return Output_file_0_has_not_been_built_from_source_file_1 + case "Referenced_project_0_must_have_setting_composite_Colon_true_6306": + return Referenced_project_0_must_have_setting_composite_Colon_true + case "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307": + return File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern + case "Referenced_project_0_may_not_disable_emit_6310": + return Referenced_project_0_may_not_disable_emit + case "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350": + return Project_0_is_out_of_date_because_output_1_is_older_than_input_2 + case "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351": + return Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2 + case "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": + return Project_0_is_out_of_date_because_output_file_1_does_not_exist + case "Failed_to_delete_file_0_6353": + return Failed_to_delete_file_0 + case "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": + return Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies + case "Projects_in_this_build_Colon_0_6355": + return Projects_in_this_build_Colon_0 + case "A_non_dry_build_would_delete_the_following_files_Colon_0_6356": + return A_non_dry_build_would_delete_the_following_files_Colon_0 + case "A_non_dry_build_would_build_project_0_6357": + return A_non_dry_build_would_build_project_0 + case "Building_project_0_6358": + return Building_project_0 + case "Updating_output_timestamps_of_project_0_6359": + return Updating_output_timestamps_of_project_0 + case "Project_0_is_up_to_date_6361": + return Project_0_is_up_to_date + case "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362": + return Skipping_build_of_project_0_because_its_dependency_1_has_errors + case "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": + return Project_0_can_t_be_built_because_its_dependency_1_has_errors + case "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364": + return Build_one_or_more_projects_and_their_dependencies_if_out_of_date + case "Delete_the_outputs_of_all_projects_6365": + return Delete_the_outputs_of_all_projects + case "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367": + return Show_what_would_be_built_or_deleted_if_specified_with_clean + case "Option_build_must_be_the_first_command_line_argument_6369": + return Option_build_must_be_the_first_command_line_argument + case "Options_0_and_1_cannot_be_combined_6370": + return Options_0_and_1_cannot_be_combined + case "Updating_unchanged_output_timestamps_of_project_0_6371": + return Updating_unchanged_output_timestamps_of_project_0 + case "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374": + return A_non_dry_build_would_update_timestamps_for_output_of_project_0 + case "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377": + return Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1 + case "Composite_projects_may_not_disable_incremental_compilation_6379": + return Composite_projects_may_not_disable_incremental_compilation + case "Specify_file_to_store_incremental_compilation_information_6380": + return Specify_file_to_store_incremental_compilation_information + case "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381": + return Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2 + case "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382": + return Skipping_build_of_project_0_because_its_dependency_1_was_not_built + case "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": + return Project_0_can_t_be_built_because_its_dependency_1_was_not_built + case "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384": + return Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it + case "_0_is_deprecated_6385": + return X_0_is_deprecated + case "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": + return Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found + case "The_signature_0_of_1_is_deprecated_6387": + return The_signature_0_of_1_is_deprecated + case "Project_0_is_being_forcibly_rebuilt_6388": + return Project_0_is_being_forcibly_rebuilt + case "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389": + return Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved + case "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390": + return Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 + case "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391": + return Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 + case "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392": + return Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved + case "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393": + return Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 + case "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394": + return Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 + case "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395": + return Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved + case "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396": + return Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 + case "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397": + return Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 + case "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398": + return Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved + case "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399": + return Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted + case "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400": + return Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files + case "Project_0_is_out_of_date_because_config_file_does_not_exist_6401": + return Project_0_is_out_of_date_because_config_file_does_not_exist + case "Resolving_in_0_mode_with_conditions_1_6402": + return Resolving_in_0_mode_with_conditions_1 + case "Matched_0_condition_1_6403": + return Matched_0_condition_1 + case "Using_0_subpath_1_with_target_2_6404": + return Using_0_subpath_1_with_target_2 + case "Saw_non_matching_condition_0_6405": + return Saw_non_matching_condition_0 + case "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406": + return Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions + case "Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407": + return Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set + case "Use_the_package_json_exports_field_when_resolving_package_imports_6408": + return Use_the_package_json_exports_field_when_resolving_package_imports + case "Use_the_package_json_imports_field_when_resolving_imports_6409": + return Use_the_package_json_imports_field_when_resolving_imports + case "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410": + return Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports + case "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411": + return X_true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false + case "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412": + return Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more + case "Entering_conditional_exports_6413": + return Entering_conditional_exports + case "Resolved_under_condition_0_6414": + return Resolved_under_condition_0 + case "Failed_to_resolve_under_condition_0_6415": + return Failed_to_resolve_under_condition_0 + case "Exiting_conditional_exports_6416": + return Exiting_conditional_exports + case "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417": + return Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0 + case "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418": + return Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0 + case "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419": + return Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors + case "Project_0_is_out_of_date_because_input_1_does_not_exist_6420": + return Project_0_is_out_of_date_because_input_1_does_not_exist + case "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421": + return Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files + case "Project_0_is_out_of_date_because_it_has_errors_6423": + return Project_0_is_out_of_date_because_it_has_errors + case "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500": + return The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1 + case "The_expected_type_comes_from_this_index_signature_6501": + return The_expected_type_comes_from_this_index_signature + case "The_expected_type_comes_from_the_return_type_of_this_signature_6502": + return The_expected_type_comes_from_the_return_type_of_this_signature + case "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503": + return Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing + case "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504": + return File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option + case "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505": + return Print_names_of_files_and_the_reason_they_are_part_of_the_compilation + case "Consider_adding_a_declare_modifier_to_this_class_6506": + return Consider_adding_a_declare_modifier_to_this_class + case "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600": + return Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files + case "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601": + return Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export + case "Allow_accessing_UMD_globals_from_modules_6602": + return Allow_accessing_UMD_globals_from_modules + case "Disable_error_reporting_for_unreachable_code_6603": + return Disable_error_reporting_for_unreachable_code + case "Disable_error_reporting_for_unused_labels_6604": + return Disable_error_reporting_for_unused_labels + case "Ensure_use_strict_is_always_emitted_6605": + return Ensure_use_strict_is_always_emitted + case "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606": + return Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it + case "Specify_the_base_directory_to_resolve_non_relative_module_names_6607": + return Specify_the_base_directory_to_resolve_non_relative_module_names + case "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608": + return No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files + case "Enable_error_reporting_in_type_checked_JavaScript_files_6609": + return Enable_error_reporting_in_type_checked_JavaScript_files + case "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611": + return Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references + case "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612": + return Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project + case "Specify_the_output_directory_for_generated_declaration_files_6613": + return Specify_the_output_directory_for_generated_declaration_files + case "Create_sourcemaps_for_d_ts_files_6614": + return Create_sourcemaps_for_d_ts_files + case "Output_compiler_performance_information_after_building_6615": + return Output_compiler_performance_information_after_building + case "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616": + return Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project + case "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617": + return Reduce_the_number_of_projects_loaded_automatically_by_TypeScript + case "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618": + return Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server + case "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619": + return Opt_a_project_out_of_multi_project_reference_checking_when_editing + case "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620": + return Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects + case "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621": + return Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration + case "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622": + return Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + case "Only_output_d_ts_files_and_not_JavaScript_files_6623": + return Only_output_d_ts_files_and_not_JavaScript_files + case "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624": + return Emit_design_type_metadata_for_decorated_declarations_in_source_files + case "Disable_the_type_acquisition_for_JavaScript_projects_6625": + return Disable_the_type_acquisition_for_JavaScript_projects + case "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626": + return Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility + case "Filters_results_from_the_include_option_6627": + return Filters_results_from_the_include_option + case "Remove_a_list_of_directories_from_the_watch_process_6628": + return Remove_a_list_of_directories_from_the_watch_process + case "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629": + return Remove_a_list_of_files_from_the_watch_mode_s_processing + case "Enable_experimental_support_for_legacy_experimental_decorators_6630": + return Enable_experimental_support_for_legacy_experimental_decorators + case "Print_files_read_during_the_compilation_including_why_it_was_included_6631": + return Print_files_read_during_the_compilation_including_why_it_was_included + case "Output_more_detailed_compiler_performance_information_after_building_6632": + return Output_more_detailed_compiler_performance_information_after_building + case "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633": + return Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited + case "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634": + return Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers + case "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635": + return Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include + case "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636": + return Build_all_projects_including_those_that_appear_to_be_up_to_date + case "Ensure_that_casing_is_correct_in_imports_6637": + return Ensure_that_casing_is_correct_in_imports + case "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638": + return Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging + case "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639": + return Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file + case "Skip_building_downstream_projects_on_error_in_upstream_project_6640": + return Skip_building_downstream_projects_on_error_in_upstream_project + case "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641": + return Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation + case "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642": + return Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects + case "Include_sourcemap_files_inside_the_emitted_JavaScript_6643": + return Include_sourcemap_files_inside_the_emitted_JavaScript + case "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644": + return Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript + case "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645": + return Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports + case "Specify_what_JSX_code_is_generated_6646": + return Specify_what_JSX_code_is_generated + case "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647": + return Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h + case "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648": + return Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment + case "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649": + return Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk + case "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650": + return Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option + case "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651": + return Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment + case "Print_the_names_of_emitted_files_after_a_compilation_6652": + return Print_the_names_of_emitted_files_after_a_compilation + case "Print_all_of_the_files_read_during_the_compilation_6653": + return Print_all_of_the_files_read_during_the_compilation + case "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654": + return Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit + case "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655": + return Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations + case "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656": + return Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs + case "Specify_what_module_code_is_generated_6657": + return Specify_what_module_code_is_generated + case "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658": + return Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier + case "Set_the_newline_character_for_emitting_files_6659": + return Set_the_newline_character_for_emitting_files + case "Disable_emitting_files_from_a_compilation_6660": + return Disable_emitting_files_from_a_compilation + case "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661": + return Disable_generating_custom_helper_functions_like_extends_in_compiled_output + case "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662": + return Disable_emitting_files_if_any_type_checking_errors_are_reported + case "Disable_truncating_types_in_error_messages_6663": + return Disable_truncating_types_in_error_messages + case "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664": + return Enable_error_reporting_for_fallthrough_cases_in_switch_statements + case "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665": + return Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type + case "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666": + return Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier + case "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667": + return Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function + case "Enable_error_reporting_when_this_is_given_the_type_any_6668": + return Enable_error_reporting_when_this_is_given_the_type_any + case "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669": + return Disable_adding_use_strict_directives_in_emitted_JavaScript_files + case "Disable_including_any_library_files_including_the_default_lib_d_ts_6670": + return Disable_including_any_library_files_including_the_default_lib_d_ts + case "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671": + return Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type + case "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672": + return Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project + case "Disable_strict_checking_of_generic_signatures_in_function_types_6673": + return Disable_strict_checking_of_generic_signatures_in_function_types + case "Add_undefined_to_a_type_when_accessed_using_an_index_6674": + return Add_undefined_to_a_type_when_accessed_using_an_index + case "Enable_error_reporting_when_local_variables_aren_t_read_6675": + return Enable_error_reporting_when_local_variables_aren_t_read + case "Raise_an_error_when_a_function_parameter_isn_t_read_6676": + return Raise_an_error_when_a_function_parameter_isn_t_read + case "Deprecated_setting_Use_outFile_instead_6677": + return Deprecated_setting_Use_outFile_instead + case "Specify_an_output_folder_for_all_emitted_files_6678": + return Specify_an_output_folder_for_all_emitted_files + case "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679": + return Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output + case "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680": + return Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations + case "Specify_a_list_of_language_service_plugins_to_include_6681": + return Specify_a_list_of_language_service_plugins_to_include + case "Disable_erasing_const_enum_declarations_in_generated_code_6682": + return Disable_erasing_const_enum_declarations_in_generated_code + case "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683": + return Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node + case "Disable_wiping_the_console_in_watch_mode_6684": + return Disable_wiping_the_console_in_watch_mode + case "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685": + return Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read + case "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686": + return Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit + case "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687": + return Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references + case "Disable_emitting_comments_6688": + return Disable_emitting_comments + case "Enable_importing_json_files_6689": + return Enable_importing_json_files + case "Specify_the_root_folder_within_your_source_files_6690": + return Specify_the_root_folder_within_your_source_files + case "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691": + return Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules + case "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692": + return Skip_type_checking_d_ts_files_that_are_included_with_TypeScript + case "Skip_type_checking_all_d_ts_files_6693": + return Skip_type_checking_all_d_ts_files + case "Create_source_map_files_for_emitted_JavaScript_files_6694": + return Create_source_map_files_for_emitted_JavaScript_files + case "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695": + return Specify_the_root_path_for_debuggers_to_find_the_reference_source_code + case "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697": + return Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function + case "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698": + return When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible + case "When_type_checking_take_into_account_null_and_undefined_6699": + return When_type_checking_take_into_account_null_and_undefined + case "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700": + return Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor + case "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701": + return Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments + case "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702": + return Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals + case "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703": + return Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures + case "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704": + return Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively + case "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705": + return Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations + case "Log_paths_used_during_the_moduleResolution_process_6706": + return Log_paths_used_during_the_moduleResolution_process + case "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707": + return Specify_the_path_to_tsbuildinfo_incremental_compilation_file + case "Specify_options_for_automatic_acquisition_of_declaration_files_6709": + return Specify_options_for_automatic_acquisition_of_declaration_files + case "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710": + return Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types + case "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711": + return Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file + case "Emit_ECMAScript_standard_compliant_class_fields_6712": + return Emit_ECMAScript_standard_compliant_class_fields + case "Enable_verbose_logging_6713": + return Enable_verbose_logging + case "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714": + return Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality + case "Specify_how_the_TypeScript_watch_mode_works_6715": + return Specify_how_the_TypeScript_watch_mode_works + case "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717": + return Require_undeclared_properties_from_index_signatures_to_use_element_accesses + case "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718": + return Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types + case "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719": + return Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files + case "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720": + return Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any + case "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721": + return Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript + case "Default_catch_clause_variables_as_unknown_instead_of_any_6803": + return Default_catch_clause_variables_as_unknown_instead_of_any + case "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804": + return Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting + case "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805": + return Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported + case "Check_side_effect_imports_6806": + return Check_side_effect_imports + case "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807": + return This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2 + case "Enable_lib_replacement_6808": + return Enable_lib_replacement + case "one_of_Colon_6900": + return X_one_of_Colon + case "one_or_more_Colon_6901": + return X_one_or_more_Colon + case "type_Colon_6902": + return X_type_Colon + case "default_Colon_6903": + return X_default_Colon + case "module_system_or_esModuleInterop_6904": + return X_module_system_or_esModuleInterop + case "false_unless_strict_is_set_6905": + return X_false_unless_strict_is_set + case "false_unless_composite_is_set_6906": + return X_false_unless_composite_is_set + case "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": + return X_node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified + case "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908": + return X_if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk + case "true_if_composite_false_otherwise_6909": + return X_true_if_composite_false_otherwise + case "Computed_from_the_list_of_input_files_6911": + return Computed_from_the_list_of_input_files + case "Platform_specific_6912": + return Platform_specific + case "You_can_learn_about_all_of_the_compiler_options_at_0_6913": + return You_can_learn_about_all_of_the_compiler_options_at_0 + case "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914": + return Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon + case "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915": + return Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0 + case "COMMON_COMMANDS_6916": + return COMMON_COMMANDS + case "ALL_COMPILER_OPTIONS_6917": + return ALL_COMPILER_OPTIONS + case "WATCH_OPTIONS_6918": + return WATCH_OPTIONS + case "BUILD_OPTIONS_6919": + return BUILD_OPTIONS + case "COMMON_COMPILER_OPTIONS_6920": + return COMMON_COMPILER_OPTIONS + case "COMMAND_LINE_FLAGS_6921": + return COMMAND_LINE_FLAGS + case "tsc_Colon_The_TypeScript_Compiler_6922": + return X_tsc_Colon_The_TypeScript_Compiler + case "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923": + return Compiles_the_current_project_tsconfig_json_in_the_working_directory + case "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924": + return Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options + case "Build_a_composite_project_in_the_working_directory_6925": + return Build_a_composite_project_in_the_working_directory + case "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926": + return Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory + case "Compiles_the_TypeScript_project_located_at_the_specified_path_6927": + return Compiles_the_TypeScript_project_located_at_the_specified_path + case "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928": + return An_expanded_version_of_this_information_showing_all_possible_compiler_options + case "Compiles_the_current_project_with_additional_settings_6929": + return Compiles_the_current_project_with_additional_settings + case "true_for_ES2022_and_above_including_ESNext_6930": + return X_true_for_ES2022_and_above_including_ESNext + case "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931": + return List_of_file_name_suffixes_to_search_when_resolving_a_module + case "Variable_0_implicitly_has_an_1_type_7005": + return Variable_0_implicitly_has_an_1_type + case "Parameter_0_implicitly_has_an_1_type_7006": + return Parameter_0_implicitly_has_an_1_type + case "Member_0_implicitly_has_an_1_type_7008": + return Member_0_implicitly_has_an_1_type + case "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": + return X_new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type + case "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010": + return X_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type + case "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011": + return Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type + case "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012": + return This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation + case "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013": + return Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type + case "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": + return Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type + case "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015": + return Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number + case "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": + return Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type + case "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017": + return Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature + case "Object_literal_s_property_0_implicitly_has_an_1_type_7018": + return Object_literal_s_property_0_implicitly_has_an_1_type + case "Rest_parameter_0_implicitly_has_an_any_type_7019": + return Rest_parameter_0_implicitly_has_an_any_type + case "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": + return Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type + case "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": + return X_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer + case "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": + return X_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions + case "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024": + return Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions + case "Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation_7025": + return Generator_implicitly_has_yield_type_0_Consider_supplying_a_return_type_annotation + case "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026": + return JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists + case "Unreachable_code_detected_7027": + return Unreachable_code_detected + case "Unused_label_7028": + return Unused_label + case "Fallthrough_case_in_switch_7029": + return Fallthrough_case_in_switch + case "Not_all_code_paths_return_a_value_7030": + return Not_all_code_paths_return_a_value + case "Binding_element_0_implicitly_has_an_1_type_7031": + return Binding_element_0_implicitly_has_an_1_type + case "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": + return Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation + case "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": + return Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation + case "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034": + return Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined + case "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": + return Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0 + case "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": + return Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0 + case "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": + return Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + case "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038": + return Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead + case "Mapped_object_type_implicitly_has_an_any_template_type_7039": + return Mapped_object_type_implicitly_has_an_any_template_type + case "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040": + return If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1 + case "The_containing_arrow_function_captures_the_global_value_of_this_7041": + return The_containing_arrow_function_captures_the_global_value_of_this + case "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042": + return Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used + case "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043": + return Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage + case "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044": + return Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage + case "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045": + return Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage + case "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046": + return Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage + case "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047": + return Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage + case "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048": + return Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage + case "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049": + return Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage + case "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": + return X_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage + case "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051": + return Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1 + case "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052": + return Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1 + case "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053": + return Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1 + case "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054": + return No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1 + case "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055": + return X_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type + case "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": + return The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed + case "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057": + return X_yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation + case "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058": + return If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1 + case "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059": + return This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead + case "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060": + return This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint + case "A_mapped_type_may_not_declare_properties_or_methods_7061": + return A_mapped_type_may_not_declare_properties_or_methods + case "You_cannot_rename_this_element_8000": + return You_cannot_rename_this_element + case "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": + return You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library + case "import_can_only_be_used_in_TypeScript_files_8002": + return X_import_can_only_be_used_in_TypeScript_files + case "export_can_only_be_used_in_TypeScript_files_8003": + return X_export_can_only_be_used_in_TypeScript_files + case "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004": + return Type_parameter_declarations_can_only_be_used_in_TypeScript_files + case "implements_clauses_can_only_be_used_in_TypeScript_files_8005": + return X_implements_clauses_can_only_be_used_in_TypeScript_files + case "_0_declarations_can_only_be_used_in_TypeScript_files_8006": + return X_0_declarations_can_only_be_used_in_TypeScript_files + case "Type_aliases_can_only_be_used_in_TypeScript_files_8008": + return Type_aliases_can_only_be_used_in_TypeScript_files + case "The_0_modifier_can_only_be_used_in_TypeScript_files_8009": + return The_0_modifier_can_only_be_used_in_TypeScript_files + case "Type_annotations_can_only_be_used_in_TypeScript_files_8010": + return Type_annotations_can_only_be_used_in_TypeScript_files + case "Type_arguments_can_only_be_used_in_TypeScript_files_8011": + return Type_arguments_can_only_be_used_in_TypeScript_files + case "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012": + return Parameter_modifiers_can_only_be_used_in_TypeScript_files + case "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": + return Non_null_assertions_can_only_be_used_in_TypeScript_files + case "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016": + return Type_assertion_expressions_can_only_be_used_in_TypeScript_files + case "Signature_declarations_can_only_be_used_in_TypeScript_files_8017": + return Signature_declarations_can_only_be_used_in_TypeScript_files + case "Report_errors_in_js_files_8019": + return Report_errors_in_js_files + case "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": + return JSDoc_types_can_only_be_used_inside_documentation_comments + case "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": + return JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags + case "JSDoc_0_is_not_attached_to_a_class_8022": + return JSDoc_0_is_not_attached_to_a_class + case "JSDoc_0_1_does_not_match_the_extends_2_clause_8023": + return JSDoc_0_1_does_not_match_the_extends_2_clause + case "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": + return JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name + case "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": + return Class_declarations_cannot_have_more_than_one_augments_or_extends_tag + case "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": + return Expected_0_type_arguments_provide_these_with_an_extends_tag + case "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": + return Expected_0_1_type_arguments_provide_these_with_an_extends_tag + case "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028": + return JSDoc_may_only_appear_in_the_last_parameter_of_a_signature + case "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029": + return JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type + case "A_JSDoc_type_tag_on_a_function_must_have_a_signature_with_the_correct_number_of_arguments_8030": + return A_JSDoc_type_tag_on_a_function_must_have_a_signature_with_the_correct_number_of_arguments + case "You_cannot_rename_a_module_via_a_global_import_8031": + return You_cannot_rename_a_module_via_a_global_import + case "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032": + return Qualified_name_0_is_not_allowed_without_a_leading_param_object_1 + case "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033": + return A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags + case "The_tag_was_first_specified_here_8034": + return The_tag_was_first_specified_here + case "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035": + return You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder + case "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036": + return You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder + case "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037": + return Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files + case "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038": + return Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export + case "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039": + return A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag + case "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005": + return Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit + case "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006": + return Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit + case "Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007": + return Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations + case "Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008": + return Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations + case "At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9009": + return At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations + case "Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010": + return Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations + case "Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011": + return Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations + case "Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012": + return Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations + case "Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013": + return Expression_type_can_t_be_inferred_with_isolatedDeclarations + case "Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014": + return Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations + case "Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015": + return Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations + case "Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016": + return Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations + case "Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017": + return Only_const_arrays_can_be_inferred_with_isolatedDeclarations + case "Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018": + return Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations + case "Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019": + return Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations + case "Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020": + return Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations + case "Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021": + return Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations + case "Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022": + return Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations + case "Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023": + return Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function + case "Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_sup_9025": + return Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations + case "Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026": + return Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations + case "Add_a_type_annotation_to_the_variable_0_9027": + return Add_a_type_annotation_to_the_variable_0 + case "Add_a_type_annotation_to_the_parameter_0_9028": + return Add_a_type_annotation_to_the_parameter_0 + case "Add_a_type_annotation_to_the_property_0_9029": + return Add_a_type_annotation_to_the_property_0 + case "Add_a_return_type_to_the_function_expression_9030": + return Add_a_return_type_to_the_function_expression + case "Add_a_return_type_to_the_function_declaration_9031": + return Add_a_return_type_to_the_function_declaration + case "Add_a_return_type_to_the_get_accessor_declaration_9032": + return Add_a_return_type_to_the_get_accessor_declaration + case "Add_a_type_to_parameter_of_the_set_accessor_declaration_9033": + return Add_a_type_to_parameter_of_the_set_accessor_declaration + case "Add_a_return_type_to_the_method_9034": + return Add_a_return_type_to_the_method + case "Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035": + return Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit + case "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036": + return Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it + case "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037": + return Default_exports_can_t_be_inferred_with_isolatedDeclarations + case "Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038": + return Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations + case "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039": + return Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations + case "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": + return JSX_attributes_must_only_be_assigned_a_non_empty_expression + case "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001": + return JSX_elements_cannot_have_multiple_attributes_with_the_same_name + case "Expected_corresponding_JSX_closing_tag_for_0_17002": + return Expected_corresponding_JSX_closing_tag_for_0 + case "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004": + return Cannot_use_JSX_unless_the_jsx_flag_is_provided + case "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": + return A_constructor_cannot_contain_a_super_call_when_its_class_extends_null + case "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": + return An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses + case "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007": + return A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses + case "JSX_element_0_has_no_corresponding_closing_tag_17008": + return JSX_element_0_has_no_corresponding_closing_tag + case "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009": + return X_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class + case "Unknown_type_acquisition_option_0_17010": + return Unknown_type_acquisition_option_0 + case "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011": + return X_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class + case "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": + return X_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2 + case "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013": + return Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor + case "JSX_fragment_has_no_corresponding_closing_tag_17014": + return JSX_fragment_has_no_corresponding_closing_tag + case "Expected_corresponding_closing_tag_for_JSX_fragment_17015": + return Expected_corresponding_closing_tag_for_JSX_fragment + case "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": + return The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option + case "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017": + return An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments + case "Unknown_type_acquisition_option_0_Did_you_mean_1_17018": + return Unknown_type_acquisition_option_0_Did_you_mean_1 + case "_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019": + return X_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 + case "_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020": + return X_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 + case "Unicode_escape_sequence_cannot_appear_here_17021": + return Unicode_escape_sequence_cannot_appear_here + case "Circularity_detected_while_resolving_configuration_Colon_0_18000": + return Circularity_detected_while_resolving_configuration_Colon_0 + case "The_files_list_in_config_file_0_is_empty_18002": + return The_files_list_in_config_file_0_is_empty + case "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003": + return No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2 + case "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004": + return No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer + case "Classes_may_not_have_a_field_named_constructor_18006": + return Classes_may_not_have_a_field_named_constructor + case "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007": + return JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array + case "Private_identifiers_cannot_be_used_as_parameters_18009": + return Private_identifiers_cannot_be_used_as_parameters + case "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010": + return An_accessibility_modifier_cannot_be_used_with_a_private_identifier + case "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011": + return The_operand_of_a_delete_operator_cannot_be_a_private_identifier + case "constructor_is_a_reserved_word_18012": + return X_constructor_is_a_reserved_word + case "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013": + return Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier + case "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014": + return The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling + case "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": + return Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2 + case "Private_identifiers_are_not_allowed_outside_class_bodies_18016": + return Private_identifiers_are_not_allowed_outside_class_bodies + case "The_shadowing_declaration_of_0_is_defined_here_18017": + return The_shadowing_declaration_of_0_is_defined_here + case "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018": + return The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here + case "_0_modifier_cannot_be_used_with_a_private_identifier_18019": + return X_0_modifier_cannot_be_used_with_a_private_identifier + case "An_enum_member_cannot_be_named_with_a_private_identifier_18024": + return An_enum_member_cannot_be_named_with_a_private_identifier + case "can_only_be_used_at_the_start_of_a_file_18026": + return X_can_only_be_used_at_the_start_of_a_file + case "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027": + return Compiler_reserves_name_0_when_emitting_private_identifier_downlevel + case "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": + return Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher + case "Private_identifiers_are_not_allowed_in_variable_declarations_18029": + return Private_identifiers_are_not_allowed_in_variable_declarations + case "An_optional_chain_cannot_contain_private_identifiers_18030": + return An_optional_chain_cannot_contain_private_identifiers + case "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": + return The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents + case "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": + return The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some + case "Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033": + return Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values + case "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034": + return Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment + case "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": + return Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name + case "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036": + return Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator + case "await_expression_cannot_be_used_inside_a_class_static_block_18037": + return X_await_expression_cannot_be_used_inside_a_class_static_block + case "for_await_loops_cannot_be_used_inside_a_class_static_block_18038": + return X_for_await_loops_cannot_be_used_inside_a_class_static_block + case "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039": + return Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block + case "A_return_statement_cannot_be_used_inside_a_class_static_block_18041": + return A_return_statement_cannot_be_used_inside_a_class_static_block + case "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042": + return X_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation + case "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043": + return Types_cannot_appear_in_export_declarations_in_JavaScript_files + case "_0_is_automatically_exported_here_18044": + return X_0_is_automatically_exported_here + case "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045": + return Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher + case "_0_is_of_type_unknown_18046": + return X_0_is_of_type_unknown + case "_0_is_possibly_null_18047": + return X_0_is_possibly_null + case "_0_is_possibly_undefined_18048": + return X_0_is_possibly_undefined + case "_0_is_possibly_null_or_undefined_18049": + return X_0_is_possibly_null_or_undefined + case "The_value_0_cannot_be_used_here_18050": + return The_value_0_cannot_be_used_here + case "Compiler_option_0_cannot_be_given_an_empty_string_18051": + return Compiler_option_0_cannot_be_given_an_empty_string + case "Its_type_0_is_not_a_valid_JSX_element_type_18053": + return Its_type_0_is_not_a_valid_JSX_element_type + case "await_using_statements_cannot_be_used_inside_a_class_static_block_18054": + return X_await_using_statements_cannot_be_used_inside_a_class_static_block + case "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055": + return X_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled + case "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056": + return Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled + case "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057": + return String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020 + case "Default_imports_are_not_allowed_in_a_deferred_import_18058": + return Default_imports_are_not_allowed_in_a_deferred_import + case "Named_imports_are_not_allowed_in_a_deferred_import_18059": + return Named_imports_are_not_allowed_in_a_deferred_import + case "Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve_18060": + return Deferred_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_or_preserve + case "_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer_18061": + return X_0_is_not_a_valid_meta_property_for_keyword_import_Did_you_mean_meta_or_defer + case "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": + return X_nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler + case "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001": + return File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module + case "This_constructor_function_may_be_converted_to_a_class_declaration_80002": + return This_constructor_function_may_be_converted_to_a_class_declaration + case "Import_may_be_converted_to_a_default_import_80003": + return Import_may_be_converted_to_a_default_import + case "JSDoc_types_may_be_moved_to_TypeScript_types_80004": + return JSDoc_types_may_be_moved_to_TypeScript_types + case "require_call_may_be_converted_to_an_import_80005": + return X_require_call_may_be_converted_to_an_import + case "This_may_be_converted_to_an_async_function_80006": + return This_may_be_converted_to_an_async_function + case "await_has_no_effect_on_the_type_of_this_expression_80007": + return X_await_has_no_effect_on_the_type_of_this_expression + case "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008": + return Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers + case "JSDoc_typedef_may_be_converted_to_TypeScript_type_80009": + return JSDoc_typedef_may_be_converted_to_TypeScript_type + case "JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010": + return JSDoc_typedefs_may_be_converted_to_TypeScript_types + case "Add_missing_super_call_90001": + return Add_missing_super_call + case "Make_super_call_the_first_statement_in_the_constructor_90002": + return Make_super_call_the_first_statement_in_the_constructor + case "Change_extends_to_implements_90003": + return Change_extends_to_implements + case "Remove_unused_declaration_for_Colon_0_90004": + return Remove_unused_declaration_for_Colon_0 + case "Remove_import_from_0_90005": + return Remove_import_from_0 + case "Implement_interface_0_90006": + return Implement_interface_0 + case "Implement_inherited_abstract_class_90007": + return Implement_inherited_abstract_class + case "Add_0_to_unresolved_variable_90008": + return Add_0_to_unresolved_variable + case "Remove_variable_statement_90010": + return Remove_variable_statement + case "Remove_template_tag_90011": + return Remove_template_tag + case "Remove_type_parameters_90012": + return Remove_type_parameters + case "Import_0_from_1_90013": + return Import_0_from_1 + case "Change_0_to_1_90014": + return Change_0_to_1 + case "Declare_property_0_90016": + return Declare_property_0 + case "Add_index_signature_for_property_0_90017": + return Add_index_signature_for_property_0 + case "Disable_checking_for_this_file_90018": + return Disable_checking_for_this_file + case "Ignore_this_error_message_90019": + return Ignore_this_error_message + case "Initialize_property_0_in_the_constructor_90020": + return Initialize_property_0_in_the_constructor + case "Initialize_static_property_0_90021": + return Initialize_static_property_0 + case "Change_spelling_to_0_90022": + return Change_spelling_to_0 + case "Declare_method_0_90023": + return Declare_method_0 + case "Declare_static_method_0_90024": + return Declare_static_method_0 + case "Prefix_0_with_an_underscore_90025": + return Prefix_0_with_an_underscore + case "Rewrite_as_the_indexed_access_type_0_90026": + return Rewrite_as_the_indexed_access_type_0 + case "Declare_static_property_0_90027": + return Declare_static_property_0 + case "Call_decorator_expression_90028": + return Call_decorator_expression + case "Add_async_modifier_to_containing_function_90029": + return Add_async_modifier_to_containing_function + case "Replace_infer_0_with_unknown_90030": + return Replace_infer_0_with_unknown + case "Replace_all_unused_infer_with_unknown_90031": + return Replace_all_unused_infer_with_unknown + case "Add_parameter_name_90034": + return Add_parameter_name + case "Declare_private_property_0_90035": + return Declare_private_property_0 + case "Replace_0_with_Promise_1_90036": + return Replace_0_with_Promise_1 + case "Fix_all_incorrect_return_type_of_an_async_functions_90037": + return Fix_all_incorrect_return_type_of_an_async_functions + case "Declare_private_method_0_90038": + return Declare_private_method_0 + case "Remove_unused_destructuring_declaration_90039": + return Remove_unused_destructuring_declaration + case "Remove_unused_declarations_for_Colon_0_90041": + return Remove_unused_declarations_for_Colon_0 + case "Declare_a_private_field_named_0_90053": + return Declare_a_private_field_named_0 + case "Includes_imports_of_types_referenced_by_0_90054": + return Includes_imports_of_types_referenced_by_0 + case "Remove_type_from_import_declaration_from_0_90055": + return Remove_type_from_import_declaration_from_0 + case "Remove_type_from_import_of_0_from_1_90056": + return Remove_type_from_import_of_0_from_1 + case "Add_import_from_0_90057": + return Add_import_from_0 + case "Update_import_from_0_90058": + return Update_import_from_0 + case "Export_0_from_module_1_90059": + return Export_0_from_module_1 + case "Export_all_referenced_locals_90060": + return Export_all_referenced_locals + case "Update_modifiers_of_0_90061": + return Update_modifiers_of_0 + case "Add_annotation_of_type_0_90062": + return Add_annotation_of_type_0 + case "Add_return_type_0_90063": + return Add_return_type_0 + case "Extract_base_class_to_variable_90064": + return Extract_base_class_to_variable + case "Extract_default_export_to_variable_90065": + return Extract_default_export_to_variable + case "Extract_binding_expressions_to_variable_90066": + return Extract_binding_expressions_to_variable + case "Add_all_missing_type_annotations_90067": + return Add_all_missing_type_annotations + case "Add_satisfies_and_an_inline_type_assertion_with_0_90068": + return Add_satisfies_and_an_inline_type_assertion_with_0 + case "Extract_to_variable_and_replace_with_0_as_typeof_0_90069": + return Extract_to_variable_and_replace_with_0_as_typeof_0 + case "Mark_array_literal_as_const_90070": + return Mark_array_literal_as_const + case "Annotate_types_of_properties_expando_function_in_a_namespace_90071": + return Annotate_types_of_properties_expando_function_in_a_namespace + case "Convert_function_to_an_ES2015_class_95001": + return Convert_function_to_an_ES2015_class + case "Convert_0_to_1_in_0_95003": + return Convert_0_to_1_in_0 + case "Extract_to_0_in_1_95004": + return Extract_to_0_in_1 + case "Extract_function_95005": + return Extract_function + case "Extract_constant_95006": + return Extract_constant + case "Extract_to_0_in_enclosing_scope_95007": + return Extract_to_0_in_enclosing_scope + case "Extract_to_0_in_1_scope_95008": + return Extract_to_0_in_1_scope + case "Annotate_with_type_from_JSDoc_95009": + return Annotate_with_type_from_JSDoc + case "Infer_type_of_0_from_usage_95011": + return Infer_type_of_0_from_usage + case "Infer_parameter_types_from_usage_95012": + return Infer_parameter_types_from_usage + case "Convert_to_default_import_95013": + return Convert_to_default_import + case "Install_0_95014": + return Install_0 + case "Replace_import_with_0_95015": + return Replace_import_with_0 + case "Use_synthetic_default_member_95016": + return Use_synthetic_default_member + case "Convert_to_ES_module_95017": + return Convert_to_ES_module + case "Add_undefined_type_to_property_0_95018": + return Add_undefined_type_to_property_0 + case "Add_initializer_to_property_0_95019": + return Add_initializer_to_property_0 + case "Add_definite_assignment_assertion_to_property_0_95020": + return Add_definite_assignment_assertion_to_property_0 + case "Convert_all_type_literals_to_mapped_type_95021": + return Convert_all_type_literals_to_mapped_type + case "Add_all_missing_members_95022": + return Add_all_missing_members + case "Infer_all_types_from_usage_95023": + return Infer_all_types_from_usage + case "Delete_all_unused_declarations_95024": + return Delete_all_unused_declarations + case "Prefix_all_unused_declarations_with_where_possible_95025": + return Prefix_all_unused_declarations_with_where_possible + case "Fix_all_detected_spelling_errors_95026": + return Fix_all_detected_spelling_errors + case "Add_initializers_to_all_uninitialized_properties_95027": + return Add_initializers_to_all_uninitialized_properties + case "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028": + return Add_definite_assignment_assertions_to_all_uninitialized_properties + case "Add_undefined_type_to_all_uninitialized_properties_95029": + return Add_undefined_type_to_all_uninitialized_properties + case "Change_all_jsdoc_style_types_to_TypeScript_95030": + return Change_all_jsdoc_style_types_to_TypeScript + case "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031": + return Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types + case "Implement_all_unimplemented_interfaces_95032": + return Implement_all_unimplemented_interfaces + case "Install_all_missing_types_packages_95033": + return Install_all_missing_types_packages + case "Rewrite_all_as_indexed_access_types_95034": + return Rewrite_all_as_indexed_access_types + case "Convert_all_to_default_imports_95035": + return Convert_all_to_default_imports + case "Make_all_super_calls_the_first_statement_in_their_constructor_95036": + return Make_all_super_calls_the_first_statement_in_their_constructor + case "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": + return Add_qualifier_to_all_unresolved_variables_matching_a_member_name + case "Change_all_extended_interfaces_to_implements_95038": + return Change_all_extended_interfaces_to_implements + case "Add_all_missing_super_calls_95039": + return Add_all_missing_super_calls + case "Implement_all_inherited_abstract_classes_95040": + return Implement_all_inherited_abstract_classes + case "Add_all_missing_async_modifiers_95041": + return Add_all_missing_async_modifiers + case "Add_ts_ignore_to_all_error_messages_95042": + return Add_ts_ignore_to_all_error_messages + case "Annotate_everything_with_types_from_JSDoc_95043": + return Annotate_everything_with_types_from_JSDoc + case "Add_to_all_uncalled_decorators_95044": + return Add_to_all_uncalled_decorators + case "Convert_all_constructor_functions_to_classes_95045": + return Convert_all_constructor_functions_to_classes + case "Generate_get_and_set_accessors_95046": + return Generate_get_and_set_accessors + case "Convert_require_to_import_95047": + return Convert_require_to_import + case "Convert_all_require_to_import_95048": + return Convert_all_require_to_import + case "Move_to_a_new_file_95049": + return Move_to_a_new_file + case "Remove_unreachable_code_95050": + return Remove_unreachable_code + case "Remove_all_unreachable_code_95051": + return Remove_all_unreachable_code + case "Add_missing_typeof_95052": + return Add_missing_typeof + case "Remove_unused_label_95053": + return Remove_unused_label + case "Remove_all_unused_labels_95054": + return Remove_all_unused_labels + case "Convert_0_to_mapped_object_type_95055": + return Convert_0_to_mapped_object_type + case "Convert_namespace_import_to_named_imports_95056": + return Convert_namespace_import_to_named_imports + case "Convert_named_imports_to_namespace_import_95057": + return Convert_named_imports_to_namespace_import + case "Add_or_remove_braces_in_an_arrow_function_95058": + return Add_or_remove_braces_in_an_arrow_function + case "Add_braces_to_arrow_function_95059": + return Add_braces_to_arrow_function + case "Remove_braces_from_arrow_function_95060": + return Remove_braces_from_arrow_function + case "Convert_default_export_to_named_export_95061": + return Convert_default_export_to_named_export + case "Convert_named_export_to_default_export_95062": + return Convert_named_export_to_default_export + case "Add_missing_enum_member_0_95063": + return Add_missing_enum_member_0 + case "Add_all_missing_imports_95064": + return Add_all_missing_imports + case "Convert_to_async_function_95065": + return Convert_to_async_function + case "Convert_all_to_async_functions_95066": + return Convert_all_to_async_functions + case "Add_missing_call_parentheses_95067": + return Add_missing_call_parentheses + case "Add_all_missing_call_parentheses_95068": + return Add_all_missing_call_parentheses + case "Add_unknown_conversion_for_non_overlapping_types_95069": + return Add_unknown_conversion_for_non_overlapping_types + case "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": + return Add_unknown_to_all_conversions_of_non_overlapping_types + case "Add_missing_new_operator_to_call_95071": + return Add_missing_new_operator_to_call + case "Add_missing_new_operator_to_all_calls_95072": + return Add_missing_new_operator_to_all_calls + case "Add_names_to_all_parameters_without_names_95073": + return Add_names_to_all_parameters_without_names + case "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074": + return Enable_the_experimentalDecorators_option_in_your_configuration_file + case "Convert_parameters_to_destructured_object_95075": + return Convert_parameters_to_destructured_object + case "Extract_type_95077": + return Extract_type + case "Extract_to_type_alias_95078": + return Extract_to_type_alias + case "Extract_to_typedef_95079": + return Extract_to_typedef + case "Infer_this_type_of_0_from_usage_95080": + return Infer_this_type_of_0_from_usage + case "Add_const_to_unresolved_variable_95081": + return Add_const_to_unresolved_variable + case "Add_const_to_all_unresolved_variables_95082": + return Add_const_to_all_unresolved_variables + case "Add_await_95083": + return Add_await + case "Add_await_to_initializer_for_0_95084": + return Add_await_to_initializer_for_0 + case "Fix_all_expressions_possibly_missing_await_95085": + return Fix_all_expressions_possibly_missing_await + case "Remove_unnecessary_await_95086": + return Remove_unnecessary_await + case "Remove_all_unnecessary_uses_of_await_95087": + return Remove_all_unnecessary_uses_of_await + case "Enable_the_jsx_flag_in_your_configuration_file_95088": + return Enable_the_jsx_flag_in_your_configuration_file + case "Add_await_to_initializers_95089": + return Add_await_to_initializers + case "Extract_to_interface_95090": + return Extract_to_interface + case "Convert_to_a_bigint_numeric_literal_95091": + return Convert_to_a_bigint_numeric_literal + case "Convert_all_to_bigint_numeric_literals_95092": + return Convert_all_to_bigint_numeric_literals + case "Convert_const_to_let_95093": + return Convert_const_to_let + case "Prefix_with_declare_95094": + return Prefix_with_declare + case "Prefix_all_incorrect_property_declarations_with_declare_95095": + return Prefix_all_incorrect_property_declarations_with_declare + case "Convert_to_template_string_95096": + return Convert_to_template_string + case "Add_export_to_make_this_file_into_a_module_95097": + return Add_export_to_make_this_file_into_a_module + case "Set_the_target_option_in_your_configuration_file_to_0_95098": + return Set_the_target_option_in_your_configuration_file_to_0 + case "Set_the_module_option_in_your_configuration_file_to_0_95099": + return Set_the_module_option_in_your_configuration_file_to_0 + case "Convert_invalid_character_to_its_html_entity_code_95100": + return Convert_invalid_character_to_its_html_entity_code + case "Convert_all_invalid_characters_to_HTML_entity_code_95101": + return Convert_all_invalid_characters_to_HTML_entity_code + case "Convert_all_const_to_let_95102": + return Convert_all_const_to_let + case "Convert_function_expression_0_to_arrow_function_95105": + return Convert_function_expression_0_to_arrow_function + case "Convert_function_declaration_0_to_arrow_function_95106": + return Convert_function_declaration_0_to_arrow_function + case "Fix_all_implicit_this_errors_95107": + return Fix_all_implicit_this_errors + case "Wrap_invalid_character_in_an_expression_container_95108": + return Wrap_invalid_character_in_an_expression_container + case "Wrap_all_invalid_characters_in_an_expression_container_95109": + return Wrap_all_invalid_characters_in_an_expression_container + case "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": + return Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file + case "Add_a_return_statement_95111": + return Add_a_return_statement + case "Remove_braces_from_arrow_function_body_95112": + return Remove_braces_from_arrow_function_body + case "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113": + return Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal + case "Add_all_missing_return_statement_95114": + return Add_all_missing_return_statement + case "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115": + return Remove_braces_from_all_arrow_function_bodies_with_relevant_issues + case "Wrap_all_object_literal_with_parentheses_95116": + return Wrap_all_object_literal_with_parentheses + case "Move_labeled_tuple_element_modifiers_to_labels_95117": + return Move_labeled_tuple_element_modifiers_to_labels + case "Convert_overload_list_to_single_signature_95118": + return Convert_overload_list_to_single_signature + case "Generate_get_and_set_accessors_for_all_overriding_properties_95119": + return Generate_get_and_set_accessors_for_all_overriding_properties + case "Wrap_in_JSX_fragment_95120": + return Wrap_in_JSX_fragment + case "Wrap_all_unparented_JSX_in_JSX_fragment_95121": + return Wrap_all_unparented_JSX_in_JSX_fragment + case "Convert_arrow_function_or_function_expression_95122": + return Convert_arrow_function_or_function_expression + case "Convert_to_anonymous_function_95123": + return Convert_to_anonymous_function + case "Convert_to_named_function_95124": + return Convert_to_named_function + case "Convert_to_arrow_function_95125": + return Convert_to_arrow_function + case "Remove_parentheses_95126": + return Remove_parentheses + case "Could_not_find_a_containing_arrow_function_95127": + return Could_not_find_a_containing_arrow_function + case "Containing_function_is_not_an_arrow_function_95128": + return Containing_function_is_not_an_arrow_function + case "Could_not_find_export_statement_95129": + return Could_not_find_export_statement + case "This_file_already_has_a_default_export_95130": + return This_file_already_has_a_default_export + case "Could_not_find_import_clause_95131": + return Could_not_find_import_clause + case "Could_not_find_namespace_import_or_named_imports_95132": + return Could_not_find_namespace_import_or_named_imports + case "Selection_is_not_a_valid_type_node_95133": + return Selection_is_not_a_valid_type_node + case "No_type_could_be_extracted_from_this_type_node_95134": + return No_type_could_be_extracted_from_this_type_node + case "Could_not_find_property_for_which_to_generate_accessor_95135": + return Could_not_find_property_for_which_to_generate_accessor + case "Name_is_not_valid_95136": + return Name_is_not_valid + case "Can_only_convert_property_with_modifier_95137": + return Can_only_convert_property_with_modifier + case "Switch_each_misused_0_to_1_95138": + return Switch_each_misused_0_to_1 + case "Convert_to_optional_chain_expression_95139": + return Convert_to_optional_chain_expression + case "Could_not_find_convertible_access_expression_95140": + return Could_not_find_convertible_access_expression + case "Could_not_find_matching_access_expressions_95141": + return Could_not_find_matching_access_expressions + case "Can_only_convert_logical_AND_access_chains_95142": + return Can_only_convert_logical_AND_access_chains + case "Add_void_to_Promise_resolved_without_a_value_95143": + return Add_void_to_Promise_resolved_without_a_value + case "Add_void_to_all_Promises_resolved_without_a_value_95144": + return Add_void_to_all_Promises_resolved_without_a_value + case "Use_element_access_for_0_95145": + return Use_element_access_for_0 + case "Use_element_access_for_all_undeclared_properties_95146": + return Use_element_access_for_all_undeclared_properties + case "Delete_all_unused_imports_95147": + return Delete_all_unused_imports + case "Infer_function_return_type_95148": + return Infer_function_return_type + case "Return_type_must_be_inferred_from_a_function_95149": + return Return_type_must_be_inferred_from_a_function + case "Could_not_determine_function_return_type_95150": + return Could_not_determine_function_return_type + case "Could_not_convert_to_arrow_function_95151": + return Could_not_convert_to_arrow_function + case "Could_not_convert_to_named_function_95152": + return Could_not_convert_to_named_function + case "Could_not_convert_to_anonymous_function_95153": + return Could_not_convert_to_anonymous_function + case "Can_only_convert_string_concatenations_and_string_literals_95154": + return Can_only_convert_string_concatenations_and_string_literals + case "Selection_is_not_a_valid_statement_or_statements_95155": + return Selection_is_not_a_valid_statement_or_statements + case "Add_missing_function_declaration_0_95156": + return Add_missing_function_declaration_0 + case "Add_all_missing_function_declarations_95157": + return Add_all_missing_function_declarations + case "Method_not_implemented_95158": + return Method_not_implemented + case "Function_not_implemented_95159": + return Function_not_implemented + case "Add_override_modifier_95160": + return Add_override_modifier + case "Remove_override_modifier_95161": + return Remove_override_modifier + case "Add_all_missing_override_modifiers_95162": + return Add_all_missing_override_modifiers + case "Remove_all_unnecessary_override_modifiers_95163": + return Remove_all_unnecessary_override_modifiers + case "Can_only_convert_named_export_95164": + return Can_only_convert_named_export + case "Add_missing_properties_95165": + return Add_missing_properties + case "Add_all_missing_properties_95166": + return Add_all_missing_properties + case "Add_missing_attributes_95167": + return Add_missing_attributes + case "Add_all_missing_attributes_95168": + return Add_all_missing_attributes + case "Add_undefined_to_optional_property_type_95169": + return Add_undefined_to_optional_property_type + case "Convert_named_imports_to_default_import_95170": + return Convert_named_imports_to_default_import + case "Delete_unused_param_tag_0_95171": + return Delete_unused_param_tag_0 + case "Delete_all_unused_param_tags_95172": + return Delete_all_unused_param_tags + case "Rename_param_tag_name_0_to_1_95173": + return Rename_param_tag_name_0_to_1 + case "Use_0_95174": + return Use_0 + case "Use_Number_isNaN_in_all_conditions_95175": + return Use_Number_isNaN_in_all_conditions + case "Convert_typedef_to_TypeScript_type_95176": + return Convert_typedef_to_TypeScript_type + case "Convert_all_typedef_to_TypeScript_types_95177": + return Convert_all_typedef_to_TypeScript_types + case "Move_to_file_95178": + return Move_to_file + case "Cannot_move_to_file_selected_file_is_invalid_95179": + return Cannot_move_to_file_selected_file_is_invalid + case "Use_import_type_95180": + return Use_import_type + case "Use_type_0_95181": + return Use_type_0 + case "Fix_all_with_type_only_imports_95182": + return Fix_all_with_type_only_imports + case "Cannot_move_statements_to_the_selected_file_95183": + return Cannot_move_statements_to_the_selected_file + case "Inline_variable_95184": + return Inline_variable + case "Could_not_find_variable_to_inline_95185": + return Could_not_find_variable_to_inline + case "Variables_with_multiple_declarations_cannot_be_inlined_95186": + return Variables_with_multiple_declarations_cannot_be_inlined + case "Add_missing_comma_for_object_member_completion_0_95187": + return Add_missing_comma_for_object_member_completion_0 + case "Add_missing_parameter_to_0_95188": + return Add_missing_parameter_to_0 + case "Add_missing_parameters_to_0_95189": + return Add_missing_parameters_to_0 + case "Add_all_missing_parameters_95190": + return Add_all_missing_parameters + case "Add_optional_parameter_to_0_95191": + return Add_optional_parameter_to_0 + case "Add_optional_parameters_to_0_95192": + return Add_optional_parameters_to_0 + case "Add_all_optional_parameters_95193": + return Add_all_optional_parameters + case "Wrap_in_parentheses_95194": + return Wrap_in_parentheses + case "Wrap_all_invalid_decorator_expressions_in_parentheses_95195": + return Wrap_all_invalid_decorator_expressions_in_parentheses + case "Add_resolution_mode_import_attribute_95196": + return Add_resolution_mode_import_attribute + case "Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it_95197": + return Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it + case "Do_not_print_diagnostics_100000": + return Do_not_print_diagnostics + case "Run_in_single_threaded_mode_100001": + return Run_in_single_threaded_mode + case "Generate_pprof_CPU_Slashmemory_profiles_to_the_given_directory_100002": + return Generate_pprof_CPU_Slashmemory_profiles_to_the_given_directory + case "Set_the_number_of_checkers_per_project_100003": + return Set_the_number_of_checkers_per_project + case "4_unless_singleThreaded_is_passed_100004": + return X_4_unless_singleThreaded_is_passed + default: + return nil + } +} diff --git a/pkg/diagnostics/diagnostics_test.go b/pkg/diagnostics/diagnostics_test.go new file mode 100644 index 000000000..9f83ae460 --- /dev/null +++ b/pkg/diagnostics/diagnostics_test.go @@ -0,0 +1,145 @@ +package diagnostics + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/locale" + "golang.org/x/text/language" + "gotest.tools/v3/assert" +) + +func TestLocalize(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + message *Message + locale locale.Locale + args []any + expected string + }{ + { + name: "english default", + message: Identifier_expected, + locale: locale.Locale(language.English), + expected: "Identifier expected.", + }, + { + name: "undefined locale uses english", + message: Identifier_expected, + locale: locale.Locale(language.Und), + expected: "Identifier expected.", + }, + { + name: "with single argument", + message: X_0_expected, + locale: locale.Locale(language.English), + args: []any{")"}, + expected: "')' expected.", + }, + { + name: "with multiple arguments", + message: The_parser_expected_to_find_a_1_to_match_the_0_token_here, + locale: locale.Locale(language.English), + args: []any{"{", "}"}, + expected: "The parser expected to find a '}' to match the '{' token here.", + }, + { + name: "fallback to english for unknown locale", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("af-ZA")), + expected: "Identifier expected.", + }, + { + name: "german", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("de-DE")), + expected: "Es wurde ein Bezeichner erwartet.", + }, + { + name: "french", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("fr-FR")), + expected: "Identificateur attendu.", + }, + { + name: "spanish", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("es-ES")), + expected: "Se esperaba un identificador.", + }, + { + name: "japanese", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("ja-JP")), + expected: "識別子が必要です。", + }, + { + name: "chinese simplified", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("zh-CN")), + expected: "应为标识符。", + }, + { + name: "korean", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("ko-KR")), + expected: "식별자가 필요합니다.", + }, + { + name: "russian", + message: Identifier_expected, + locale: locale.Locale(language.MustParse("ru-RU")), + expected: "Ожидался идентификатор.", + }, + { + name: "german with args", + message: X_0_expected, + locale: locale.Locale(language.MustParse("de-DE")), + args: []any{")"}, + expected: "\")\" wurde erwartet.", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + result := tt.message.Localize(tt.locale, tt.args...) + assert.Equal(t, result, tt.expected) + }) + } +} + +func TestLocalize_ByKey(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + key Key + locale locale.Locale + args []string + expected string + }{ + { + name: "by key without args", + key: "Identifier_expected_1003", + locale: locale.Locale(language.English), + expected: "Identifier expected.", + }, + { + name: "by key with args", + key: "_0_expected_1005", + locale: locale.Locale(language.English), + args: []string{")"}, + expected: "')' expected.", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + result := Localize(tt.locale, nil, tt.key, tt.args...) + assert.Equal(t, result, tt.expected) + }) + } +} diff --git a/pkg/diagnostics/extraDiagnosticMessages.json b/pkg/diagnostics/extraDiagnosticMessages.json index edf9c5735..aefd5c742 100644 --- a/pkg/diagnostics/extraDiagnosticMessages.json +++ b/pkg/diagnostics/extraDiagnosticMessages.json @@ -42,5 +42,9 @@ "Project '{0}' is out of date because it has errors.": { "category": "Message", "code": 6423 + }, + "Locale must be an IETF BCP 47 language tag. Examples: '{0}', '{1}'.": { + "category": "Error", + "code": 6048 } } diff --git a/pkg/diagnostics/generate.go b/pkg/diagnostics/generate.go index b89010b03..43bce06eb 100644 --- a/pkg/diagnostics/generate.go +++ b/pkg/diagnostics/generate.go @@ -5,6 +5,8 @@ package main import ( "bytes" "cmp" + "compress/gzip" + "encoding/xml" "flag" "fmt" "go/format" @@ -21,7 +23,9 @@ import ( "unicode" "github.com/go-json-experiment/json" + "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/repo" + "golang.org/x/text/language" ) type diagnosticMessage struct { @@ -35,13 +39,44 @@ type diagnosticMessage struct { key string } +type LCX struct { + TgtCul string `xml:"TgtCul,attr"` + RootItems []RootItem `xml:"Item"` +} + +type RootItem struct { + ItemId string `xml:"ItemId,attr"` + Items []StringTableItem `xml:"Item"` +} + +type StringTableItem struct { + ItemId string `xml:"ItemId,attr"` + Items []LocalizedItem `xml:"Item"` +} + +type LocalizedItem struct { + ItemId string `xml:"ItemId,attr"` + Str Str `xml:"Str"` +} + +type Str struct { + Val string `xml:"Val"` + Tgt *Tgt `xml:"Tgt"` +} + +type Tgt struct { + Val string `xml:"Val"` +} + func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) - output := flag.String("output", "", "path to the output diagnostics_generated.go file") + diagnosticsOutput := flag.String("diagnostics", "", "path to the output diagnostics_generated.go file") + locOutput := flag.String("loc", "", "path to the output loc_generated.go file") + locDir := flag.String("locdir", "", "directory to write locale .json.gz files") flag.Parse() - if *output == "" { + if *diagnosticsOutput == "" || *locOutput == "" || *locDir == "" { flag.Usage() return } @@ -63,6 +98,43 @@ func main() { return cmp.Compare(a.Code, b.Code) }) + // Collect known keys for filtering localizations + knownKeys := make(map[string]bool, len(diagnosticMessages)) + for _, m := range diagnosticMessages { + _, key := convertPropertyName(m.key, m.Code) + knownKeys[key] = true + } + + // Generate diagnostics file + diagnosticsBuf := generateDiagnostics(diagnosticMessages) + + formatted, err := format.Source(diagnosticsBuf.Bytes()) + if err != nil { + log.Fatalf("failed to format diagnostics output: %v", err) + return + } + + if err := os.WriteFile(*diagnosticsOutput, formatted, 0o666); err != nil { + log.Fatalf("failed to write diagnostics output: %v", err) + return + } + + // Generate localizations file + locBuf := generateLocalizations(knownKeys, *locDir) + + formatted, err = format.Source(locBuf.Bytes()) + if err != nil { + log.Fatalf("failed to format localizations output: %v", err) + return + } + + if err := os.WriteFile(*locOutput, formatted, 0o666); err != nil { + log.Fatalf("failed to write localizations output: %v", err) + return + } +} + +func generateDiagnostics(diagnosticMessages []*diagnosticMessage) *bytes.Buffer { var buf bytes.Buffer buf.WriteString("// Code generated by generate.go; DO NOT EDIT.\n") @@ -87,16 +159,182 @@ func main() { buf.WriteString("}\n\n") } - formatted, err := format.Source(buf.Bytes()) + buf.WriteString("func keyToMessage(key Key) *Message {\n") + buf.WriteString("\tswitch key {\n") + for _, m := range diagnosticMessages { + _, key := convertPropertyName(m.key, m.Code) + varName, _ := convertPropertyName(m.key, m.Code) + fmt.Fprintf(&buf, "\tcase %q:\n\t\treturn %s\n", key, varName) + } + buf.WriteString("\tdefault:\n\t\treturn nil\n") + buf.WriteString("\t}\n") + buf.WriteString("}\n") + + return &buf +} + +func generateLocalizations(knownKeys map[string]bool, locDir string) *bytes.Buffer { + var buf bytes.Buffer + + buf.WriteString("// Code generated by generate.go; DO NOT EDIT.\n") + buf.WriteString("\n") + buf.WriteString("package diagnostics\n") + buf.WriteString("\n") + buf.WriteString("import (\n") + buf.WriteString("\t\"compress/gzip\"\n") + buf.WriteString("\t_ \"embed\"\n") + buf.WriteString("\t\"strings\"\n") + buf.WriteString("\t\"sync\"\n") + buf.WriteString("\t\"golang.org/x/text/language\"\n") + buf.WriteString("\t\"github.com/go-json-experiment/json\"\n") + buf.WriteString(")\n") + + // Remove and recreate the loc directory for a clean state + if err := os.RemoveAll(locDir); err != nil { + log.Fatalf("failed to remove locale directory: %v", err) + } + if err := os.MkdirAll(locDir, 0o755); err != nil { + log.Fatalf("failed to create locale directory: %v", err) + } + + // Generate locale maps + localeFiles, err := filepath.Glob(filepath.Join(repo.TypeScriptSubmodulePath, "src", "loc", "lcl", "*", "diagnosticMessages", "diagnosticMessages.generated.json.lcl")) if err != nil { - log.Fatalf("failed to format output: %v", err) - return + log.Fatalf("failed to find locale files: %v", err) + } + if len(localeFiles) == 0 { + log.Fatalf("no locale files found in %s", filepath.Join(repo.TypeScriptSubmodulePath, "src", "loc", "lcl")) + } + slices.Sort(localeFiles) + + type localeInfo struct { + varName string + tgtCul string + canonical string // canonical lowercase form (e.g., "zh-cn", "pt-br") + lang string + messages map[string]string + filename string } - if err := os.WriteFile(*output, formatted, 0o666); err != nil { - log.Fatalf("failed to write output: %v", err) - return + var locales []localeInfo + + for _, localeFile := range localeFiles { + localizedMessages, tgtCul := readLocalizedMessages(localeFile) + if len(localizedMessages) == 0 { + continue + } + + // Filter to only known keys + for key := range localizedMessages { + if !knownKeys[key] { + delete(localizedMessages, key) + } + } + + if len(localizedMessages) == 0 { + continue + } + + // Convert locale code to valid Go identifier + localeVar := strings.ReplaceAll(strings.ReplaceAll(tgtCul, "-", ""), "_", "") + + // Parse the locale using language.Tag to get canonical forms + tag, err := language.Parse(tgtCul) + if err != nil { + log.Printf("failed to parse locale %q: %v", tgtCul, err) + continue + } + + base, _ := tag.Base() + lang := strings.ToLower(base.String()) + + // Get canonical form (lowercase with dash) + canonical := strings.ToLower(tgtCul) + + // Filename for the JSON.gz file (use the original tgtCul as standard language tag) + filename := fmt.Sprintf("%s.json.gz", tgtCul) + + // Write the JSON.gz file + // Convert map to OrderedMap with sorted keys for consistent ordering + keys := slices.Sorted(maps.Keys(localizedMessages)) + var orderedMessages collections.OrderedMap[string, string] + for _, key := range keys { + orderedMessages.Set(key, localizedMessages[key]) + } + jsonData, err := json.Marshal(&orderedMessages) + if err != nil { + log.Fatalf("failed to marshal locale %s: %v", tgtCul, err) + } + + var compressed bytes.Buffer + gzipWriter, err := gzip.NewWriterLevel(&compressed, gzip.BestCompression) + if err != nil { + log.Fatalf("failed to create gzip writer for locale %s: %v", tgtCul, err) + } + if _, err := gzipWriter.Write(jsonData); err != nil { + log.Fatalf("failed to compress locale %s: %v", tgtCul, err) + } + if err := gzipWriter.Close(); err != nil { + log.Fatalf("failed to close gzip writer for locale %s: %v", tgtCul, err) + } + + outputPath := filepath.Join(locDir, filename) + if err := os.WriteFile(outputPath, compressed.Bytes(), 0o644); err != nil { + log.Fatalf("failed to write locale file %s: %v", outputPath, err) + } + + locales = append(locales, localeInfo{ + varName: localeVar, + tgtCul: tgtCul, + canonical: canonical, + lang: lang, + messages: localizedMessages, + filename: filename, + }) + } + + // Generate matcher with inlined tags + // English is first (index 0) as the default/fallback with no translation needed + buf.WriteString("\nvar matcher = language.NewMatcher([]language.Tag{\n") + buf.WriteString("\tlanguage.English,\n") + for _, loc := range locales { + fmt.Fprintf(&buf, "\tlanguage.MustParse(%q),\n", loc.tgtCul) + } + buf.WriteString("})\n") + + // Generate index-to-function map for matcher results + // English (index 0) returns nil since we use the default English text + buf.WriteString("\nvar localeFuncs = []func() map[Key]string{\n") + buf.WriteString("\tnil, // English (default)\n") + for _, loc := range locales { + fmt.Fprintf(&buf, "\t%s,\n", loc.varName) + } + buf.WriteString("}\n") + + // Generate helper function for decompressing locale data + buf.WriteString("\nfunc loadLocaleData(data string) map[Key]string {\n") + buf.WriteString("\tgr, err := gzip.NewReader(strings.NewReader(data))\n") + buf.WriteString("\tif err != nil {\n") + buf.WriteString("\t\tpanic(\"failed to create gzip reader: \" + err.Error())\n") + buf.WriteString("\t}\n") + buf.WriteString("\tdefer gr.Close()\n") + buf.WriteString("\tvar result map[Key]string\n") + buf.WriteString("\tif err := json.UnmarshalRead(gr, &result); err != nil {\n") + buf.WriteString("\t\tpanic(\"failed to unmarshal locale data: \" + err.Error())\n") + buf.WriteString("\t}\n") + buf.WriteString("\treturn result\n") + buf.WriteString("}\n") + + // Generate embed directives, vars, and loader functions interleaved at the bottom + for _, loc := range locales { + fmt.Fprintf(&buf, "\n//go:embed loc/%s\n", loc.filename) + fmt.Fprintf(&buf, "var %sData string\n", loc.varName) + fmt.Fprintf(&buf, "\nvar %s = sync.OnceValue(func() map[Key]string {\n", loc.varName) + fmt.Fprintf(&buf, "\treturn loadLocaleData(%sData)\n", loc.varName) + buf.WriteString("})\n") } + + return &buf } func readRawMessages(p string) map[int]*diagnosticMessage { @@ -122,6 +360,45 @@ func readRawMessages(p string) map[int]*diagnosticMessage { return codeToMessage } +func readLocalizedMessages(p string) (map[string]string, string) { + file, err := os.Open(p) + if err != nil { + log.Printf("failed to open locale file %s: %v", p, err) + return nil, "" + } + defer file.Close() + + var lcx LCX + if err := xml.NewDecoder(file).Decode(&lcx); err != nil { + log.Printf("failed to decode locale file %s: %v", p, err) + return nil, "" + } + + messages := make(map[string]string) + + // Navigate the nested Item structure + for _, rootItem := range lcx.RootItems { + for _, stringTable := range rootItem.Items { + for _, item := range stringTable.Items { + // ItemId has format ";key_code", remove the leading semicolon + itemId := strings.TrimPrefix(item.ItemId, ";") + + // Get the localized text from Tgt if available, otherwise use Val + var text string + if item.Str.Tgt != nil && item.Str.Tgt.Val != "" { + text = item.Str.Tgt.Val + } else { + text = item.Str.Val + } + + messages[itemId] = text + } + } + } + + return messages, lcx.TgtCul +} + var ( multipleUnderscoreRegexp = regexp.MustCompile(`_+`) leadingUnderscoreUnlessDigitRegexp = regexp.MustCompile(`^_+(\D)`) diff --git a/pkg/diagnostics/loc/cs-CZ.json.gz b/pkg/diagnostics/loc/cs-CZ.json.gz new file mode 100644 index 000000000..df21c307f Binary files /dev/null and b/pkg/diagnostics/loc/cs-CZ.json.gz differ diff --git a/pkg/diagnostics/loc/de-DE.json.gz b/pkg/diagnostics/loc/de-DE.json.gz new file mode 100644 index 000000000..5b398845e Binary files /dev/null and b/pkg/diagnostics/loc/de-DE.json.gz differ diff --git a/pkg/diagnostics/loc/es-ES.json.gz b/pkg/diagnostics/loc/es-ES.json.gz new file mode 100644 index 000000000..d068162ce Binary files /dev/null and b/pkg/diagnostics/loc/es-ES.json.gz differ diff --git a/pkg/diagnostics/loc/fr-FR.json.gz b/pkg/diagnostics/loc/fr-FR.json.gz new file mode 100644 index 000000000..ac9536dbe Binary files /dev/null and b/pkg/diagnostics/loc/fr-FR.json.gz differ diff --git a/pkg/diagnostics/loc/it-IT.json.gz b/pkg/diagnostics/loc/it-IT.json.gz new file mode 100644 index 000000000..31328e9ee Binary files /dev/null and b/pkg/diagnostics/loc/it-IT.json.gz differ diff --git a/pkg/diagnostics/loc/ja-JP.json.gz b/pkg/diagnostics/loc/ja-JP.json.gz new file mode 100644 index 000000000..035a86ccc Binary files /dev/null and b/pkg/diagnostics/loc/ja-JP.json.gz differ diff --git a/pkg/diagnostics/loc/ko-KR.json.gz b/pkg/diagnostics/loc/ko-KR.json.gz new file mode 100644 index 000000000..05a48d314 Binary files /dev/null and b/pkg/diagnostics/loc/ko-KR.json.gz differ diff --git a/pkg/diagnostics/loc/pl-PL.json.gz b/pkg/diagnostics/loc/pl-PL.json.gz new file mode 100644 index 000000000..33a6f2812 Binary files /dev/null and b/pkg/diagnostics/loc/pl-PL.json.gz differ diff --git a/pkg/diagnostics/loc/pt-BR.json.gz b/pkg/diagnostics/loc/pt-BR.json.gz new file mode 100644 index 000000000..2b8064be3 Binary files /dev/null and b/pkg/diagnostics/loc/pt-BR.json.gz differ diff --git a/pkg/diagnostics/loc/ru-RU.json.gz b/pkg/diagnostics/loc/ru-RU.json.gz new file mode 100644 index 000000000..0c31506b6 Binary files /dev/null and b/pkg/diagnostics/loc/ru-RU.json.gz differ diff --git a/pkg/diagnostics/loc/tr-TR.json.gz b/pkg/diagnostics/loc/tr-TR.json.gz new file mode 100644 index 000000000..4ef9c4594 Binary files /dev/null and b/pkg/diagnostics/loc/tr-TR.json.gz differ diff --git a/pkg/diagnostics/loc/zh-CN.json.gz b/pkg/diagnostics/loc/zh-CN.json.gz new file mode 100644 index 000000000..9498a59ae Binary files /dev/null and b/pkg/diagnostics/loc/zh-CN.json.gz differ diff --git a/pkg/diagnostics/loc/zh-TW.json.gz b/pkg/diagnostics/loc/zh-TW.json.gz new file mode 100644 index 000000000..d95f48c53 Binary files /dev/null and b/pkg/diagnostics/loc/zh-TW.json.gz differ diff --git a/pkg/diagnostics/loc_generated.go b/pkg/diagnostics/loc_generated.go new file mode 100644 index 000000000..c71b3dcfe --- /dev/null +++ b/pkg/diagnostics/loc_generated.go @@ -0,0 +1,151 @@ +// Code generated by generate.go; DO NOT EDIT. + +package diagnostics + +import ( + "compress/gzip" + _ "embed" + "strings" + "sync" + + "github.com/go-json-experiment/json" + "golang.org/x/text/language" +) + +var matcher = language.NewMatcher([]language.Tag{ + language.English, + language.MustParse("zh-CN"), + language.MustParse("zh-TW"), + language.MustParse("cs-CZ"), + language.MustParse("de-DE"), + language.MustParse("es-ES"), + language.MustParse("fr-FR"), + language.MustParse("it-IT"), + language.MustParse("ja-JP"), + language.MustParse("ko-KR"), + language.MustParse("pl-PL"), + language.MustParse("pt-BR"), + language.MustParse("ru-RU"), + language.MustParse("tr-TR"), +}) + +var localeFuncs = []func() map[Key]string{ + nil, // English (default) + zhCN, + zhTW, + csCZ, + deDE, + esES, + frFR, + itIT, + jaJP, + koKR, + plPL, + ptBR, + ruRU, + trTR, +} + +func loadLocaleData(data string) map[Key]string { + gr, err := gzip.NewReader(strings.NewReader(data)) + if err != nil { + panic("failed to create gzip reader: " + err.Error()) + } + defer gr.Close() + var result map[Key]string + if err := json.UnmarshalRead(gr, &result); err != nil { + panic("failed to unmarshal locale data: " + err.Error()) + } + return result +} + +//go:embed loc/zh-CN.json.gz +var zhCNData string + +var zhCN = sync.OnceValue(func() map[Key]string { + return loadLocaleData(zhCNData) +}) + +//go:embed loc/zh-TW.json.gz +var zhTWData string + +var zhTW = sync.OnceValue(func() map[Key]string { + return loadLocaleData(zhTWData) +}) + +//go:embed loc/cs-CZ.json.gz +var csCZData string + +var csCZ = sync.OnceValue(func() map[Key]string { + return loadLocaleData(csCZData) +}) + +//go:embed loc/de-DE.json.gz +var deDEData string + +var deDE = sync.OnceValue(func() map[Key]string { + return loadLocaleData(deDEData) +}) + +//go:embed loc/es-ES.json.gz +var esESData string + +var esES = sync.OnceValue(func() map[Key]string { + return loadLocaleData(esESData) +}) + +//go:embed loc/fr-FR.json.gz +var frFRData string + +var frFR = sync.OnceValue(func() map[Key]string { + return loadLocaleData(frFRData) +}) + +//go:embed loc/it-IT.json.gz +var itITData string + +var itIT = sync.OnceValue(func() map[Key]string { + return loadLocaleData(itITData) +}) + +//go:embed loc/ja-JP.json.gz +var jaJPData string + +var jaJP = sync.OnceValue(func() map[Key]string { + return loadLocaleData(jaJPData) +}) + +//go:embed loc/ko-KR.json.gz +var koKRData string + +var koKR = sync.OnceValue(func() map[Key]string { + return loadLocaleData(koKRData) +}) + +//go:embed loc/pl-PL.json.gz +var plPLData string + +var plPL = sync.OnceValue(func() map[Key]string { + return loadLocaleData(plPLData) +}) + +//go:embed loc/pt-BR.json.gz +var ptBRData string + +var ptBR = sync.OnceValue(func() map[Key]string { + return loadLocaleData(ptBRData) +}) + +//go:embed loc/ru-RU.json.gz +var ruRUData string + +var ruRU = sync.OnceValue(func() map[Key]string { + return loadLocaleData(ruRUData) +}) + +//go:embed loc/tr-TR.json.gz +var trTRData string + +var trTR = sync.OnceValue(func() map[Key]string { + return loadLocaleData(trTRData) +}) diff --git a/pkg/diagnosticwriter/diagnosticwriter.go b/pkg/diagnosticwriter/diagnosticwriter.go index 2f2dd92b1..7cc7c755a 100644 --- a/pkg/diagnosticwriter/diagnosticwriter.go +++ b/pkg/diagnosticwriter/diagnosticwriter.go @@ -12,6 +12,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/scanner" "github.com/buke/typescript-go-internal/pkg/tspath" ) @@ -30,7 +31,7 @@ type Diagnostic interface { Len() int Code() int32 Category() diagnostics.Category - Message() string + Localize(locale locale.Locale) string MessageChain() []Diagnostic RelatedInformation() []Diagnostic } @@ -98,6 +99,7 @@ func CompareASTDiagnostics(a, b *ASTDiagnostic) int { } type FormattingOptions struct { + Locale locale.Locale tspath.ComparePathsOptions NewLine string } @@ -139,7 +141,7 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic writeWithStyleAndReset(output, diagnostic.Category().Name(), getCategoryFormat(diagnostic.Category())) fmt.Fprintf(output, "%s TS%d: %s", foregroundColorEscapeGrey, diagnostic.Code(), resetEscapeSequence) - WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine) + WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine, formatOpts.Locale) if diagnostic.File() != nil && diagnostic.Code() != diagnostics.File_appears_to_be_binary.Code() { fmt.Fprint(output, formatOpts.NewLine) @@ -156,7 +158,7 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic pos := relatedInformation.Pos() WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) fmt.Fprint(output, " - ") - WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine) + WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine, formatOpts.Locale) writeCodeSnippet(output, file, pos, relatedInformation.Len(), foregroundColorEscapeCyan, " ", formatOpts) } fmt.Fprint(output, formatOpts.NewLine) @@ -248,33 +250,33 @@ func writeCodeSnippet(writer io.Writer, sourceFile FileLike, start int, length i } } -func FlattenDiagnosticMessage(d Diagnostic, newLine string) string { +func FlattenDiagnosticMessage(d Diagnostic, newLine string, locale locale.Locale) string { var output strings.Builder - WriteFlattenedDiagnosticMessage(&output, d, newLine) + WriteFlattenedDiagnosticMessage(&output, d, newLine, locale) return output.String() } -func WriteFlattenedASTDiagnosticMessage(writer io.Writer, diagnostic *ast.Diagnostic, newline string) { - WriteFlattenedDiagnosticMessage(writer, WrapASTDiagnostic(diagnostic), newline) +func WriteFlattenedASTDiagnosticMessage(writer io.Writer, diagnostic *ast.Diagnostic, newline string, locale locale.Locale) { + WriteFlattenedDiagnosticMessage(writer, WrapASTDiagnostic(diagnostic), newline, locale) } -func WriteFlattenedDiagnosticMessage(writer io.Writer, diagnostic Diagnostic, newline string) { - fmt.Fprint(writer, diagnostic.Message()) +func WriteFlattenedDiagnosticMessage(writer io.Writer, diagnostic Diagnostic, newline string, locale locale.Locale) { + fmt.Fprint(writer, diagnostic.Localize(locale)) for _, chain := range diagnostic.MessageChain() { - flattenDiagnosticMessageChain(writer, chain, newline, 1 /*level*/) + flattenDiagnosticMessageChain(writer, chain, newline, locale, 1 /*level*/) } } -func flattenDiagnosticMessageChain(writer io.Writer, chain Diagnostic, newLine string, level int) { +func flattenDiagnosticMessageChain(writer io.Writer, chain Diagnostic, newLine string, locale locale.Locale, level int) { fmt.Fprint(writer, newLine) for range level { fmt.Fprint(writer, " ") } - fmt.Fprint(writer, chain.Message()) + fmt.Fprint(writer, chain.Localize(locale)) for _, child := range chain.MessageChain() { - flattenDiagnosticMessageChain(writer, child, newLine, level+1) + flattenDiagnosticMessageChain(writer, child, newLine, locale, level+1) } } @@ -345,21 +347,21 @@ func WriteErrorSummaryText(output io.Writer, allDiagnostics []Diagnostic, format if totalErrorCount == 1 { // Special-case a single error. if len(errorSummary.GlobalErrors) > 0 || firstFileName == "" { - message = diagnostics.Found_1_error.Format() + message = diagnostics.Found_1_error.Localize(formatOpts.Locale) } else { - message = diagnostics.Found_1_error_in_0.Format(firstFileName) + message = diagnostics.Found_1_error_in_0.Localize(formatOpts.Locale, firstFileName) } } else { switch numErroringFiles { case 0: // No file-specific errors. - message = diagnostics.Found_0_errors.Format(totalErrorCount) + message = diagnostics.Found_0_errors.Localize(formatOpts.Locale, totalErrorCount) case 1: // One file with errors. - message = diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1.Format(totalErrorCount, firstFileName) + message = diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1.Localize(formatOpts.Locale, totalErrorCount, firstFileName) default: // Multiple files with errors. - message = diagnostics.Found_0_errors_in_1_files.Format(totalErrorCount, numErroringFiles) + message = diagnostics.Found_0_errors_in_1_files.Localize(formatOpts.Locale, totalErrorCount, numErroringFiles) } } fmt.Fprint(output, formatOpts.NewLine) @@ -418,7 +420,7 @@ func writeTabularErrorsDisplay(output io.Writer, errorSummary *ErrorSummary, for // !!! // TODO (drosen): This was never localized. // Should make this better. - headerRow := diagnostics.Errors_Files.Message() + headerRow := diagnostics.Errors_Files.Localize(formatOpts.Locale) leftColumnHeadingLength := len(strings.Split(headerRow, " ")[0]) lengthOfBiggestErrorCount := len(strconv.Itoa(maxErrors)) leftPaddingGoal := max(leftColumnHeadingLength, lengthOfBiggestErrorCount) @@ -470,7 +472,7 @@ func WriteFormatDiagnostic(output io.Writer, diagnostic Diagnostic, formatOpts * } fmt.Fprintf(output, "%s TS%d: ", diagnostic.Category().Name(), diagnostic.Code()) - WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine) + WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine, formatOpts.Locale) fmt.Fprint(output, formatOpts.NewLine) } @@ -478,12 +480,12 @@ func FormatDiagnosticsStatusWithColorAndTime(output io.Writer, time string, diag fmt.Fprint(output, "[") writeWithStyleAndReset(output, time, foregroundColorEscapeGrey) fmt.Fprint(output, "] ") - WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine) + WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine, formatOpts.Locale) } func FormatDiagnosticsStatusAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions) { fmt.Fprint(output, time, " - ") - WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine) + WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine, formatOpts.Locale) } var ScreenStartingCodes = []int32{ diff --git a/pkg/execute/build/buildtask.go b/pkg/execute/build/buildtask.go index de9600e12..0fe4a2b29 100644 --- a/pkg/execute/build/buildtask.go +++ b/pkg/execute/build/buildtask.go @@ -220,7 +220,7 @@ func (t *BuildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) Config: t.resolved, Host: &compilerHost{ host: orchestrator.host, - trace: tsc.GetTraceWithWriterFromSys(&t.result.builder, orchestrator.opts.Testing), + trace: tsc.GetTraceWithWriterFromSys(&t.result.builder, orchestrator.opts.Command.Locale(), orchestrator.opts.Testing), }, JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, }) diff --git a/pkg/execute/build/compilerHost.go b/pkg/execute/build/compilerHost.go index ea94fb322..893480ba4 100644 --- a/pkg/execute/build/compilerHost.go +++ b/pkg/execute/build/compilerHost.go @@ -3,6 +3,7 @@ package build import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/tsoptions" "github.com/buke/typescript-go-internal/pkg/tspath" "github.com/buke/typescript-go-internal/pkg/vfs" @@ -10,7 +11,7 @@ import ( type compilerHost struct { host *host - trace func(msg string) + trace func(msg *diagnostics.Message, args ...any) } var _ compiler.CompilerHost = (*compilerHost)(nil) @@ -27,8 +28,8 @@ func (h *compilerHost) GetCurrentDirectory() string { return h.host.GetCurrentDirectory() } -func (h *compilerHost) Trace(msg string) { - h.trace(msg) +func (h *compilerHost) Trace(msg *diagnostics.Message, args ...any) { + h.trace(msg, args...) } func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { diff --git a/pkg/execute/build/host.go b/pkg/execute/build/host.go index 6f0e569db..06ed463d6 100644 --- a/pkg/execute/build/host.go +++ b/pkg/execute/build/host.go @@ -6,6 +6,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/execute/incremental" "github.com/buke/typescript-go-internal/pkg/execute/tsc" "github.com/buke/typescript-go-internal/pkg/tsoptions" @@ -45,7 +46,7 @@ func (h *host) GetCurrentDirectory() string { return h.host.GetCurrentDirectory() } -func (h *host) Trace(msg string) { +func (h *host) Trace(msg *diagnostics.Message, args ...any) { panic("build.Orchestrator.host does not support tracing, use a different host for tracing") } diff --git a/pkg/execute/build/orchestrator.go b/pkg/execute/build/orchestrator.go index 3ef04b9ef..85eae230d 100644 --- a/pkg/execute/build/orchestrator.go +++ b/pkg/execute/build/orchestrator.go @@ -364,11 +364,11 @@ func (o *Orchestrator) getWriter(task *BuildTask) io.Writer { } func (o *Orchestrator) createBuilderStatusReporter(task *BuildTask) tsc.DiagnosticReporter { - return tsc.CreateBuilderStatusReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.CompilerOptions, o.opts.Testing) + return tsc.CreateBuilderStatusReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.Locale(), o.opts.Command.CompilerOptions, o.opts.Testing) } func (o *Orchestrator) createDiagnosticReporter(task *BuildTask) tsc.DiagnosticReporter { - return tsc.CreateDiagnosticReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.CompilerOptions) + return tsc.CreateDiagnosticReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.Locale(), o.opts.Command.CompilerOptions) } func NewOrchestrator(opts Options) *Orchestrator { @@ -392,9 +392,9 @@ func NewOrchestrator(opts Options) *Orchestrator { mTimes: &collections.SyncMap[tspath.Path, time.Time]{}, } if opts.Command.CompilerOptions.Watch.IsTrue() { - orchestrator.watchStatusReporter = tsc.CreateWatchStatusReporter(opts.Sys, opts.Command.CompilerOptions, opts.Testing) + orchestrator.watchStatusReporter = tsc.CreateWatchStatusReporter(opts.Sys, opts.Command.Locale(), opts.Command.CompilerOptions, opts.Testing) } else { - orchestrator.errorSummaryReporter = tsc.CreateReportErrorSummary(opts.Sys, opts.Command.CompilerOptions) + orchestrator.errorSummaryReporter = tsc.CreateReportErrorSummary(opts.Sys, opts.Command.Locale(), opts.Command.CompilerOptions) } return orchestrator } diff --git a/pkg/execute/incremental/buildInfo.go b/pkg/execute/incremental/buildInfo.go index 10c18bde6..d4cb0781f 100644 --- a/pkg/execute/incremental/buildInfo.go +++ b/pkg/execute/incremental/buildInfo.go @@ -201,7 +201,8 @@ type BuildInfoDiagnostic struct { End int `json:"end,omitzero"` Code int32 `json:"code,omitzero"` Category diagnostics.Category `json:"category,omitzero"` - Message string `json:"message,omitzero"` + MessageKey diagnostics.Key `json:"messageKey,omitzero"` + MessageArgs []string `json:"messageArgs,omitzero"` MessageChain []*BuildInfoDiagnostic `json:"messageChain,omitzero"` RelatedInformation []*BuildInfoDiagnostic `json:"relatedInformation,omitzero"` ReportsUnnecessary bool `json:"reportsUnnecessary,omitzero"` diff --git a/pkg/execute/incremental/buildinfotosnapshot.go b/pkg/execute/incremental/buildinfotosnapshot.go index ecd3d8860..2c2a497bb 100644 --- a/pkg/execute/incremental/buildinfotosnapshot.go +++ b/pkg/execute/incremental/buildinfotosnapshot.go @@ -79,7 +79,8 @@ func (t *toSnapshot) toBuildInfoDiagnosticsWithFileName(diagnostics []*BuildInfo end: d.End, code: d.Code, category: d.Category, - message: d.Message, + messageKey: d.MessageKey, + messageArgs: d.MessageArgs, messageChain: t.toBuildInfoDiagnosticsWithFileName(d.MessageChain), relatedInformation: t.toBuildInfoDiagnosticsWithFileName(d.RelatedInformation), reportsUnnecessary: d.ReportsUnnecessary, diff --git a/pkg/execute/incremental/snapshot.go b/pkg/execute/incremental/snapshot.go index 9179771aa..24414daef 100644 --- a/pkg/execute/incremental/snapshot.go +++ b/pkg/execute/incremental/snapshot.go @@ -137,7 +137,8 @@ type buildInfoDiagnosticWithFileName struct { end int code int32 category diagnostics.Category - message string + messageKey diagnostics.Key + messageArgs []string messageChain []*buildInfoDiagnosticWithFileName relatedInformation []*buildInfoDiagnosticWithFileName reportsUnnecessary bool @@ -165,12 +166,13 @@ func (b *buildInfoDiagnosticWithFileName) toDiagnostic(p *compiler.Program, file for _, info := range b.relatedInformation { relatedInformation = append(relatedInformation, info.toDiagnostic(p, fileForDiagnostic)) } - return ast.NewDiagnosticWith( + return ast.NewDiagnosticFromSerialized( fileForDiagnostic, core.NewTextRange(b.pos, b.end), b.code, b.category, - b.message, + b.messageKey, + b.messageArgs, messageChain, relatedInformation, b.reportsUnnecessary, @@ -301,7 +303,12 @@ func diagnosticToStringBuilder(diagnostic *ast.Diagnostic, file *ast.SourceFile, } builder.WriteString(diagnostic.Category().Name()) builder.WriteString(fmt.Sprintf("%d: ", diagnostic.Code())) - builder.WriteString(diagnostic.Message()) + builder.WriteString(string(diagnostic.MessageKey())) + builder.WriteString("\n") + for _, arg := range diagnostic.MessageArgs() { + builder.WriteString(arg) + builder.WriteString("\n") + } for _, chain := range diagnostic.MessageChain() { diagnosticToStringBuilder(chain, file, builder) } diff --git a/pkg/execute/incremental/snapshottobuildinfo.go b/pkg/execute/incremental/snapshottobuildinfo.go index 0a56d9a03..ab52192e3 100644 --- a/pkg/execute/incremental/snapshottobuildinfo.go +++ b/pkg/execute/incremental/snapshottobuildinfo.go @@ -128,7 +128,8 @@ func (t *toBuildInfo) toBuildInfoDiagnosticsFromFileNameDiagnostics(diagnostics End: d.end, Code: d.code, Category: d.category, - Message: d.message, + MessageKey: d.messageKey, + MessageArgs: d.messageArgs, MessageChain: t.toBuildInfoDiagnosticsFromFileNameDiagnostics(d.messageChain), RelatedInformation: t.toBuildInfoDiagnosticsFromFileNameDiagnostics(d.relatedInformation), ReportsUnnecessary: d.reportsUnnecessary, @@ -154,7 +155,8 @@ func (t *toBuildInfo) toBuildInfoDiagnosticsFromDiagnostics(filePath tspath.Path End: d.Loc().End(), Code: d.Code(), Category: d.Category(), - Message: d.Message(), + MessageKey: d.MessageKey(), + MessageArgs: d.MessageArgs(), MessageChain: t.toBuildInfoDiagnosticsFromDiagnostics(filePath, d.MessageChain()), RelatedInformation: t.toBuildInfoDiagnosticsFromDiagnostics(filePath, d.RelatedInformation()), ReportsUnnecessary: d.ReportsUnnecessary(), diff --git a/pkg/execute/tsc.go b/pkg/execute/tsc.go index dacd57393..38b8563f6 100644 --- a/pkg/execute/tsc.go +++ b/pkg/execute/tsc.go @@ -15,6 +15,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/execute/tsc" "github.com/buke/typescript-go-internal/pkg/format" "github.com/buke/typescript-go-internal/pkg/jsonutil" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/pprof" "github.com/buke/typescript-go-internal/pkg/tsoptions" @@ -61,11 +62,8 @@ func fmtMain(sys tsc.System, input, output string) tsc.ExitStatus { } func tscBuildCompilation(sys tsc.System, buildCommand *tsoptions.ParsedBuildCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult { - reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), buildCommand.CompilerOptions) - - // if (buildOptions.locale) { - // validateLocaleAndSetLanguage(buildOptions.locale, sys, errors); - // } + locale := buildCommand.Locale() + reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), locale, buildCommand.CompilerOptions) if len(buildCommand.Errors) > 0 { for _, err := range buildCommand.Errors { @@ -81,8 +79,8 @@ func tscBuildCompilation(sys tsc.System, buildCommand *tsoptions.ParsedBuildComm } if buildCommand.CompilerOptions.Help.IsTrue() { - tsc.PrintVersion(sys) - tsc.PrintBuildHelp(sys, tsoptions.BuildOpts) + tsc.PrintVersion(sys, locale) + tsc.PrintBuildHelp(sys, locale, tsoptions.BuildOpts) return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } @@ -96,8 +94,8 @@ func tscBuildCompilation(sys tsc.System, buildCommand *tsoptions.ParsedBuildComm func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult { configFileName := "" - reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions()) - // if commandLine.Options().Locale != nil + locale := commandLine.Locale() + reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), locale, commandLine.CompilerOptions()) if len(commandLine.Errors) > 0 { for _, e := range commandLine.Errors { @@ -113,17 +111,17 @@ func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, te } if commandLine.CompilerOptions().Init.IsTrue() { - tsc.WriteConfigFile(sys, reportDiagnostic, commandLine.Raw.(*collections.OrderedMap[string, any])) + tsc.WriteConfigFile(sys, locale, reportDiagnostic, commandLine.Raw.(*collections.OrderedMap[string, any])) return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } if commandLine.CompilerOptions().Version.IsTrue() { - tsc.PrintVersion(sys) + tsc.PrintVersion(sys, locale) return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } if commandLine.CompilerOptions().Help.IsTrue() || commandLine.CompilerOptions().All.IsTrue() { - tsc.PrintHelp(sys, commandLine) + tsc.PrintHelp(sys, locale, commandLine) return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } @@ -161,8 +159,8 @@ func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, te if commandLine.CompilerOptions().ShowConfig.IsTrue() { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, tspath.NormalizePath(sys.GetCurrentDirectory()))) } else { - tsc.PrintVersion(sys) - tsc.PrintHelp(sys, commandLine) + tsc.PrintVersion(sys, locale) + tsc.PrintHelp(sys, locale, commandLine) } return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } @@ -185,10 +183,10 @@ func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, te } configForCompilation = configParseResult // Updater to reflect pretty - reportDiagnostic = tsc.CreateDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions()) + reportDiagnostic = tsc.CreateDiagnosticReporter(sys, sys.Writer(), locale, commandLine.CompilerOptions()) } - reportErrorSummary := tsc.CreateReportErrorSummary(sys, configForCompilation.CompilerOptions()) + reportErrorSummary := tsc.CreateReportErrorSummary(sys, locale, configForCompilation.CompilerOptions()) if compilerOptionsFromCommandLine.ShowConfig.IsTrue() { showConfig(sys, configForCompilation.CompilerOptions()) return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} @@ -240,8 +238,8 @@ func findConfigFile(searchPath string, fileExists func(string) bool, configName return result } -func getTraceFromSys(sys tsc.System, testing tsc.CommandLineTesting) func(msg string) { - return tsc.GetTraceWithWriterFromSys(sys.Writer(), testing) +func getTraceFromSys(sys tsc.System, locale locale.Locale, testing tsc.CommandLineTesting) func(msg *diagnostics.Message, args ...any) { + return tsc.GetTraceWithWriterFromSys(sys.Writer(), locale, testing) } func performIncrementalCompilation( @@ -253,7 +251,7 @@ func performIncrementalCompilation( compileTimes *tsc.CompileTimes, testing tsc.CommandLineTesting, ) tsc.CommandLineResult { - host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing)) + host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, config.Locale(), testing)) buildInfoReadStart := sys.Now() oldProgram := incremental.ReadBuildInfoProgram(config, incremental.NewBuildInfoReader(host), host) compileTimes.BuildInfoReadTime = sys.Now().Sub(buildInfoReadStart) @@ -296,7 +294,7 @@ func performCompilation( compileTimes *tsc.CompileTimes, testing tsc.CommandLineTesting, ) tsc.CommandLineResult { - host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing)) + host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, config.Locale(), testing)) // todo: cache, statistics, tracing parseStart := sys.Now() program := compiler.NewProgram(compiler.ProgramOptions{ diff --git a/pkg/execute/tsc/compile.go b/pkg/execute/tsc/compile.go index 8e607d630..626690060 100644 --- a/pkg/execute/tsc/compile.go +++ b/pkg/execute/tsc/compile.go @@ -7,7 +7,9 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/execute/incremental" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tspath" "github.com/buke/typescript-go-internal/pkg/vfs" ) @@ -56,7 +58,7 @@ type CommandLineTesting interface { OnBuildStatusReportEnd(w io.Writer) OnWatchStatusReportStart() OnWatchStatusReportEnd() - GetTrace(w io.Writer) func(msg string) + GetTrace(w io.Writer, locale locale.Locale) func(msg *diagnostics.Message, args ...any) OnProgram(program *incremental.Program) } diff --git a/pkg/execute/tsc/diagnostics.go b/pkg/execute/tsc/diagnostics.go index d829ac0d2..ffddd4eb7 100644 --- a/pkg/execute/tsc/diagnostics.go +++ b/pkg/execute/tsc/diagnostics.go @@ -8,16 +8,18 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnosticwriter" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tspath" ) -func getFormatOptsOfSys(sys System) *diagnosticwriter.FormattingOptions { +func getFormatOptsOfSys(sys System, locale locale.Locale) *diagnosticwriter.FormattingOptions { return &diagnosticwriter.FormattingOptions{ NewLine: "\n", ComparePathsOptions: tspath.ComparePathsOptions{ CurrentDirectory: sys.GetCurrentDirectory(), UseCaseSensitiveFileNames: sys.FS().UseCaseSensitiveFileNames(), }, + Locale: locale, } } @@ -25,11 +27,11 @@ type DiagnosticReporter = func(*ast.Diagnostic) func QuietDiagnosticReporter(diagnostic *ast.Diagnostic) {} -func CreateDiagnosticReporter(sys System, w io.Writer, options *core.CompilerOptions) DiagnosticReporter { +func CreateDiagnosticReporter(sys System, w io.Writer, locale locale.Locale, options *core.CompilerOptions) DiagnosticReporter { if options.Quiet.IsTrue() { return QuietDiagnosticReporter } - formatOpts := getFormatOptsOfSys(sys) + formatOpts := getFormatOptsOfSys(sys, locale) if shouldBePretty(sys, options) { return func(diagnostic *ast.Diagnostic) { diagnosticwriter.FormatDiagnosticWithColorAndContext(w, diagnosticwriter.WrapASTDiagnostic(diagnostic), formatOpts) @@ -123,9 +125,9 @@ type DiagnosticsReporter = func(diagnostics []*ast.Diagnostic) func QuietDiagnosticsReporter(diagnostics []*ast.Diagnostic) {} -func CreateReportErrorSummary(sys System, options *core.CompilerOptions) DiagnosticsReporter { +func CreateReportErrorSummary(sys System, locale locale.Locale, options *core.CompilerOptions) DiagnosticsReporter { if shouldBePretty(sys, options) { - formatOpts := getFormatOptsOfSys(sys) + formatOpts := getFormatOptsOfSys(sys, locale) return func(diagnostics []*ast.Diagnostic) { diagnosticwriter.WriteErrorSummaryText(sys.Writer(), diagnosticwriter.FromASTDiagnostics(diagnostics), formatOpts) } @@ -133,12 +135,12 @@ func CreateReportErrorSummary(sys System, options *core.CompilerOptions) Diagnos return QuietDiagnosticsReporter } -func CreateBuilderStatusReporter(sys System, w io.Writer, options *core.CompilerOptions, testing CommandLineTesting) DiagnosticReporter { +func CreateBuilderStatusReporter(sys System, w io.Writer, locale locale.Locale, options *core.CompilerOptions, testing CommandLineTesting) DiagnosticReporter { if options.Quiet.IsTrue() { return QuietDiagnosticReporter } - formatOpts := getFormatOptsOfSys(sys) + formatOpts := getFormatOptsOfSys(sys, locale) writeStatus := core.IfElse(shouldBePretty(sys, options), diagnosticwriter.FormatDiagnosticsStatusWithColorAndTime, diagnosticwriter.FormatDiagnosticsStatusAndTime) return func(diagnostic *ast.Diagnostic) { writerDiagnostic := diagnosticwriter.WrapASTDiagnostic(diagnostic) @@ -151,8 +153,8 @@ func CreateBuilderStatusReporter(sys System, w io.Writer, options *core.Compiler } } -func CreateWatchStatusReporter(sys System, options *core.CompilerOptions, testing CommandLineTesting) DiagnosticReporter { - formatOpts := getFormatOptsOfSys(sys) +func CreateWatchStatusReporter(sys System, locale locale.Locale, options *core.CompilerOptions, testing CommandLineTesting) DiagnosticReporter { + formatOpts := getFormatOptsOfSys(sys, locale) writeStatus := core.IfElse(shouldBePretty(sys, options), diagnosticwriter.FormatDiagnosticsStatusWithColorAndTime, diagnosticwriter.FormatDiagnosticsStatusAndTime) return func(diagnostic *ast.Diagnostic) { writerDiagnostic := diagnosticwriter.WrapASTDiagnostic(diagnostic) diff --git a/pkg/execute/tsc/emit.go b/pkg/execute/tsc/emit.go index bb8895a59..0d7fbb157 100644 --- a/pkg/execute/tsc/emit.go +++ b/pkg/execute/tsc/emit.go @@ -10,17 +10,19 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tsoptions" "github.com/buke/typescript-go-internal/pkg/tspath" ) -func GetTraceWithWriterFromSys(w io.Writer, testing CommandLineTesting) func(msg string) { +func GetTraceWithWriterFromSys(w io.Writer, locale locale.Locale, testing CommandLineTesting) func(msg *diagnostics.Message, args ...any) { if testing == nil { - return func(msg string) { - fmt.Fprintln(w, msg) + return func(msg *diagnostics.Message, args ...any) { + fmt.Fprintln(w, msg.Localize(locale, args...)) } } else { - return testing.GetTrace(w) + return testing.GetTrace(w, locale) } } @@ -133,7 +135,7 @@ func listFiles(input EmitInput, emitResult *compiler.EmitResult) { } } if options.ExplainFiles.IsTrue() { - input.Program.ExplainFiles(input.Writer) + input.Program.ExplainFiles(input.Writer, input.Config.Locale()) } else if options.ListFiles.IsTrue() || options.ListFilesOnly.IsTrue() { for _, file := range input.Program.GetSourceFiles() { fmt.Fprintln(input.Writer, file.FileName()) diff --git a/pkg/execute/tsc/help.go b/pkg/execute/tsc/help.go index c3f7914aa..c374e5982 100644 --- a/pkg/execute/tsc/help.go +++ b/pkg/execute/tsc/help.go @@ -8,18 +8,19 @@ import ( "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tsoptions" ) -func PrintVersion(sys System) { - fmt.Fprintln(sys.Writer(), diagnostics.Version_0.Format(core.Version())) +func PrintVersion(sys System, locale locale.Locale) { + fmt.Fprintln(sys.Writer(), diagnostics.Version_0.Localize(locale, core.Version())) } -func PrintHelp(sys System, commandLine *tsoptions.ParsedCommandLine) { +func PrintHelp(sys System, locale locale.Locale, commandLine *tsoptions.ParsedCommandLine) { if commandLine.CompilerOptions().All.IsFalseOrUnknown() { - printEasyHelp(sys, getOptionsForHelp(commandLine)) + printEasyHelp(sys, locale, getOptionsForHelp(commandLine)) } else { - printAllHelp(sys, getOptionsForHelp(commandLine)) + printAllHelp(sys, locale, getOptionsForHelp(commandLine)) } } @@ -63,20 +64,20 @@ func getHeader(sys System, message string) []string { return header } -func printEasyHelp(sys System, simpleOptions []*tsoptions.CommandLineOption) { +func printEasyHelp(sys System, locale locale.Locale, simpleOptions []*tsoptions.CommandLineOption) { colors := createColors(sys) var output []string example := func(examples []string, desc *diagnostics.Message) { for _, example := range examples { output = append(output, " ", colors.blue(example), "\n") } - output = append(output, " ", desc.Format(), "\n", "\n") + output = append(output, " ", desc.Localize(locale), "\n", "\n") } - msg := diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Format() + " - " + diagnostics.Version_0.Format(core.Version()) + msg := diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Localize(locale) + " - " + diagnostics.Version_0.Localize(locale, core.Version()) output = append(output, getHeader(sys, msg)...) - output = append(output, colors.bold(diagnostics.COMMON_COMMANDS.Format()), "\n", "\n") + output = append(output, colors.bold(diagnostics.COMMON_COMMANDS.Localize(locale)), "\n", "\n") example([]string{"tsc"}, diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory) example([]string{"tsc app.ts util.ts"}, diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options) @@ -96,50 +97,49 @@ func printEasyHelp(sys System, simpleOptions []*tsoptions.CommandLineOption) { } } - output = append(output, generateSectionOptionsOutput(sys, diagnostics.COMMAND_LINE_FLAGS.Format(), cliCommands /*subCategory*/, false /*beforeOptionsDescription*/, nil /*afterOptionsDescription*/, nil)...) + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.COMMAND_LINE_FLAGS.Localize(locale), cliCommands /*subCategory*/, false /*beforeOptionsDescription*/, nil /*afterOptionsDescription*/, nil)...) - // !!! locale formatMessage - after := diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0.Format("https://aka.ms/tsc") - output = append(output, generateSectionOptionsOutput(sys, diagnostics.COMMON_COMPILER_OPTIONS.Format(), configOpts /*subCategory*/, false /*beforeOptionsDescription*/, nil, &after)...) + after := diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0.Localize(locale, "https://aka.ms/tsc") + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.COMMON_COMPILER_OPTIONS.Localize(locale), configOpts /*subCategory*/, false /*beforeOptionsDescription*/, nil, &after)...) for _, chunk := range output { fmt.Fprint(sys.Writer(), chunk) } } -func printAllHelp(sys System, options []*tsoptions.CommandLineOption) { +func printAllHelp(sys System, locale locale.Locale, options []*tsoptions.CommandLineOption) { var output []string - msg := diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Format() + " - " + diagnostics.Version_0.Format(core.Version()) + msg := diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Localize(locale) + " - " + diagnostics.Version_0.Localize(locale, core.Version()) output = append(output, getHeader(sys, msg)...) // ALL COMPILER OPTIONS section - afterCompilerOptions := diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0.Format("https://aka.ms/tsc") - output = append(output, generateSectionOptionsOutput(sys, diagnostics.ALL_COMPILER_OPTIONS.Format(), options, true, nil, &afterCompilerOptions)...) + afterCompilerOptions := diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0.Localize(locale, "https://aka.ms/tsc") + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.ALL_COMPILER_OPTIONS.Localize(locale), options, true, nil, &afterCompilerOptions)...) // WATCH OPTIONS section - beforeWatchOptions := diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon.Format() - output = append(output, generateSectionOptionsOutput(sys, diagnostics.WATCH_OPTIONS.Format(), tsoptions.OptionsForWatch, false, &beforeWatchOptions, nil)...) + beforeWatchOptions := diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon.Localize(locale) + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.WATCH_OPTIONS.Localize(locale), tsoptions.OptionsForWatch, false, &beforeWatchOptions, nil)...) // BUILD OPTIONS section - beforeBuildOptions := diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0.Format("https://aka.ms/tsc-composite-builds") + beforeBuildOptions := diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0.Localize(locale, "https://aka.ms/tsc-composite-builds") buildOptions := core.Filter(tsoptions.OptionsForBuild, func(option *tsoptions.CommandLineOption) bool { return option != &tsoptions.TscBuildOption }) - output = append(output, generateSectionOptionsOutput(sys, diagnostics.BUILD_OPTIONS.Format(), buildOptions, false, &beforeBuildOptions, nil)...) + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.BUILD_OPTIONS.Localize(locale), buildOptions, false, &beforeBuildOptions, nil)...) for _, chunk := range output { fmt.Fprint(sys.Writer(), chunk) } } -func PrintBuildHelp(sys System, buildOptions []*tsoptions.CommandLineOption) { +func PrintBuildHelp(sys System, locale locale.Locale, buildOptions []*tsoptions.CommandLineOption) { var output []string - output = append(output, getHeader(sys, diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Format()+" - "+diagnostics.Version_0.Format(core.Version()))...) - before := diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0.Format("https://aka.ms/tsc-composite-builds") + output = append(output, getHeader(sys, diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Localize(locale)+" - "+diagnostics.Version_0.Localize(locale, core.Version()))...) + before := diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0.Localize(locale, "https://aka.ms/tsc-composite-builds") options := core.Filter(buildOptions, func(option *tsoptions.CommandLineOption) bool { return option != &tsoptions.TscBuildOption }) - output = append(output, generateSectionOptionsOutput(sys, diagnostics.BUILD_OPTIONS.Format(), options, false, &before, nil)...) + output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.BUILD_OPTIONS.Localize(locale), options, false, &before, nil)...) for _, chunk := range output { fmt.Fprint(sys.Writer(), chunk) @@ -148,6 +148,7 @@ func PrintBuildHelp(sys System, buildOptions []*tsoptions.CommandLineOption) { func generateSectionOptionsOutput( sys System, + locale locale.Locale, sectionName string, options []*tsoptions.CommandLineOption, subCategory bool, @@ -160,7 +161,7 @@ func generateSectionOptionsOutput( output = append(output, *beforeOptionsDescription, "\n", "\n") } if !subCategory { - output = append(output, generateGroupOptionOutput(sys, options)...) + output = append(output, generateGroupOptionOutput(sys, locale, options)...) if afterOptionsDescription != nil { output = append(output, *afterOptionsDescription, "\n", "\n") } @@ -172,7 +173,7 @@ func generateSectionOptionsOutput( if option.Category == nil { continue } - curCategory := option.Category.Format() + curCategory := option.Category.Localize(locale) if _, exists := categoryMap[curCategory]; !exists { categoryOrder = append(categoryOrder, curCategory) } @@ -181,7 +182,7 @@ func generateSectionOptionsOutput( for _, key := range categoryOrder { value := categoryMap[key] output = append(output, "### ", key, "\n", "\n") - output = append(output, generateGroupOptionOutput(sys, value)...) + output = append(output, generateGroupOptionOutput(sys, locale, value)...) } if afterOptionsDescription != nil { output = append(output, *afterOptionsDescription, "\n", "\n") @@ -190,7 +191,7 @@ func generateSectionOptionsOutput( return output } -func generateGroupOptionOutput(sys System, optionsList []*tsoptions.CommandLineOption) []string { +func generateGroupOptionOutput(sys System, locale locale.Locale, optionsList []*tsoptions.CommandLineOption) []string { var maxLength int for _, option := range optionsList { curLenght := len(getDisplayNameTextOfOption(option)) @@ -206,7 +207,7 @@ func generateGroupOptionOutput(sys System, optionsList []*tsoptions.CommandLineO var lines []string for _, option := range optionsList { - tmp := generateOptionOutput(sys, option, rightAlignOfLeftPart, leftAlignOfRightPart) + tmp := generateOptionOutput(sys, locale, option, rightAlignOfLeftPart, leftAlignOfRightPart) lines = append(lines, tmp...) } @@ -220,6 +221,7 @@ func generateGroupOptionOutput(sys System, optionsList []*tsoptions.CommandLineO func generateOptionOutput( sys System, + locale locale.Locale, option *tsoptions.CommandLineOption, rightAlignOfLeft, leftAlignOfRight int, ) []string { @@ -230,11 +232,11 @@ func generateOptionOutput( name := getDisplayNameTextOfOption(option) // value type and possible value - valueCandidates := getValueCandidate(option) + valueCandidates := getValueCandidate(sys, locale, option) var defaultValueDescription string if msg, ok := option.DefaultValueDescription.(*diagnostics.Message); ok && msg != nil { - defaultValueDescription = msg.Format() + defaultValueDescription = msg.Localize(locale) } else { defaultValueDescription = formatDefaultValue( option.DefaultValueDescription, @@ -250,7 +252,7 @@ func generateOptionOutput( if terminalWidth >= 80 { description := "" if option.Description != nil { - description = option.Description.Format() + description = option.Description.Localize(locale) } text = append(text, getPrettyOutput(colors, name, description, rightAlignOfLeft, leftAlignOfRight, terminalWidth, true /*colorLeft*/)...) text = append(text, "\n") @@ -260,7 +262,7 @@ func generateOptionOutput( text = append(text, "\n") } if defaultValueDescription != "" { - text = append(text, getPrettyOutput(colors, diagnostics.X_default_Colon.Format(), defaultValueDescription, rightAlignOfLeft, leftAlignOfRight, terminalWidth, false /*colorLeft*/)...) + text = append(text, getPrettyOutput(colors, diagnostics.X_default_Colon.Localize(locale), defaultValueDescription, rightAlignOfLeft, leftAlignOfRight, terminalWidth, false /*colorLeft*/)...) text = append(text, "\n") } } @@ -268,7 +270,7 @@ func generateOptionOutput( } else { text = append(text, colors.blue(name), "\n") if option.Description != nil { - text = append(text, option.Description.Format()) + text = append(text, option.Description.Localize(locale)) } text = append(text, "\n") if showAdditionalInfoOutput(valueCandidates, option) { @@ -279,7 +281,7 @@ func generateOptionOutput( if valueCandidates != nil { text = append(text, "\n") } - text = append(text, diagnostics.X_default_Colon.Format(), " ", defaultValueDescription) + text = append(text, diagnostics.X_default_Colon.Localize(locale), " ", defaultValueDescription) } text = append(text, "\n") @@ -327,7 +329,7 @@ func showAdditionalInfoOutput(valueCandidates *valueCandidate, option *tsoptions return true } -func getValueCandidate(option *tsoptions.CommandLineOption) *valueCandidate { +func getValueCandidate(sys System, locale locale.Locale, option *tsoptions.CommandLineOption) *valueCandidate { // option.type might be "string" | "number" | "boolean" | "object" | "list" | Map // string -- any of: string // number -- any of: number @@ -349,11 +351,11 @@ func getValueCandidate(option *tsoptions.CommandLineOption) *valueCandidate { case tsoptions.CommandLineOptionTypeString, tsoptions.CommandLineOptionTypeNumber, tsoptions.CommandLineOptionTypeBoolean: - res.valueType = diagnostics.X_type_Colon.Format() + res.valueType = diagnostics.X_type_Colon.Localize(locale) case tsoptions.CommandLineOptionTypeList: - res.valueType = diagnostics.X_one_or_more_Colon.Format() + res.valueType = diagnostics.X_one_or_more_Colon.Localize(locale) default: - res.valueType = diagnostics.X_one_of_Colon.Format() + res.valueType = diagnostics.X_one_of_Colon.Localize(locale) } res.possibleValues = getPossibleValues(option) diff --git a/pkg/execute/tsc/init.go b/pkg/execute/tsc/init.go index 836685424..f2453ccfb 100644 --- a/pkg/execute/tsc/init.go +++ b/pkg/execute/tsc/init.go @@ -11,17 +11,18 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/jsonutil" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tsoptions" "github.com/buke/typescript-go-internal/pkg/tspath" ) -func WriteConfigFile(sys System, reportDiagnostic DiagnosticReporter, options *collections.OrderedMap[string, any]) { +func WriteConfigFile(sys System, locale locale.Locale, reportDiagnostic DiagnosticReporter, options *collections.OrderedMap[string, any]) { getCurrentDirectory := sys.GetCurrentDirectory() file := tspath.NormalizePath(tspath.CombinePaths(getCurrentDirectory, "tsconfig.json")) if sys.FS().FileExists(file) { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file)) } else { - _ = sys.FS().WriteFile(file, generateTSConfig(options), false) + _ = sys.FS().WriteFile(file, generateTSConfig(options, locale), false) output := []string{"\n"} output = append(output, getHeader(sys, "Created a new tsconfig.json")...) output = append(output, "You can learn more at https://aka.ms/tsconfig", "\n") @@ -29,7 +30,7 @@ func WriteConfigFile(sys System, reportDiagnostic DiagnosticReporter, options *c } } -func generateTSConfig(options *collections.OrderedMap[string, any]) string { +func generateTSConfig(options *collections.OrderedMap[string, any], locale locale.Locale) string { const tab = " " var result []string @@ -40,9 +41,8 @@ func generateTSConfig(options *collections.OrderedMap[string, any]) string { } } - // !!! locale getLocaleSpecificMessage emitHeader := func(header *diagnostics.Message) { - result = append(result, tab+tab+"// "+header.Format()) + result = append(result, tab+tab+"// "+header.Localize(locale)) } newline := func() { result = append(result, "") @@ -143,8 +143,7 @@ func generateTSConfig(options *collections.OrderedMap[string, any]) string { } push("{") - // !!! locale getLocaleSpecificMessage - push(tab + `// ` + diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file.Format()) + push(tab + `// ` + diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file.Localize(locale)) push(tab + `"compilerOptions": {`) emitHeader(diagnostics.File_Layout) diff --git a/pkg/execute/tsctests/readablebuildinfo.go b/pkg/execute/tsctests/readablebuildinfo.go index c47d041fa..8ef45e14f 100644 --- a/pkg/execute/tsctests/readablebuildinfo.go +++ b/pkg/execute/tsctests/readablebuildinfo.go @@ -62,7 +62,8 @@ type readableBuildInfoDiagnostic struct { End int `json:"end,omitzero"` Code int32 `json:"code,omitzero"` Category diagnostics.Category `json:"category,omitzero"` - Message string `json:"message,omitzero"` + MessageKey diagnostics.Key `json:"messageKey,omitzero"` + MessageArgs []string `json:"messageArgs,omitzero"` MessageChain []*readableBuildInfoDiagnostic `json:"messageChain,omitzero"` RelatedInformation []*readableBuildInfoDiagnostic `json:"relatedInformation,omitzero"` ReportsUnnecessary bool `json:"reportsUnnecessary,omitzero"` @@ -254,7 +255,8 @@ func (r *readableBuildInfo) toReadableBuildInfoDiagnostic(diagnostics []*increme End: d.End, Code: d.Code, Category: d.Category, - Message: d.Message, + MessageKey: d.MessageKey, + MessageArgs: d.MessageArgs, MessageChain: r.toReadableBuildInfoDiagnostic(d.MessageChain), RelatedInformation: r.toReadableBuildInfoDiagnostic(d.RelatedInformation), ReportsUnnecessary: d.ReportsUnnecessary, diff --git a/pkg/execute/tsctests/sys.go b/pkg/execute/tsctests/sys.go index 09b3d1ff0..2a7a66ed7 100644 --- a/pkg/execute/tsctests/sys.go +++ b/pkg/execute/tsctests/sys.go @@ -3,9 +3,7 @@ package tsctests import ( "fmt" "io" - "io/fs" "maps" - "slices" "strconv" "strings" "sync" @@ -14,8 +12,12 @@ import ( "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/execute" "github.com/buke/typescript-go-internal/pkg/execute/incremental" "github.com/buke/typescript-go-internal/pkg/execute/tsc" + "github.com/buke/typescript-go-internal/pkg/locale" + "github.com/buke/typescript-go-internal/pkg/testutil/fsbaselineutil" "github.com/buke/typescript-go-internal/pkg/testutil/harnessutil" "github.com/buke/typescript-go-internal/pkg/testutil/stringtestutil" "github.com/buke/typescript-go-internal/pkg/tsoptions" @@ -23,6 +25,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/vfs" "github.com/buke/typescript-go-internal/pkg/vfs/iovfs" "github.com/buke/typescript-go-internal/pkg/vfs/vfstest" + "golang.org/x/text/language" ) type FileMap map[string]any @@ -95,6 +98,20 @@ func NewTscSystem(files FileMap, useCaseSensitiveFileNames bool, cwd string) *Te } } +func GetFileMapWithBuild(files FileMap, commandLineArgs []string) FileMap { + sys := newTestSys(&tscInput{ + files: maps.Clone(files), + }, false) + execute.CommandLine(sys, commandLineArgs, sys) + sys.fs.writtenFiles.Range(func(key string) bool { + if text, ok := sys.fsFromFileMap().ReadFile(key); ok { + files[key] = text + } + return true + }) + return files +} + func newTestSys(tscInput *tscInput, forIncrementalCorrectness bool) *TestSys { cwd := tscInput.cwd if cwd == "" { @@ -114,6 +131,11 @@ func newTestSys(tscInput *tscInput, forIncrementalCorrectness bool) *TestSys { }, currentWrite) sys.env = tscInput.env sys.forIncrementalCorrectness = forIncrementalCorrectness + sys.fsDiffer = &fsbaselineutil.FSDiffer{ + FS: sys.fs.FS.(iovfs.FsWithSys), + DefaultLibs: func() *collections.SyncSet[string] { return sys.fs.defaultLibs }, + WrittenFiles: &sys.fs.writtenFiles, + } // Ensure the default library file is present sys.ensureLibPathExists("lib.d.ts") @@ -126,24 +148,12 @@ func newTestSys(tscInput *tscInput, forIncrementalCorrectness bool) *TestSys { return sys } -type diffEntry struct { - content string - mTime time.Time - isWritten bool - symlinkTarget string -} - -type snapshot struct { - snap map[string]*diffEntry - defaultLibs *collections.SyncSet[string] -} - type TestSys struct { currentWrite *strings.Builder programBaselines strings.Builder programIncludeBaselines strings.Builder tracer *harnessutil.TracerForBaselining - serializedDiff *snapshot + fsDiffer *fsbaselineutil.FSDiffer forIncrementalCorrectness bool fs *testFs @@ -171,11 +181,11 @@ func (s *TestSys) FS() vfs.FS { } func (s *TestSys) fsFromFileMap() iovfs.FsWithSys { - return s.fs.FS.(iovfs.FsWithSys) + return s.fsDiffer.FS } func (s *TestSys) mapFs() *vfstest.MapFS { - return s.fsFromFileMap().FSys().(*vfstest.MapFS) + return s.fsDiffer.MapFs() } func (s *TestSys) ensureLibPathExists(path string) { @@ -223,8 +233,8 @@ func (s *TestSys) OnEmittedFiles(result *compiler.EmitResult, mTimesCache *colle if result != nil { for _, file := range result.EmittedFiles { modTime := s.mapFs().GetModTime(file) - if s.serializedDiff != nil { - if diff, ok := s.serializedDiff.snap[file]; ok && diff.mTime.Equal(modTime) { + if serializedDiff := s.fsDiffer.SerializedDiff(); serializedDiff != nil { + if diff, ok := serializedDiff.Snap[file]; ok && diff.MTime.Equal(modTime) { // Even though written, timestamp was reverted continue } @@ -278,12 +288,13 @@ func (s *TestSys) OnWatchStatusReportEnd() { fmt.Fprintln(s.Writer(), watchStatusReportEnd) } -func (s *TestSys) GetTrace(w io.Writer) func(str string) { - return func(str string) { +func (s *TestSys) GetTrace(w io.Writer, locale locale.Locale) func(msg *diagnostics.Message, args ...any) { + return func(msg *diagnostics.Message, args ...any) { fmt.Fprintln(w, traceStart) defer fmt.Fprintln(w, traceEnd) // With tsc -b building projects in parallel we cannot serialize the package.json lookup trace // so trace as if it wasnt cached + str := msg.Localize(locale, args...) s.tracer.TraceWithWriter(w, str, w == s.Writer()) } } @@ -412,13 +423,18 @@ type outputSanitizer struct { outputLines []string } +var ( + englishVersion = diagnostics.Version_0.Localize(locale.Default, core.Version()) + fakeEnglishVersion = diagnostics.Version_0.Localize(locale.Default, harnessutil.FakeTSVersion) + czech = locale.Locale(language.MustParse("cs")) + czechVersion = diagnostics.Version_0.Localize(czech, core.Version()) + fakeCzechVersion = diagnostics.Version_0.Localize(czech, harnessutil.FakeTSVersion) +) + func (o *outputSanitizer) addOutputLine(s string) { - if change := strings.ReplaceAll(s, fmt.Sprintf("'%s'", core.Version()), fmt.Sprintf("'%s'", harnessutil.FakeTSVersion)); change != s { - s = change - } - if change := strings.ReplaceAll(s, "Version "+core.Version(), "Version "+harnessutil.FakeTSVersion); change != s { - s = change - } + s = strings.ReplaceAll(s, fmt.Sprintf("'%s'", core.Version()), fmt.Sprintf("'%s'", harnessutil.FakeTSVersion)) + s = strings.ReplaceAll(s, englishVersion, fakeEnglishVersion) + s = strings.ReplaceAll(s, czechVersion, fakeCzechVersion) o.outputLines = append(o.outputLines, s) } @@ -500,83 +516,7 @@ func (s *TestSys) clearOutput() { } func (s *TestSys) baselineFSwithDiff(baseline io.Writer) { - // todo: baselines the entire fs, possibly doesn't correctly diff all cases of emitted files, since emit isn't fully implemented and doesn't always emit the same way as strada - snap := map[string]*diffEntry{} - - diffs := map[string]string{} - - for path, file := range s.mapFs().Entries() { - if file.Mode&fs.ModeSymlink != 0 { - target, ok := s.mapFs().GetTargetOfSymlink(path) - if !ok { - panic("Failed to resolve symlink target: " + path) - } - newEntry := &diffEntry{symlinkTarget: target} - snap[path] = newEntry - s.addFsEntryDiff(diffs, newEntry, path) - continue - } else if file.Mode.IsRegular() { - newEntry := &diffEntry{content: string(file.Data), mTime: file.ModTime, isWritten: s.fs.writtenFiles.Has(path)} - snap[path] = newEntry - s.addFsEntryDiff(diffs, newEntry, path) - } - } - if s.serializedDiff != nil { - for path := range s.serializedDiff.snap { - if fileInfo := s.mapFs().GetFileInfo(path); fileInfo == nil { - // report deleted - s.addFsEntryDiff(diffs, nil, path) - } - } - } - var defaultLibs collections.SyncSet[string] - if s.fs.defaultLibs != nil { - s.fs.defaultLibs.Range(func(libPath string) bool { - defaultLibs.Add(libPath) - return true - }) - } - s.serializedDiff = &snapshot{ - snap: snap, - defaultLibs: &defaultLibs, - } - diffKeys := slices.Collect(maps.Keys(diffs)) - slices.Sort(diffKeys) - for _, path := range diffKeys { - fmt.Fprint(baseline, "//// ["+path+"] ", diffs[path], "\n") - } - fmt.Fprintln(baseline) - s.fs.writtenFiles = collections.SyncSet[string]{} // Reset written files after baseline -} - -func (s *TestSys) addFsEntryDiff(diffs map[string]string, newDirContent *diffEntry, path string) { - var oldDirContent *diffEntry - var defaultLibs *collections.SyncSet[string] - if s.serializedDiff != nil { - oldDirContent = s.serializedDiff.snap[path] - defaultLibs = s.serializedDiff.defaultLibs - } - // todo handle more cases of fs changes - if oldDirContent == nil { - if s.fs.defaultLibs == nil || !s.fs.defaultLibs.Has(path) { - if newDirContent.symlinkTarget != "" { - diffs[path] = "-> " + newDirContent.symlinkTarget + " *new*" - } else { - diffs[path] = "*new* \n" + newDirContent.content - } - } - } else if newDirContent == nil { - diffs[path] = "*deleted*" - } else if newDirContent.content != oldDirContent.content { - diffs[path] = "*modified* \n" + newDirContent.content - } else if newDirContent.isWritten { - diffs[path] = "*rewrite with same content*" - } else if newDirContent.mTime != oldDirContent.mTime { - diffs[path] = "*mTime changed*" - } else if defaultLibs != nil && defaultLibs.Has(path) && s.fs.defaultLibs != nil && !s.fs.defaultLibs.Has(path) { - // Lib file that was read - diffs[path] = "*Lib*\n" + newDirContent.content - } + s.fsDiffer.BaselineFSwithDiff(baseline) } func (s *TestSys) writeFileNoError(path string, content string, writeByteOrderMark bool) { diff --git a/pkg/execute/tsctests/tsc_test.go b/pkg/execute/tsctests/tsc_test.go index fe49d0b23..de719dd72 100644 --- a/pkg/execute/tsctests/tsc_test.go +++ b/pkg/execute/tsctests/tsc_test.go @@ -205,6 +205,14 @@ func TestTscCommandline(t *testing.T) { }, commandLineArgs: []string{"-p", "."}, }, + { + subScenario: "locale", + commandLineArgs: []string{"--locale", "cs", "--version"}, + }, + { + subScenario: "bad locale", + commandLineArgs: []string{"--locale", "whoops", "--version"}, + }, } for _, testCase := range testCases { diff --git a/pkg/execute/tsctests/tscbuild_test.go b/pkg/execute/tsctests/tscbuild_test.go index bfd908aa3..b4e646e6a 100644 --- a/pkg/execute/tsctests/tscbuild_test.go +++ b/pkg/execute/tsctests/tscbuild_test.go @@ -148,6 +148,16 @@ func TestBuildCommandLine(t *testing.T) { files: FileMap{}, commandLineArgs: []string{"--build", "--help"}, }, + { + subScenario: "locale", + files: FileMap{}, + commandLineArgs: []string{"--build", "--help", "--locale", "en"}, + }, + { + subScenario: "bad locale", + files: FileMap{}, + commandLineArgs: []string{"--build", "--help", "--locale", "whoops"}, + }, { subScenario: "different options", files: getBuildCommandLineDifferentOptionsMap("composite"), diff --git a/pkg/execute/watcher.go b/pkg/execute/watcher.go index a4b693bae..a318043ed 100644 --- a/pkg/execute/watcher.go +++ b/pkg/execute/watcher.go @@ -54,7 +54,7 @@ func createWatcher( } func (w *Watcher) start() { - w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), nil, getTraceFromSys(w.sys, w.testing)) + w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), nil, getTraceFromSys(w.sys, w.config.Locale(), w.testing)) w.program = incremental.ReadBuildInfoProgram(w.config, incremental.NewBuildInfoReader(w.host), w.host) if w.testing == nil { @@ -131,7 +131,7 @@ func (w *Watcher) hasErrorsInTsConfig() bool { } w.config = configParseResult } - w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(w.sys, w.testing)) + w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(w.sys, w.config.Locale(), w.testing)) return false } diff --git a/pkg/fourslash/_scripts/convertFourslash.mts b/pkg/fourslash/_scripts/convertFourslash.mts index 3573bec57..d4dc96c95 100644 --- a/pkg/fourslash/_scripts/convertFourslash.mts +++ b/pkg/fourslash/_scripts/convertFourslash.mts @@ -137,7 +137,7 @@ function getTestInput(content: string): string { /** * Parses a Strada fourslash statement and returns the corresponding Corsa commands. - * @returns an array of commands if the statement is a valid fourslash command, or `false` if the statement could not be parsed. + * @returns an array of commands if the statement is a valid fourslash command, or `undefined` if the statement could not be parsed. */ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { if (ts.isVariableStatement(statement)) { @@ -222,6 +222,8 @@ function parseFourslashStatement(statement: ts.Statement): Cmd[] | undefined { case "baselineSyntacticDiagnostics": case "baselineSyntacticAndSemanticDiagnostics": return [{ kind: "verifyBaselineDiagnostics" }]; + case "navigateTo": + return parseVerifyNavigateTo(callExpression.arguments); } } // `goTo....` @@ -1469,29 +1471,9 @@ function parseBaselineMarkerOrRangeArg(arg: ts.Expression): string | undefined { return getGoStringLiteral(arg.text); } else if (ts.isIdentifier(arg) || (ts.isElementAccessExpression(arg) && ts.isIdentifier(arg.expression))) { - const argName = ts.isIdentifier(arg) ? arg.text : (arg.expression as ts.Identifier).text; - const file = arg.getSourceFile(); - const varStmts = file.statements.filter(ts.isVariableStatement); - for (const varStmt of varStmts) { - for (const decl of varStmt.declarationList.declarations) { - if (ts.isArrayBindingPattern(decl.name) && decl.initializer?.getText().includes("ranges")) { - for (let i = 0; i < decl.name.elements.length; i++) { - const elem = decl.name.elements[i]; - if (ts.isBindingElement(elem) && ts.isIdentifier(elem.name) && elem.name.text === argName) { - // `const [range_0, ..., range_n, ...] = test.ranges();` and arg is `range_n` - if (elem.dotDotDotToken === undefined) { - return `f.Ranges()[${i}]`; - } - // `const [range_0, ..., ...rest] = test.ranges();` and arg is `rest[n]` - if (ts.isElementAccessExpression(arg)) { - return `f.Ranges()[${i + parseInt(arg.argumentExpression!.getText())}]`; - } - // `const [range_0, ..., ...rest] = test.ranges();` and arg is `rest` - return `ToAny(f.Ranges()[${i}:])...`; - } - } - } - } + const result = parseRangeVariable(arg); + if (result) { + return result; } const init = getNodeOfKind(arg, ts.isCallExpression); if (init) { @@ -1507,7 +1489,35 @@ function parseBaselineMarkerOrRangeArg(arg: ts.Expression): string | undefined { return result; } } - console.error(`Unrecognized range argument: ${arg.getText()}`); + console.error(`Unrecognized argument in verify.baselineRename: ${arg.getText()}`); + return undefined; +} + +function parseRangeVariable(arg: ts.Identifier | ts.ElementAccessExpression): string | undefined { + const argName = ts.isIdentifier(arg) ? arg.text : (arg.expression as ts.Identifier).text; + const file = arg.getSourceFile(); + const varStmts = file.statements.filter(ts.isVariableStatement); + for (const varStmt of varStmts) { + for (const decl of varStmt.declarationList.declarations) { + if (ts.isArrayBindingPattern(decl.name) && decl.initializer?.getText().includes("ranges")) { + for (let i = 0; i < decl.name.elements.length; i++) { + const elem = decl.name.elements[i]; + if (ts.isBindingElement(elem) && ts.isIdentifier(elem.name) && elem.name.text === argName) { + // `const [range_0, ..., range_n, ...] = test.ranges();` and arg is `range_n` + if (elem.dotDotDotToken === undefined) { + return `f.Ranges()[${i}]`; + } + // `const [range_0, ..., ...rest] = test.ranges();` and arg is `rest[n]` + if (ts.isElementAccessExpression(arg)) { + return `f.Ranges()[${i + parseInt(arg.argumentExpression!.getText())}]`; + } + // `const [range_0, ..., ...rest] = test.ranges();` and arg is `rest` + return `ToAny(f.Ranges()[${i}:])...`; + } + } + } + } + } return undefined; } @@ -1794,6 +1804,212 @@ function parseSortText(expr: ts.Expression): string | undefined { } } +function parseVerifyNavigateTo(args: ts.NodeArray): [VerifyNavToCmd] | undefined { + const goArgs = []; + for (const arg of args) { + const result = parseVerifyNavigateToArg(arg); + if (!result) { + return undefined; + } + goArgs.push(result); + } + return [{ + kind: "verifyNavigateTo", + args: goArgs, + }]; +} + +function parseVerifyNavigateToArg(arg: ts.Expression): string | undefined { + if (!ts.isObjectLiteralExpression(arg)) { + console.error(`Expected object literal expression for verify.navigateTo argument, got ${arg.getText()}`); + return undefined; + } + let prefs; + const items = []; + let pattern: string | undefined; + for (const prop of arg.properties) { + if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) { + console.error(`Expected property assignment with identifier name for verify.navigateTo argument, got ${prop.getText()}`); + return undefined; + } + const propName = prop.name.text; + switch (propName) { + case "pattern": { + let patternInit = getStringLiteralLike(prop.initializer); + if (!patternInit) { + console.error(`Expected string literal for pattern in verify.navigateTo argument, got ${prop.initializer.getText()}`); + return undefined; + } + pattern = getGoStringLiteral(patternInit.text); + break; + } + case "fileName": + // no longer supported + continue; + case "expected": { + const init = prop.initializer; + if (!ts.isArrayLiteralExpression(init)) { + console.error(`Expected array literal expression for expected property in verify.navigateTo argument, got ${init.getText()}`); + return undefined; + } + for (const elem of init.elements) { + const result = parseNavToItem(elem); + if (!result) { + return undefined; + } + items.push(result); + } + break; + } + case "excludeLibFiles": { + if (prop.initializer.kind === ts.SyntaxKind.FalseKeyword) { + prefs = `&lsutil.UserPreferences{ExcludeLibrarySymbolsInNavTo: false}`; + } + } + } + } + if (!prefs) { + prefs = "nil"; + } + return `{ + Pattern: ${pattern ? pattern : '""'}, + Preferences: ${prefs}, + Exact: PtrTo([]*lsproto.SymbolInformation{${items.length ? items.join(",\n") + ",\n" : ""}}), + }`; +} + +function parseNavToItem(arg: ts.Expression): string | undefined { + let item = getNodeOfKind(arg, ts.isObjectLiteralExpression); + if (!item) { + console.error(`Expected object literal expression for navigateTo item, got ${arg.getText()}`); + return undefined; + } + const itemProps: string[] = []; + for (const prop of item.properties) { + if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) { + console.error(`Expected property assignment with identifier name for navigateTo item, got ${prop.getText()}`); + return undefined; + } + const propName = prop.name.text; + const init = prop.initializer; + switch (propName) { + case "name": { + let nameInit; + if (!(nameInit = getStringLiteralLike(init))) { + console.error(`Expected string literal for name in navigateTo item, got ${init.getText()}`); + return undefined; + } + itemProps.push(`Name: ${getGoStringLiteral(nameInit.text)}`); + break; + } + case "kind": { + const goKind = getSymbolKind(init); + if (!goKind) { + return undefined; + } + itemProps.push(`Kind: lsproto.${goKind}`); + break; + } + case "kindModifiers": { + if (init.getText().includes("deprecated")) { + itemProps.push(`Tags: &[]lsproto.SymbolTag{lsproto.SymbolTagDeprecated}`); + } + break; + } + case "range": { + if (ts.isIdentifier(init) || (ts.isElementAccessExpression(init) && ts.isIdentifier(init.expression))) { + let parsedRange = parseRangeVariable(init); + if (parsedRange) { + itemProps.push(`Location: ${parsedRange}.LSLocation()`); + continue; + } + } + if (ts.isElementAccessExpression(init) && init.expression.getText() === "test.ranges()") { + itemProps.push(`Location: f.Ranges()[${parseInt(init.argumentExpression.getText())}].LSLocation()`); + continue; + } + console.error(`Expected range variable for range in navigateTo item, got ${init.getText()}`); + return undefined; + } + case "containerName": { + let nameInit; + if (!(nameInit = getStringLiteralLike(init))) { + console.error(`Expected string literal for container name in navigateTo item, got ${init.getText()}`); + return undefined; + } + itemProps.push(`ContainerName: PtrTo(${getGoStringLiteral(nameInit.text)})`); + break; + } + default: + // ignore other properties + } + } + return `{\n${itemProps.join(",\n")},\n}`; +} + +function getSymbolKind(kind: ts.Expression): string | undefined { + let result; + if (!(result = getStringLiteralLike(kind))) { + console.error(`Expected string literal for symbol kind, got ${kind.getText()}`); + return undefined; + } + switch (result.text) { + case "script": + return "SymbolKindFile"; + case "module": + return "SymbolKindModule"; + case "class": + case "local class": + return "SymbolKindClass"; + case "interface": + return "SymbolKindInterface"; + case "type": + return "SymbolKindClass"; + case "enum": + return "SymbolKindEnum"; + case "enum member": + return "SymbolKindEnumMember"; + case "var": + case "local var": + case "using": + case "await using": + return "SymbolKindVariable"; + case "function": + case "local function": + return "SymbolKindFunction"; + case "method": + return "SymbolKindMethod"; + case "getter": + case "setter": + case "property": + case "accessor": + return "SymbolKindProperty"; + case "constructor": + case "construct": + return "SymbolKindConstructor"; + case "call": + case "index": + return "SymbolKindFunction"; + case "parameter": + return "SymbolKindVariable"; + case "type parameter": + return "SymbolKindTypeParameter"; + case "primitive type": + return "SymbolKindObject"; + case "const": + case "let": + return "SymbolKindVariable"; + case "directory": + return "SymbolKindPackage"; + case "external module name": + return "SymbolKindModule"; + case "string": + return "SymbolKindString"; + default: + return "SymbolKindVariable"; + } +} + interface VerifyCompletionsCmd { kind: "verifyCompletions"; marker: string; @@ -1905,6 +2121,11 @@ interface VerifyBaselineDiagnosticsCmd { kind: "verifyBaselineDiagnostics"; } +interface VerifyNavToCmd { + kind: "verifyNavigateTo"; + args: string[]; +} + type Cmd = | VerifyCompletionsCmd | VerifyApplyCodeActionFromCompletionCmd @@ -1919,6 +2140,7 @@ type Cmd = | VerifyQuickInfoCmd | VerifyBaselineRenameCmd | VerifyRenameInfoCmd + | VerifyNavToCmd | VerifyBaselineInlayHintsCmd | VerifyImportFixAtPositionCmd | VerifyDiagnosticsCmd @@ -2036,6 +2258,10 @@ function generateImportFixAtPosition({ expectedTexts, preferences }: VerifyImpor return `f.VerifyImportFixAtPosition(t, []string{\n${expectedTexts.join(",\n")},\n}, ${preferences})`; } +function generateNavigateTo({ args }: VerifyNavToCmd): string { + return `f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{\n${args.join(", ")}})`; +} + function generateCmd(cmd: Cmd): string { switch (cmd.kind) { case "verifyCompletions": @@ -2082,6 +2308,8 @@ function generateCmd(cmd: Cmd): string { return `f.${funcName}(t, ${cmd.arg})`; case "verifyBaselineDiagnostics": return `f.VerifyBaselineNonSuggestionDiagnostics(t)`; + case "verifyNavigateTo": + return generateNavigateTo(cmd); default: let neverCommand: never = cmd; throw new Error(`Unknown command kind: ${neverCommand as Cmd["kind"]}`); diff --git a/pkg/fourslash/_scripts/manualTests.txt b/pkg/fourslash/_scripts/manualTests.txt index bc1045b9e..1dfd6557e 100644 --- a/pkg/fourslash/_scripts/manualTests.txt +++ b/pkg/fourslash/_scripts/manualTests.txt @@ -2,6 +2,12 @@ completionListInClosedFunction05 completionsAtIncompleteObjectLiteralProperty completionsSelfDeclaring1 completionsWithDeprecatedTag4 +navigationItemsExactMatch2 +navigationItemsSpecialPropertyAssignment +navto_excludeLib1 +navto_excludeLib2 +navto_excludeLib4 +navto_serverExcludeLib parserCorruptionAfterMapInClass quickInfoForOverloadOnConst1 renameDefaultKeyword diff --git a/pkg/fourslash/_scripts/updateFailing.mts b/pkg/fourslash/_scripts/updateFailing.mts index 5e56c019a..5ddf65585 100644 --- a/pkg/fourslash/_scripts/updateFailing.mts +++ b/pkg/fourslash/_scripts/updateFailing.mts @@ -13,7 +13,7 @@ function main() { const go = which.sync("go"); let testOutput: string; try { - testOutput = cp.execFileSync(go, ["test", "./internal/fourslash/tests/gen"], { encoding: "utf-8" }); + testOutput = cp.execFileSync(go, ["test", "-v", "./internal/fourslash/tests/gen"], { encoding: "utf-8" }); } catch (error) { testOutput = (error as { stdout: string; }).stdout as string; @@ -21,7 +21,7 @@ function main() { const panicRegex = /^panic/m; if (panicRegex.test(testOutput)) { fs.writeFileSync(failingTestsPath, oldFailingTests, "utf-8"); - throw new Error("Unrecovered panic detected in tests"); + throw new Error("Unrecovered panic detected in tests\n" + testOutput); } const failRegex = /--- FAIL: ([\S]+)/gm; const failingTests: string[] = []; diff --git a/pkg/fourslash/baselineutil.go b/pkg/fourslash/baselineutil.go index c086aab3b..181d9e477 100644 --- a/pkg/fourslash/baselineutil.go +++ b/pkg/fourslash/baselineutil.go @@ -38,8 +38,13 @@ const ( type baselineCommand string func (f *FourslashTest) addResultToBaseline(t *testing.T, command baselineCommand, actual string) { - b, ok := f.baselines[command] - if !ok { + var b *strings.Builder + if f.testData.isStateBaseliningEnabled() { + // Single baseline for all commands + b = &f.stateBaseline.baseline + } else if builder, ok := f.baselines[command]; ok { + b = builder + } else { f.baselines[command] = &strings.Builder{} b = f.baselines[command] } @@ -334,6 +339,7 @@ type baselineFourslashLocationsOptions struct { startMarkerPrefix func(span documentSpan) *string endMarkerSuffix func(span documentSpan) *string + getLocationData func(span documentSpan) string additionalSpan *documentSpan } @@ -384,7 +390,7 @@ func (f *FourslashTest) getBaselineForGroupedSpansWithFileContents(groupedRanges return nil } - content, ok := f.vfs.ReadFile(path) + content, ok := f.textOfFile(path) if !ok { // !!! error? return nil @@ -416,7 +422,7 @@ func (f *FourslashTest) getBaselineForGroupedSpansWithFileContents(groupedRanges // already added the file to the baseline. if options.additionalSpan != nil && !foundAdditionalLocation { fileName := options.additionalSpan.uri.FileName() - if content, ok := f.vfs.ReadFile(fileName); ok { + if content, ok := f.textOfFile(fileName); ok { baselineEntries = append( baselineEntries, f.getBaselineContentForFile(fileName, content, []documentSpan{*options.additionalSpan}, spanToContextId, options), @@ -430,7 +436,7 @@ func (f *FourslashTest) getBaselineForGroupedSpansWithFileContents(groupedRanges if !foundMarker && options.marker != nil { // If we didn't find the marker in any file, we need to add it. markerFileName := options.marker.FileName() - if content, ok := f.vfs.ReadFile(markerFileName); ok { + if content, ok := f.textOfFile(markerFileName); ok { baselineEntries = append(baselineEntries, f.getBaselineContentForFile(markerFileName, content, nil, spanToContextId, options)) } } @@ -440,6 +446,13 @@ func (f *FourslashTest) getBaselineForGroupedSpansWithFileContents(groupedRanges return strings.Join(baselineEntries, "\n\n") } +func (f *FourslashTest) textOfFile(fileName string) (string, bool) { + if _, ok := f.openFiles[fileName]; ok { + return f.getScriptInfo(fileName).content, true + } + return f.vfs.ReadFile(fileName) +} + type baselineDetail struct { pos lsproto.Position positionMarker string @@ -482,8 +495,12 @@ func (f *FourslashTest) getBaselineContentForFile( } textSpanIndex := len(details) + startMarker := "[|" + if options.getLocationData != nil { + startMarker += options.getLocationData(span) + } details = append(details, - &baselineDetail{pos: span.textSpan.Start, positionMarker: "[|", span: &span, kind: "textStart"}, + &baselineDetail{pos: span.textSpan.Start, positionMarker: startMarker, span: &span, kind: "textStart"}, &baselineDetail{pos: span.textSpan.End, positionMarker: core.OrElse(options.endMarker, "|]"), span: &span, kind: "textEnd"}, ) @@ -885,3 +902,7 @@ func (t *textWithContext) getIndex(i any) *int { func codeFence(lang string, code string) string { return "```" + lang + "\n" + code + "\n```" } + +func symbolInformationToData(symbol *lsproto.SymbolInformation) string { + return fmt.Sprintf("{| name: %s, kind: %s |}", symbol.Name, symbol.Kind.String()) +} diff --git a/pkg/fourslash/fourslash.go b/pkg/fourslash/fourslash.go index 65e10bf64..677a3eeeb 100644 --- a/pkg/fourslash/fourslash.go +++ b/pkg/fourslash/fourslash.go @@ -18,6 +18,8 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/diagnosticwriter" + "github.com/buke/typescript-go-internal/pkg/execute/tsctests" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/ls" "github.com/buke/typescript-go-internal/pkg/ls/lsconv" "github.com/buke/typescript-go-internal/pkg/ls/lsutil" @@ -31,6 +33,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/testutil/tsbaseline" "github.com/buke/typescript-go-internal/pkg/tspath" "github.com/buke/typescript-go-internal/pkg/vfs" + "github.com/buke/typescript-go-internal/pkg/vfs/iovfs" "github.com/buke/typescript-go-internal/pkg/vfs/vfstest" "gotest.tools/v3/assert" ) @@ -42,9 +45,11 @@ type FourslashTest struct { id int32 vfs vfs.FS - testData *TestData // !!! consolidate test files from test data and script info - baselines map[baselineCommand]*strings.Builder - rangesByText *collections.MultiMap[string, *RangeMarker] + testData *TestData // !!! consolidate test files from test data and script info + baselines map[baselineCommand]*strings.Builder + rangesByText *collections.MultiMap[string, *RangeMarker] + openFiles map[string]struct{} + stateBaseline *stateBaseline scriptInfos map[string]*scriptInfo converters *lsconv.Converters @@ -139,7 +144,7 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten t.Skip("bundled files are not embedded") } fileName := getBaseFileNameFromTest(t) + tspath.ExtensionTs - testfs := make(map[string]string) + testfs := make(map[string]any) scriptInfos := make(map[string]*scriptInfo) testData := ParseTestData(t, content, fileName) for _, file := range testData.Files { @@ -148,10 +153,20 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten scriptInfos[filePath] = newScriptInfo(filePath, file.Content) } + for link, target := range testData.Symlinks { + filePath := tspath.GetNormalizedAbsolutePath(link, rootDir) + testfs[filePath] = vfstest.Symlink(tspath.GetNormalizedAbsolutePath(target, rootDir)) + } + compilerOptions := &core.CompilerOptions{ SkipDefaultLibCheck: core.TSTrue, } harnessutil.SetCompilerOptionsFromTestConfig(t, testData.GlobalOptions, compilerOptions, rootDir) + if commandLines := testData.GlobalOptions["tsc"]; commandLines != "" { + for commandLine := range strings.SplitSeq(commandLines, ",") { + tsctests.GetFileMapWithBuild(testfs, strings.Split(commandLine, " ")) + } + } // Skip tests with deprecated/removed compiler options if compilerOptions.BaseUrl != "" { @@ -178,7 +193,9 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten inputReader, inputWriter := newLSPPipe() outputReader, outputWriter := newLSPPipe() - fs := bundled.WrapFS(vfstest.FromMap(testfs, true /*useCaseSensitiveFileNames*/)) + + fsFromMap := vfstest.FromMap(testfs, true /*useCaseSensitiveFileNames*/) + fs := bundled.WrapFS(fsFromMap) var err strings.Builder server := lsp.NewServer(&lsp.ServerOptions{ @@ -221,16 +238,23 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten scriptInfos: scriptInfos, converters: converters, baselines: make(map[baselineCommand]*strings.Builder), + openFiles: make(map[string]struct{}), } // !!! temporary; remove when we have `handleDidChangeConfiguration`/implicit project config support // !!! replace with a proper request *after initialize* f.server.SetCompilerOptionsForInferredProjects(t.Context(), compilerOptions) f.initialize(t, capabilities) - for _, file := range testData.Files { - f.openFile(t, file.fileName) + + if testData.isStateBaseliningEnabled() { + // Single baseline, so initialize project state baseline too + f.stateBaseline = newStateBaseline(fsFromMap.(iovfs.FsWithSys)) + } else { + for _, file := range testData.Files { + f.openFile(t, file.fileName) + } + f.activeFilename = f.testData.Files[0].fileName } - f.activeFilename = f.testData.Files[0].fileName _, testPath, _, _ := runtime.Caller(1) t.Cleanup(func() { @@ -241,7 +265,9 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten } func getBaseFileNameFromTest(t *testing.T) string { - name := strings.TrimPrefix(t.Name(), "Test") + name := t.Name() + name = core.LastOrNil(strings.Split(name, "/")) + name = strings.TrimPrefix(name, "Test") return stringutil.LowerFirstChar(name) } @@ -262,8 +288,8 @@ func (f *FourslashTest) initialize(t *testing.T, capabilities *lsproto.ClientCap } params.Capabilities = getCapabilitiesWithDefaults(capabilities) // !!! check for errors? - sendRequest(t, f, lsproto.InitializeInfo, params) - sendNotification(t, f, lsproto.InitializedInfo, &lsproto.InitializedParams{}) + sendRequestWorker(t, f, lsproto.InitializeInfo, params) + sendNotificationWorker(t, f, lsproto.InitializedInfo, &lsproto.InitializedParams{}) } var ( @@ -364,7 +390,7 @@ func getCapabilitiesWithDefaults(capabilities *lsproto.ClientCapabilities) *lspr return &capabilitiesWithDefaults } -func sendRequest[Params, Resp any](t *testing.T, f *FourslashTest, info lsproto.RequestInfo[Params, Resp], params Params) (*lsproto.Message, Resp, bool) { +func sendRequestWorker[Params, Resp any](t *testing.T, f *FourslashTest, info lsproto.RequestInfo[Params, Resp], params Params) (*lsproto.Message, Resp, bool) { id := f.nextID() req := info.NewRequestMessage( lsproto.NewID(lsproto.IntegerOrString{Integer: &id}), @@ -407,7 +433,7 @@ func sendRequest[Params, Resp any](t *testing.T, f *FourslashTest, info lsproto. return resp, result, ok } -func sendNotification[Params any](t *testing.T, f *FourslashTest, info lsproto.NotificationInfo[Params], params Params) { +func sendNotificationWorker[Params any](t *testing.T, f *FourslashTest, info lsproto.NotificationInfo[Params], params Params) { notification := info.NewNotificationMessage( params, ) @@ -431,6 +457,39 @@ func (f *FourslashTest) readMsg(t *testing.T) *lsproto.Message { return msg } +func sendRequest[Params, Resp any](t *testing.T, f *FourslashTest, info lsproto.RequestInfo[Params, Resp], params Params) Resp { + t.Helper() + prefix := f.getCurrentPositionPrefix() + f.baselineState(t) + f.baselineRequestOrNotification(t, info.Method, params) + resMsg, result, resultOk := sendRequestWorker(t, f, info, params) + f.baselineState(t) + if resMsg == nil { + t.Fatalf(prefix+"Nil response received for %s request", info.Method) + } + if !resultOk { + t.Fatalf(prefix+"Unexpected %s response type: %T", info.Method, resMsg.AsResponse().Result) + } + return result +} + +func sendNotification[Params any](t *testing.T, f *FourslashTest, info lsproto.NotificationInfo[Params], params Params) { + t.Helper() + f.baselineState(t) + f.updateState(info.Method, params) + f.baselineRequestOrNotification(t, info.Method, params) + sendNotificationWorker(t, f, info, params) +} + +func (f *FourslashTest) updateState(method lsproto.Method, params any) { + switch method { + case lsproto.MethodTextDocumentDidOpen: + f.openFiles[params.(*lsproto.DidOpenTextDocumentParams).TextDocument.Uri.FileName()] = struct{}{} + case lsproto.MethodTextDocumentDidClose: + delete(f.openFiles, params.(*lsproto.DidCloseTextDocumentParams).TextDocument.Uri.FileName()) + } +} + func (f *FourslashTest) Configure(t *testing.T, config *lsutil.UserPreferences) { // !!! // Callers to this function may need to consider @@ -594,14 +653,44 @@ func (f *FourslashTest) getRangesInFile(fileName string) []*RangeMarker { func (f *FourslashTest) ensureActiveFile(t *testing.T, filename string) { if f.activeFilename != filename { - f.openFile(t, filename) + if _, ok := f.openFiles[filename]; !ok { + f.openFile(t, filename) + } else { + f.activeFilename = filename + } + } +} + +func (f *FourslashTest) CloseFileOfMarker(t *testing.T, markerName string) { + marker, ok := f.testData.MarkerPositions[markerName] + if !ok { + t.Fatalf("Marker '%s' not found", markerName) } + if f.activeFilename == marker.FileName() { + f.activeFilename = "" + } + if index := slices.IndexFunc(f.testData.Files, func(f *TestFileInfo) bool { return f.fileName == marker.FileName() }); index >= 0 { + testFile := f.testData.Files[index] + f.scriptInfos[testFile.fileName] = newScriptInfo(testFile.fileName, testFile.Content) + } else { + delete(f.scriptInfos, marker.FileName()) + } + sendNotification(t, f, lsproto.TextDocumentDidCloseInfo, &lsproto.DidCloseTextDocumentParams{ + TextDocument: lsproto.TextDocumentIdentifier{ + Uri: lsconv.FileNameToDocumentURI(marker.FileName()), + }, + }) } func (f *FourslashTest) openFile(t *testing.T, filename string) { script := f.getScriptInfo(filename) if script == nil { - t.Fatalf("File %s not found in test data", filename) + if content, ok := f.vfs.ReadFile(filename); ok { + script = newScriptInfo(filename, content) + f.scriptInfos[filename] = script + } else { + t.Fatalf("File %s not found in test data", filename) + } } f.activeFilename = filename sendNotification(t, f, lsproto.TextDocumentDidOpenInfo, &lsproto.DidOpenTextDocumentParams{ @@ -611,6 +700,7 @@ func (f *FourslashTest) openFile(t *testing.T, filename string) { Text: script.content, }, }) + f.baselineProjectsAfterNotification(t, filename) } func getLanguageKind(filename string) lsproto.LanguageKind { @@ -744,7 +834,6 @@ func (f *FourslashTest) verifyCompletionsWorker(t *testing.T, expected *Completi } func (f *FourslashTest) getCompletions(t *testing.T, userPreferences *lsutil.UserPreferences) *lsproto.CompletionList { - prefix := f.getCurrentPositionPrefix() params := &lsproto.CompletionParams{ TextDocument: lsproto.TextDocumentIdentifier{ Uri: lsconv.FileNameToDocumentURI(f.activeFilename), @@ -756,13 +845,7 @@ func (f *FourslashTest) getCompletions(t *testing.T, userPreferences *lsutil.Use reset := f.ConfigureWithReset(t, userPreferences) defer reset() } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentCompletionInfo, params) - if resMsg == nil { - t.Fatalf(prefix+"Nil response received for completion request", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for completion request: %T", resMsg.AsResponse().Result) - } + result := sendRequest(t, f, lsproto.TextDocumentCompletionInfo, params) return result.List } @@ -994,14 +1077,7 @@ func (f *FourslashTest) verifyCompletionItem(t *testing.T, prefix string, actual } func (f *FourslashTest) resolveCompletionItem(t *testing.T, item *lsproto.CompletionItem) *lsproto.CompletionItem { - prefix := f.getCurrentPositionPrefix() - resMsg, result, resultOk := sendRequest(t, f, lsproto.CompletionItemResolveInfo, item) - if resMsg == nil { - t.Fatal(prefix + "Expected non-nil response for completion item resolve, got nil") - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for completion item resolve: %T, Error: %v", resMsg.AsResponse().Result, resMsg.AsResponse().Error) - } + result := sendRequest(t, f, lsproto.CompletionItemResolveInfo, item) return result } @@ -1113,10 +1189,7 @@ func (f *FourslashTest) VerifyImportFixAtPosition(t *testing.T, expectedTexts [] Uri: lsconv.FileNameToDocumentURI(f.activeFilename), }, } - _, diagResult, diagOk := sendRequest(t, f, lsproto.TextDocumentDiagnosticInfo, diagParams) - if !diagOk { - t.Fatalf("Failed to get diagnostics") - } + diagResult := sendRequest(t, f, lsproto.TextDocumentDiagnosticInfo, diagParams) var diagnostics []*lsproto.Diagnostic if diagResult.FullDocumentDiagnosticReport != nil && diagResult.FullDocumentDiagnosticReport.Items != nil { @@ -1135,13 +1208,7 @@ func (f *FourslashTest) VerifyImportFixAtPosition(t *testing.T, expectedTexts [] Diagnostics: diagnostics, }, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentCodeActionInfo, params) - if resMsg == nil { - t.Fatalf("Nil response received for code action request at pos %v", f.currentCaretPosition) - } - if !resultOk { - t.Fatalf("Unexpected code action response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } + result := sendRequest(t, f, lsproto.TextDocumentCodeActionInfo, params) // Find all auto-import code actions (fixes with fixId/fixName related to imports) var importActions []*lsproto.CodeAction @@ -1237,22 +1304,7 @@ func (f *FourslashTest) VerifyBaselineFindAllReferences( Position: f.currentCaretPosition, Context: &lsproto.ReferenceContext{}, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentReferencesInfo, params) - if resMsg == nil { - if f.lastKnownMarkerName == nil { - t.Fatalf("Nil response received for references request at pos %v", f.currentCaretPosition) - } else { - t.Fatalf("Nil response received for references request at marker '%s'", *f.lastKnownMarkerName) - } - } - if !resultOk { - if f.lastKnownMarkerName == nil { - t.Fatalf("Unexpected references response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } else { - t.Fatalf("Unexpected references response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } - } - + result := sendRequest(t, f, lsproto.TextDocumentReferencesInfo, params) f.addResultToBaseline(t, findAllReferencesCmd, f.getBaselineForLocationsWithFileContents(*result.Locations, baselineFourslashLocationsOptions{ marker: markerOrRange, markerName: "/*FIND ALL REFS*/", @@ -1282,22 +1334,7 @@ func (f *FourslashTest) VerifyBaselineGoToDefinition( Position: f.currentCaretPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentDefinitionInfo, params) - if resMsg == nil { - if f.lastKnownMarkerName == nil { - t.Fatalf("Nil response received for definition request at pos %v", f.currentCaretPosition) - } else { - t.Fatalf("Nil response received for definition request at marker '%s'", *f.lastKnownMarkerName) - } - } - if !resultOk { - if f.lastKnownMarkerName == nil { - t.Fatalf("Unexpected definition response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } else { - t.Fatalf("Unexpected definition response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } - } - return result + return sendRequest(t, f, lsproto.TextDocumentDefinitionInfo, params) }, includeOriginalSelectionRange, markers..., @@ -1375,28 +1412,38 @@ func (f *FourslashTest) VerifyBaselineGoToTypeDefinition( Position: f.currentCaretPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentTypeDefinitionInfo, params) - if resMsg == nil { - if f.lastKnownMarkerName == nil { - t.Fatalf("Nil response received for type definition request at pos %v", f.currentCaretPosition) - } else { - t.Fatalf("Nil response received for type definition request at marker '%s'", *f.lastKnownMarkerName) - } - } - if !resultOk { - if f.lastKnownMarkerName == nil { - t.Fatalf("Unexpected type definition response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } else { - t.Fatalf("Unexpected type definition response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } - } - return result + return sendRequest(t, f, lsproto.TextDocumentTypeDefinitionInfo, params) }, false, /*includeOriginalSelectionRange*/ markers..., ) } +func (f *FourslashTest) VerifyBaselineWorkspaceSymbol(t *testing.T, query string) { + t.Helper() + result := sendRequest(t, f, lsproto.WorkspaceSymbolInfo, &lsproto.WorkspaceSymbolParams{Query: query}) + + locationToText := map[documentSpan]*lsproto.SymbolInformation{} + groupedRanges := collections.MultiMap[lsproto.DocumentUri, documentSpan]{} + var symbolInformations []*lsproto.SymbolInformation + if result.SymbolInformations != nil { + symbolInformations = *result.SymbolInformations + } + for _, symbol := range symbolInformations { + uri := symbol.Location.Uri + span := locationToSpan(symbol.Location) + groupedRanges.Add(uri, span) + locationToText[span] = symbol + } + + f.addResultToBaseline(t, "workspaceSymbol", f.getBaselineForGroupedSpansWithFileContents( + &groupedRanges, + baselineFourslashLocationsOptions{ + getLocationData: func(span documentSpan) string { return symbolInformationToData(locationToText[span]) }, + }, + )) +} + func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { markersAndItems := core.MapFiltered(f.Markers(), func(marker *Marker) (markerAndItem[*lsproto.Hover], bool) { if marker.Name == nil { @@ -1410,14 +1457,7 @@ func (f *FourslashTest) VerifyBaselineHover(t *testing.T) { Position: marker.LSPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentHoverInfo, params) - if resMsg == nil { - t.Fatalf(f.getCurrentPositionPrefix()+"Nil response received for quick info request", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(f.getCurrentPositionPrefix()+"Unexpected response type for quick info request: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentHoverInfo, params) return markerAndItem[*lsproto.Hover]{Marker: marker, Item: result.Hover}, true }) @@ -1481,14 +1521,7 @@ func (f *FourslashTest) VerifyBaselineSignatureHelp(t *testing.T) { Position: marker.LSPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentSignatureHelpInfo, params) - if resMsg == nil { - t.Fatalf(f.getCurrentPositionPrefix()+"Nil response received for signature help request", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(f.getCurrentPositionPrefix()+"Unexpected response type for signature help request: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentSignatureHelpInfo, params) return markerAndItem[*lsproto.SignatureHelp]{Marker: marker, Item: result.SignatureHelp}, true }) @@ -1602,17 +1635,7 @@ func (f *FourslashTest) VerifyBaselineSelectionRanges(t *testing.T) { Positions: []lsproto.Position{marker.LSPosition}, } - resMsg, selectionRangeResult, resultOk := sendRequest(t, f, lsproto.TextDocumentSelectionRangeInfo, params) - markerNameStr := *core.OrElse(marker.Name, ptrTo("(unnamed)")) - if resMsg == nil { - t.Fatalf("Nil response received for selection range request at marker '%s'", markerNameStr) - } - if !resultOk { - if resMsg.AsResponse().Error != nil { - t.Fatalf("Error response for selection range request at marker '%s': %v", markerNameStr, resMsg.AsResponse().Error) - } - t.Fatalf("Unexpected selection range response type at marker '%s': %T", markerNameStr, resMsg.AsResponse().Result) - } + selectionRangeResult := sendRequest(t, f, lsproto.TextDocumentSelectionRangeInfo, params) if selectionRangeResult.SelectionRanges == nil || len(*selectionRangeResult.SelectionRanges) == 0 { result.WriteString("No selection ranges available\n") @@ -1759,22 +1782,7 @@ func (f *FourslashTest) verifyBaselineDocumentHighlights( }, Position: f.currentCaretPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentDocumentHighlightInfo, params) - if resMsg == nil { - if f.lastKnownMarkerName == nil { - t.Fatalf("Nil response received for document highlights request at pos %v", f.currentCaretPosition) - } else { - t.Fatalf("Nil response received for document highlights request at marker '%s'", *f.lastKnownMarkerName) - } - } - if !resultOk { - if f.lastKnownMarkerName == nil { - t.Fatalf("Unexpected document highlights response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } else { - t.Fatalf("Unexpected document highlights response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } - } - + result := sendRequest(t, f, lsproto.TextDocumentDocumentHighlightInfo, params) highlights := result.DocumentHighlights if highlights == nil { highlights = &[]*lsproto.DocumentHighlight{} @@ -1981,10 +1989,6 @@ func (f *FourslashTest) editScript(t *testing.T, fileName string, start int, end } script.editContent(start, end, newText) - err := f.vfs.WriteFile(fileName, script.content, false) - if err != nil { - panic(fmt.Sprintf("Failed to write file %s: %v", fileName, err)) - } sendNotification(t, f, lsproto.TextDocumentDidChangeInfo, &lsproto.DidChangeTextDocumentParams{ TextDocument: lsproto.VersionedTextDocumentIdentifier{ Uri: lsconv.FileNameToDocumentURI(fileName), @@ -2020,13 +2024,7 @@ func (f *FourslashTest) getQuickInfoAtCurrentPosition(t *testing.T) *lsproto.Hov }, Position: f.currentCaretPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentHoverInfo, params) - if resMsg == nil { - t.Fatalf("Nil response received for hover request at marker '%s'", *f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf("Unexpected hover response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } + result := sendRequest(t, f, lsproto.TextDocumentHoverInfo, params) if result.Hover == nil { t.Fatalf("Expected hover result at marker '%s' but got nil", *f.lastKnownMarkerName) } @@ -2131,13 +2129,7 @@ func (f *FourslashTest) verifySignatureHelp( Position: f.currentCaretPosition, Context: context, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentSignatureHelpInfo, params) - if resMsg == nil { - t.Fatalf(prefix+"Nil response received for signature help request", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for signature help request: %T", resMsg.AsResponse().Result) - } + result := sendRequest(t, f, lsproto.TextDocumentSignatureHelpInfo, params) f.verifySignatureHelpResult(t, result.SignatureHelp, expected, prefix) } @@ -2173,19 +2165,13 @@ func (f *FourslashTest) BaselineAutoImportsCompletions(t *testing.T, markerNames Position: f.currentCaretPosition, Context: &lsproto.CompletionContext{}, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentCompletionInfo, params) + result := sendRequest(t, f, lsproto.TextDocumentCompletionInfo, params) prefix := fmt.Sprintf("At marker '%s': ", markerName) - if resMsg == nil { - t.Fatalf(prefix+"Nil response received for completion request for autoimports", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for completion request for autoimports: %T", resMsg.AsResponse().Result) - } f.writeToBaseline(autoImportsCmd, "// === Auto Imports === \n") - fileContent, ok := f.vfs.ReadFile(f.activeFilename) + fileContent, ok := f.textOfFile(f.activeFilename) if !ok { t.Fatalf(prefix+"Failed to read file %s for auto-import baseline", f.activeFilename) } @@ -2218,13 +2204,7 @@ func (f *FourslashTest) BaselineAutoImportsCompletions(t *testing.T, markerNames if item.Data == nil || *item.SortText != string(ls.SortTextAutoImportSuggestions) { continue } - resMsg, details, resultOk := sendRequest(t, f, lsproto.CompletionItemResolveInfo, item) - if resMsg == nil { - t.Fatalf(prefix+"Nil response received for resolve completion", f.lastKnownMarkerName) - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for resolve completion: %T, Error: %v", resMsg.AsResponse().Result, resMsg.AsResponse().Error) - } + details := sendRequest(t, f, lsproto.CompletionItemResolveInfo, item) if details == nil || details.AdditionalTextEdits == nil || len(*details.AdditionalTextEdits) == 0 { t.Fatalf(prefix+"Entry %s from %s returned no code changes from completion details request", item.Label, item.Detail) } @@ -2302,14 +2282,7 @@ func (f *FourslashTest) verifyBaselineRename( NewName: "?", } - prefix := f.getCurrentPositionPrefix() - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) - if resMsg == nil { - t.Fatal(prefix + "Nil response received for rename request") - } - if !resultOk { - t.Fatalf(prefix+"Unexpected rename response type: %T", resMsg.AsResponse().Result) - } + result := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) var changes map[lsproto.DocumentUri][]*lsproto.TextEdit if result.WorkspaceEdit != nil && result.WorkspaceEdit.Changes != nil { @@ -2382,14 +2355,7 @@ func (f *FourslashTest) VerifyRenameSucceeded(t *testing.T, preferences *lsutil. } prefix := f.getCurrentPositionPrefix() - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) - if resMsg == nil { - t.Fatal(prefix + "Nil response received for rename request") - } - if !resultOk { - t.Fatalf(prefix+"Unexpected rename response type: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) if result.WorkspaceEdit == nil || result.WorkspaceEdit.Changes == nil || len(*result.WorkspaceEdit.Changes) == 0 { t.Fatal(prefix + "Expected rename to succeed, but got no changes") } @@ -2406,14 +2372,7 @@ func (f *FourslashTest) VerifyRenameFailed(t *testing.T, preferences *lsutil.Use } prefix := f.getCurrentPositionPrefix() - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) - if resMsg == nil { - t.Fatal(prefix + "Nil response received for rename request") - } - if !resultOk { - t.Fatalf(prefix+"Unexpected rename response type: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentRenameInfo, params) if result.WorkspaceEdit != nil { t.Fatalf(prefix+"Expected rename to fail, but got changes: %s", cmp.Diff(result.WorkspaceEdit, nil)) } @@ -2451,15 +2410,19 @@ func (f *FourslashTest) getRangeText(r *RangeMarker) string { } func (f *FourslashTest) verifyBaselines(t *testing.T, testPath string) { - for command, content := range f.baselines { - baseline.Run(t, getBaselineFileName(t, command), content.String(), f.getBaselineOptions(command, testPath)) + if !f.testData.isStateBaseliningEnabled() { + for command, content := range f.baselines { + baseline.Run(t, getBaselineFileName(t, command), content.String(), f.getBaselineOptions(command, testPath)) + } + } else { + baseline.Run(t, getBaseFileNameFromTest(t)+".baseline", f.stateBaseline.baseline.String(), baseline.Options{Subfolder: "fourslash/state"}) } } func (f *FourslashTest) VerifyBaselineInlayHints( t *testing.T, span *lsproto.Range, - userPreferences *lsutil.UserPreferences, + testPreferences *lsutil.UserPreferences, ) { fileName := f.activeFilename var lspRange lsproto.Range @@ -2474,20 +2437,15 @@ func (f *FourslashTest) VerifyBaselineInlayHints( Range: lspRange, } - if userPreferences != nil { - reset := f.ConfigureWithReset(t, userPreferences) - defer reset() + preferences := testPreferences + if preferences == nil { + preferences = lsutil.NewDefaultUserPreferences() } + reset := f.ConfigureWithReset(t, preferences) + defer reset() prefix := fmt.Sprintf("At position (Ln %d, Col %d): ", lspRange.Start.Line, lspRange.Start.Character) - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentInlayHintInfo, params) - if resMsg == nil { - t.Fatal(prefix + "Nil response received for inlay hints request") - } - if !resultOk { - t.Fatalf(prefix+"Unexpected response type for inlay hints request: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentInlayHintInfo, params) fileLines := strings.Split(f.getScriptInfo(fileName).content, "\n") var annotations []string if result.InlayHints != nil { @@ -2565,14 +2523,7 @@ func (f *FourslashTest) getDiagnostics(t *testing.T, fileName string) []*lsproto Uri: lsconv.FileNameToDocumentURI(fileName), }, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentDiagnosticInfo, params) - if resMsg == nil { - t.Fatal("Nil response received for diagnostics request") - } - if !resultOk { - t.Fatalf("Unexpected response type for diagnostics request: %T", resMsg.AsResponse().Result) - } - + result := sendRequest(t, f, lsproto.TextDocumentDiagnosticInfo, params) if result.FullDocumentDiagnosticReport != nil { return result.FullDocumentDiagnosticReport.Items } @@ -2665,7 +2616,7 @@ func (d *fourslashDiagnostic) Category() diagnostics.Category { return d.category } -func (d *fourslashDiagnostic) Message() string { +func (d *fourslashDiagnostic) Localize(locale locale.Locale) string { return d.message } @@ -2792,24 +2743,82 @@ func (f *FourslashTest) VerifyBaselineGoToImplementation(t *testing.T, markerNam Position: f.currentCaretPosition, } - resMsg, result, resultOk := sendRequest(t, f, lsproto.TextDocumentImplementationInfo, params) - if resMsg == nil { - if f.lastKnownMarkerName == nil { - t.Fatalf("Nil response received for implementation request at pos %v", f.currentCaretPosition) - } else { - t.Fatalf("Nil response received for implementation request at marker '%s'", *f.lastKnownMarkerName) - } - } - if !resultOk { - if f.lastKnownMarkerName == nil { - t.Fatalf("Unexpected implementation response type at pos %v: %T", f.currentCaretPosition, resMsg.AsResponse().Result) - } else { - t.Fatalf("Unexpected implementation response type at marker '%s': %T", *f.lastKnownMarkerName, resMsg.AsResponse().Result) - } - } - return result + return sendRequest(t, f, lsproto.TextDocumentImplementationInfo, params) }, false, /*includeOriginalSelectionRange*/ markerNames..., ) } + +type VerifyWorkspaceSymbolCase struct { + Pattern string + Includes *[]*lsproto.SymbolInformation + Exact *[]*lsproto.SymbolInformation + Preferences *lsutil.UserPreferences +} + +// `verify.navigateTo` in Strada. +func (f *FourslashTest) VerifyWorkspaceSymbol(t *testing.T, cases []*VerifyWorkspaceSymbolCase) { + originalPreferences := f.userPreferences.Copy() + for _, testCase := range cases { + preferences := testCase.Preferences + if preferences == nil { + preferences = lsutil.NewDefaultUserPreferences() + } + f.Configure(t, preferences) + result := sendRequest(t, f, lsproto.WorkspaceSymbolInfo, &lsproto.WorkspaceSymbolParams{Query: testCase.Pattern}) + if result.SymbolInformations == nil { + t.Fatalf("Expected non-nil symbol information array from workspace symbol request") + } + if testCase.Includes != nil { + if testCase.Exact != nil { + t.Fatalf("Test case cannot have both 'Includes' and 'Exact' fields set") + } + verifyIncludesSymbols(t, *result.SymbolInformations, *testCase.Includes, "Workspace symbols mismatch with pattern '"+testCase.Pattern+"'") + } else { + if testCase.Exact == nil { + t.Fatalf("Test case must have either 'Includes' or 'Exact' field set") + } + verifyExactSymbols(t, *result.SymbolInformations, *testCase.Exact, "Workspace symbols mismatch with pattern '"+testCase.Pattern+"'") + } + } + f.Configure(t, originalPreferences) +} + +func verifyExactSymbols( + t *testing.T, + actual []*lsproto.SymbolInformation, + expected []*lsproto.SymbolInformation, + prefix string, +) { + if len(actual) != len(expected) { + t.Fatalf("%s: Expected %d symbols, but got %d:\n%s", prefix, len(expected), len(actual), cmp.Diff(actual, expected)) + } + for i := range actual { + assertDeepEqual(t, actual[i], expected[i], prefix) + } +} + +func verifyIncludesSymbols( + t *testing.T, + actual []*lsproto.SymbolInformation, + includes []*lsproto.SymbolInformation, + prefix string, +) { + type key struct { + name string + loc lsproto.Location + } + nameAndLocToActualSymbol := make(map[key]*lsproto.SymbolInformation, len(actual)) + for _, sym := range actual { + nameAndLocToActualSymbol[key{name: sym.Name, loc: sym.Location}] = sym + } + + for _, sym := range includes { + actualSym, ok := nameAndLocToActualSymbol[key{name: sym.Name, loc: sym.Location}] + if !ok { + t.Fatalf("%s: Expected symbol '%s' at location '%v' not found", prefix, sym.Name, sym.Location) + } + assertDeepEqual(t, actualSym, sym, fmt.Sprintf("%s: Symbol '%s' at location '%v' mismatch", prefix, sym.Name, sym.Location)) + } +} diff --git a/pkg/fourslash/statebaseline.go b/pkg/fourslash/statebaseline.go new file mode 100644 index 000000000..475d7ae7c --- /dev/null +++ b/pkg/fourslash/statebaseline.go @@ -0,0 +1,509 @@ +package fourslash + +import ( + "fmt" + "io" + "iter" + "maps" + "slices" + "strings" + "testing" + + "github.com/go-json-experiment/json" + "github.com/go-json-experiment/json/jsontext" + "github.com/buke/typescript-go-internal/pkg/collections" + "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/ls/lsconv" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/project" + "github.com/buke/typescript-go-internal/pkg/testutil/fsbaselineutil" + "github.com/buke/typescript-go-internal/pkg/tspath" + "github.com/buke/typescript-go-internal/pkg/vfs/iovfs" + "gotest.tools/v3/assert" +) + +type stateBaseline struct { + baseline strings.Builder + fsDiffer *fsbaselineutil.FSDiffer + isInitialized bool + + serializedProjects map[string]projectInfo + serializedOpenFiles map[string]*openFileInfo + serializedConfigFileRegistry *project.ConfigFileRegistry +} + +func newStateBaseline(fsFromMap iovfs.FsWithSys) *stateBaseline { + stateBaseline := &stateBaseline{ + fsDiffer: &fsbaselineutil.FSDiffer{ + FS: fsFromMap, + WrittenFiles: &collections.SyncSet[string]{}, + }, + } + fmt.Fprintf(&stateBaseline.baseline, "UseCaseSensitiveFileNames: %v\n", fsFromMap.UseCaseSensitiveFileNames()) + stateBaseline.fsDiffer.BaselineFSwithDiff(&stateBaseline.baseline) + return stateBaseline +} + +type requestOrMessage struct { + Method lsproto.Method `json:"method"` + Params any `json:"params,omitzero"` +} + +func (f *FourslashTest) baselineRequestOrNotification(t *testing.T, method lsproto.Method, params any) { + t.Helper() + + if !f.testData.isStateBaseliningEnabled() { + return + } + + res, _ := json.Marshal(requestOrMessage{method, params}, jsontext.WithIndent(" ")) + f.stateBaseline.baseline.WriteString("\n" + string(res) + "\n") + f.stateBaseline.isInitialized = true +} + +func (f *FourslashTest) baselineProjectsAfterNotification(t *testing.T, fileName string) { + t.Helper() + if !f.testData.isStateBaseliningEnabled() { + return + } + // Do hover so we have snapshot to check things on!! + _, _, resultOk := sendRequestWorker(t, f, lsproto.TextDocumentHoverInfo, &lsproto.HoverParams{ + TextDocument: lsproto.TextDocumentIdentifier{ + Uri: lsconv.FileNameToDocumentURI(fileName), + }, + Position: lsproto.Position{ + Line: uint32(0), + Character: uint32(0), + }, + }) + assert.Assert(t, resultOk) + f.baselineState(t) +} + +func (f *FourslashTest) baselineState(t *testing.T) { + t.Helper() + + if !f.testData.isStateBaseliningEnabled() { + return + } + + serialized := f.serializedState(t) + if serialized != "" { + f.stateBaseline.baseline.WriteString("\n") + f.stateBaseline.baseline.WriteString(serialized) + } +} + +func (f *FourslashTest) serializedState(t *testing.T) string { + t.Helper() + + var builder strings.Builder + f.stateBaseline.fsDiffer.BaselineFSwithDiff(&builder) + if strings.TrimSpace(builder.String()) == "" { + builder.Reset() + } + + f.printStateDiff(t, &builder) + return builder.String() +} + +type projectInfo = *compiler.Program + +type openFileInfo struct { + defaultProjectName string + allProjects []string +} + +type diffTableOptions struct { + indent string + sortKeys bool +} + +type diffTable struct { + diff collections.OrderedMap[string, string] + options diffTableOptions +} + +func (d *diffTable) add(key, value string) { + d.diff.Set(key, value) +} + +func (d *diffTable) print(w io.Writer, header string) { + count := d.diff.Size() + if count == 0 { + return + } + if header != "" { + fmt.Fprintf(w, "%s%s\n", d.options.indent, header) + } + diffKeys := make([]string, 0, count) + keyWidth := 0 + indent := d.options.indent + " " + for key := range d.diff.Keys() { + keyWidth = max(keyWidth, len(key)) + diffKeys = append(diffKeys, key) + } + if d.options.sortKeys { + slices.Sort(diffKeys) + } + + for _, key := range diffKeys { + value := d.diff.GetOrZero(key) + fmt.Fprintf(w, "%s%-*s %s\n", indent, keyWidth+1, key, value) + } +} + +type diffTableWriter struct { + hasChange bool + header string + diffs map[string]func(io.Writer) +} + +func newDiffTableWriter(header string) *diffTableWriter { + return &diffTableWriter{header: header, diffs: make(map[string]func(io.Writer))} +} + +func (d *diffTableWriter) setHasChange() { + d.hasChange = true +} + +func (d *diffTableWriter) add(key string, fn func(io.Writer)) { + d.diffs[key] = fn +} + +func (d *diffTableWriter) print(w io.Writer) { + if d.hasChange { + fmt.Fprintf(w, "%s::\n", d.header) + keys := slices.Collect(maps.Keys(d.diffs)) + slices.Sort(keys) + for _, key := range keys { + d.diffs[key](w) + } + } +} + +func areIterSeqEqual(a, b iter.Seq[tspath.Path]) bool { + aSlice := slices.Collect(a) + bSlice := slices.Collect(b) + slices.Sort(aSlice) + slices.Sort(bSlice) + return slices.Equal(aSlice, bSlice) +} + +func printSlicesWithDiffTable(w io.Writer, header string, newSlice []string, getOldSlice func() []string, options diffTableOptions, topChange string, isDefault func(entry string) bool) { + var oldSlice []string + if topChange == "*modified*" { + oldSlice = getOldSlice() + } + table := diffTable{options: options} + for _, entry := range newSlice { + entryChange := "" + if isDefault != nil && isDefault(entry) { + entryChange = "(default) " + } + if topChange == "*modified*" && !slices.Contains(oldSlice, entry) { + entryChange = "*new*" + } + table.add(entry, entryChange) + } + if topChange == "*modified*" { + for _, entry := range oldSlice { + if !slices.Contains(newSlice, entry) { + table.add(entry, "*deleted*") + } + } + } + table.print(w, header) +} + +func sliceFromIterSeqPath(seq iter.Seq[tspath.Path]) []string { + var result []string + for path := range seq { + result = append(result, string(path)) + } + slices.Sort(result) + return result +} + +func printPathIterSeqWithDiffTable(w io.Writer, header string, newIterSeq iter.Seq[tspath.Path], getOldIterSeq func() iter.Seq[tspath.Path], options diffTableOptions, topChange string) { + printSlicesWithDiffTable( + w, + header, + sliceFromIterSeqPath(newIterSeq), + func() []string { return sliceFromIterSeqPath(getOldIterSeq()) }, + options, + topChange, + nil, + ) +} + +func (f *FourslashTest) printStateDiff(t *testing.T, w io.Writer) { + if !f.stateBaseline.isInitialized { + return + } + session := f.server.Session() + snapshot, release := session.Snapshot() + defer release() + + f.printProjectsDiff(t, snapshot, w) + f.printOpenFilesDiff(t, snapshot, w) + f.printConfigFileRegistryDiff(t, snapshot, w) +} + +func (f *FourslashTest) printProjectsDiff(t *testing.T, snapshot *project.Snapshot, w io.Writer) { + t.Helper() + + currentProjects := make(map[string]projectInfo) + options := diffTableOptions{indent: " "} + projectsDiffTable := newDiffTableWriter("Projects") + + for _, project := range snapshot.ProjectCollection.Projects() { + program := project.GetProgram() + var oldProgram *compiler.Program + currentProjects[project.Name()] = program + projectChange := "" + if existing, ok := f.stateBaseline.serializedProjects[project.Name()]; ok { + oldProgram = existing + if oldProgram != program { + projectChange = "*modified*" + projectsDiffTable.setHasChange() + } else { + projectChange = "" + } + } else { + projectChange = "*new*" + projectsDiffTable.setHasChange() + } + + projectsDiffTable.add(project.Name(), func(w io.Writer) { + fmt.Fprintf(w, " [%s] %s\n", project.Name(), projectChange) + subDiff := diffTable{options: options} + if program != nil { + for _, file := range program.GetSourceFiles() { + fileDiff := "" + // No need to write "*new*" for files as its obvious + fileName := file.FileName() + if projectChange == "*modified*" { + if oldProgram == nil { + if !isLibFile(fileName) { + fileDiff = "*new*" + } + } else if oldFile := oldProgram.GetSourceFileByPath(file.Path()); oldFile == nil { + fileDiff = "*new*" + } else if oldFile != file { + fileDiff = "*modified*" + } + } + if fileDiff != "" || !isLibFile(fileName) { + subDiff.add(fileName, fileDiff) + } + } + } + if oldProgram != program && oldProgram != nil { + for _, file := range oldProgram.GetSourceFiles() { + if program == nil || program.GetSourceFileByPath(file.Path()) == nil { + subDiff.add(file.FileName(), "*deleted*") + } + } + } + subDiff.print(w, "") + }) + } + + for projectName, info := range f.stateBaseline.serializedProjects { + if _, found := currentProjects[projectName]; !found { + projectsDiffTable.setHasChange() + projectsDiffTable.add(projectName, func(w io.Writer) { + fmt.Fprintf(w, " [%s] *deleted*\n", projectName) + subDiff := diffTable{options: options} + if info != nil { + for _, file := range info.GetSourceFiles() { + if fileName := file.FileName(); !isLibFile(fileName) { + subDiff.add(fileName, "") + } + } + } + subDiff.print(w, "") + }) + } + } + f.stateBaseline.serializedProjects = currentProjects + projectsDiffTable.print(w) +} + +func (f *FourslashTest) printOpenFilesDiff(t *testing.T, snapshot *project.Snapshot, w io.Writer) { + t.Helper() + + currentOpenFiles := make(map[string]*openFileInfo) + filesDiffTable := newDiffTableWriter("Open Files") + options := diffTableOptions{indent: " ", sortKeys: true} + for fileName := range f.openFiles { + path := tspath.ToPath(fileName, "/", f.vfs.UseCaseSensitiveFileNames()) + defaultProject := snapshot.ProjectCollection.GetDefaultProject(fileName, path) + newFileInfo := &openFileInfo{} + if defaultProject != nil { + newFileInfo.defaultProjectName = defaultProject.Name() + } + for _, project := range snapshot.ProjectCollection.Projects() { + if program := project.GetProgram(); program != nil && program.GetSourceFileByPath(path) != nil { + newFileInfo.allProjects = append(newFileInfo.allProjects, project.Name()) + } + } + slices.Sort(newFileInfo.allProjects) + currentOpenFiles[fileName] = newFileInfo + openFileChange := "" + var oldFileInfo *openFileInfo + if existing, ok := f.stateBaseline.serializedOpenFiles[fileName]; ok { + oldFileInfo = existing + if existing.defaultProjectName != newFileInfo.defaultProjectName || !slices.Equal(existing.allProjects, newFileInfo.allProjects) { + openFileChange = "*modified*" + filesDiffTable.setHasChange() + } else { + openFileChange = "" + } + } else { + openFileChange = "*new*" + filesDiffTable.setHasChange() + } + + filesDiffTable.add(fileName, func(w io.Writer) { + fmt.Fprintf(w, " [%s] %s\n", fileName, openFileChange) + printSlicesWithDiffTable( + w, + "", + newFileInfo.allProjects, + func() []string { return oldFileInfo.allProjects }, + options, + openFileChange, + func(projectName string) bool { return projectName == newFileInfo.defaultProjectName }, + ) + }) + } + for fileName := range f.stateBaseline.serializedOpenFiles { + if _, found := currentOpenFiles[fileName]; !found { + filesDiffTable.setHasChange() + filesDiffTable.add(fileName, func(w io.Writer) { + fmt.Fprintf(w, " [%s] *closed*\n", fileName) + }) + } + } + f.stateBaseline.serializedOpenFiles = currentOpenFiles + filesDiffTable.print(w) +} + +func (f *FourslashTest) printConfigFileRegistryDiff(t *testing.T, snapshot *project.Snapshot, w io.Writer) { + t.Helper() + configFileRegistry := snapshot.ProjectCollection.ConfigFileRegistry() + + configDiffsTable := newDiffTableWriter("Config") + configFileNamesDiffsTable := newDiffTableWriter("Config File Names") + + if f.stateBaseline.serializedConfigFileRegistry == configFileRegistry { + return + } + options := diffTableOptions{indent: " ", sortKeys: true} + configFileRegistry.ForEachTestConfigEntry(func(path tspath.Path, entry *project.TestConfigEntry) { + configChange := "" + oldEntry := f.stateBaseline.serializedConfigFileRegistry.GetTestConfigEntry(path) + if oldEntry == nil { + configChange = "*new*" + configDiffsTable.setHasChange() + } else if oldEntry != entry { + if !areIterSeqEqual(oldEntry.RetainingProjects, entry.RetainingProjects) || + !areIterSeqEqual(oldEntry.RetainingOpenFiles, entry.RetainingOpenFiles) || + !areIterSeqEqual(oldEntry.RetainingConfigs, entry.RetainingConfigs) { + configChange = "*modified*" + configDiffsTable.setHasChange() + } + } + configDiffsTable.add(string(path), func(w io.Writer) { + fmt.Fprintf(w, " [%s] %s\n", entry.FileName, configChange) + // Print the details of the config entry + var retainingProjectsModified string + var retainingOpenFilesModified string + var retainingConfigsModified string + if configChange == "*modified*" { + if !areIterSeqEqual(entry.RetainingProjects, oldEntry.RetainingProjects) { + retainingProjectsModified = " *modified*" + } + if !areIterSeqEqual(entry.RetainingOpenFiles, oldEntry.RetainingOpenFiles) { + retainingOpenFilesModified = " *modified*" + } + if !areIterSeqEqual(entry.RetainingConfigs, oldEntry.RetainingConfigs) { + retainingConfigsModified = " *modified*" + } + } + printPathIterSeqWithDiffTable(w, "RetainingProjects:"+retainingProjectsModified, entry.RetainingProjects, func() iter.Seq[tspath.Path] { return oldEntry.RetainingProjects }, options, configChange) + printPathIterSeqWithDiffTable(w, "RetainingOpenFiles:"+retainingOpenFilesModified, entry.RetainingOpenFiles, func() iter.Seq[tspath.Path] { return oldEntry.RetainingOpenFiles }, options, configChange) + printPathIterSeqWithDiffTable(w, "RetainingConfigs:"+retainingConfigsModified, entry.RetainingConfigs, func() iter.Seq[tspath.Path] { return oldEntry.RetainingConfigs }, options, configChange) + }) + }) + configFileRegistry.ForEachTestConfigFileNamesEntry(func(path tspath.Path, entry *project.TestConfigFileNamesEntry) { + configFileNamesChange := "" + oldEntry := f.stateBaseline.serializedConfigFileRegistry.GetTestConfigFileNamesEntry(path) + if oldEntry == nil { + configFileNamesChange = "*new*" + configFileNamesDiffsTable.setHasChange() + } else if oldEntry.NearestConfigFileName != entry.NearestConfigFileName || + !maps.Equal(oldEntry.Ancestors, entry.Ancestors) { + configFileNamesChange = "*modified*" + configFileNamesDiffsTable.setHasChange() + } + configFileNamesDiffsTable.add(string(path), func(w io.Writer) { + fmt.Fprintf(w, " [%s] %s\n", path, configFileNamesChange) + var nearestConfigFileNameModified string + var ancestorDiffModified string + if configFileNamesChange == "*modified*" { + if oldEntry.NearestConfigFileName != entry.NearestConfigFileName { + nearestConfigFileNameModified = " *modified*" + } + if !maps.Equal(oldEntry.Ancestors, entry.Ancestors) { + ancestorDiffModified = " *modified*" + } + } + fmt.Fprintf(w, " NearestConfigFileName: %s%s\n", entry.NearestConfigFileName, nearestConfigFileNameModified) + ancestorDiff := diffTable{options: options} + for config, ancestorOfConfig := range entry.Ancestors { + ancestorChange := "" + if configFileNamesChange == "*modified*" { + if oldConfigFileName, ok := oldEntry.Ancestors[config]; ok { + if oldConfigFileName != ancestorOfConfig { + ancestorChange = "*modified*" + } + } else { + ancestorChange = "*new*" + } + } + ancestorDiff.add(config, fmt.Sprintf("%s %s", ancestorOfConfig, ancestorChange)) + } + if configFileNamesChange == "*modified*" { + for ancestorPath, oldConfigFileName := range oldEntry.Ancestors { + if _, ok := entry.Ancestors[ancestorPath]; !ok { + ancestorDiff.add(ancestorPath, oldConfigFileName+" *deleted*") + } + } + } + ancestorDiff.print(w, "Ancestors:"+ancestorDiffModified) + }) + }) + + f.stateBaseline.serializedConfigFileRegistry.ForEachTestConfigEntry(func(path tspath.Path, entry *project.TestConfigEntry) { + if configFileRegistry.GetTestConfigEntry(path) == nil { + configDiffsTable.setHasChange() + configDiffsTable.add(string(path), func(w io.Writer) { + fmt.Fprintf(w, " [%s] *deleted*\n", entry.FileName) + }) + } + }) + f.stateBaseline.serializedConfigFileRegistry.ForEachTestConfigFileNamesEntry(func(path tspath.Path, entry *project.TestConfigFileNamesEntry) { + if configFileRegistry.GetTestConfigFileNamesEntry(path) == nil { + configFileNamesDiffsTable.setHasChange() + configFileNamesDiffsTable.add(string(path), func(w io.Writer) { + fmt.Fprintf(w, " [%s] *deleted*\n", path) + }) + } + }) + f.stateBaseline.serializedConfigFileRegistry = configFileRegistry + configDiffsTable.print(w) + configFileNamesDiffsTable.print(w) +} diff --git a/pkg/fourslash/test_parser.go b/pkg/fourslash/test_parser.go index 36ca7d3c8..934e24350 100644 --- a/pkg/fourslash/test_parser.go +++ b/pkg/fourslash/test_parser.go @@ -44,6 +44,13 @@ func (r *RangeMarker) GetName() *string { return r.Marker.Name } +func (r *RangeMarker) LSLocation() lsproto.Location { + return lsproto.Location{ + Uri: lsconv.FileNameToDocumentURI(r.fileName), + Range: r.LSRange, + } +} + type Marker struct { fileName string Position int @@ -64,6 +71,16 @@ func (m *Marker) GetName() *string { return m.Name } +func (m *Marker) MakerWithSymlink(fileName string) *Marker { + return &Marker{ + fileName: fileName, + Position: m.Position, + LSPosition: m.LSPosition, + Name: m.Name, + Data: m.Data, + } +} + type MarkerOrRange interface { FileName() string LSPos() lsproto.Position @@ -79,12 +96,20 @@ type TestData struct { Ranges []*RangeMarker } +func (t *TestData) isStateBaseliningEnabled() bool { + return isStateBaseliningEnabled(t.GlobalOptions) +} + type testFileWithMarkers struct { file *TestFileInfo markers []*Marker ranges []*RangeMarker } +func isStateBaseliningEnabled(globalOptions map[string]string) bool { + return globalOptions["statebaseline"] == "true" +} + func ParseTestData(t *testing.T, contents string, fileName string) TestData { // List of all the subfiles we've parsed out var files []*TestFileInfo @@ -128,7 +153,7 @@ func ParseTestData(t *testing.T, contents string, fileName string) TestData { } - if hasTSConfig && len(globalOptions) > 0 { + if hasTSConfig && len(globalOptions) > 0 && !isStateBaseliningEnabled(globalOptions) { t.Fatalf("It is not allowed to use global options along with config files.") } diff --git a/pkg/fourslash/tests/gen/declareFunction_test.go b/pkg/fourslash/tests/gen/declareFunction_test.go new file mode 100644 index 000000000..1c4ebd127 --- /dev/null +++ b/pkg/fourslash/tests/gen/declareFunction_test.go @@ -0,0 +1,26 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestDeclareFunction(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: index.ts +declare function` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{}), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navigateItemsLet_test.go b/pkg/fourslash/tests/gen/navigateItemsLet_test.go new file mode 100644 index 000000000..c4f9774d0 --- /dev/null +++ b/pkg/fourslash/tests/gen/navigateItemsLet_test.go @@ -0,0 +1,46 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigateItemsLet(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +let [|c = 10|]; +function foo() { + let [|d = 10|]; +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "c", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "c", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, { + Pattern: "d", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "d", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[1].LSLocation(), + ContainerName: PtrTo("foo"), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navigateToImport_test.go b/pkg/fourslash/tests/gen/navigateToImport_test.go new file mode 100644 index 000000000..87edf9608 --- /dev/null +++ b/pkg/fourslash/tests/gen/navigateToImport_test.go @@ -0,0 +1,55 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigateToImport(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @Filename: library.ts +[|export function foo() {}|] +[|export function bar() {}|] +// @Filename: user.ts +import {foo, [|bar as baz|]} from './library';` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "foo", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "foo", + Kind: lsproto.SymbolKindFunction, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, { + Pattern: "bar", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "bar", + Kind: lsproto.SymbolKindFunction, + Location: f.Ranges()[1].LSLocation(), + }, + }), + }, { + Pattern: "baz", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "baz", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[2].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navigateToSymbolIterator_test.go b/pkg/fourslash/tests/gen/navigateToSymbolIterator_test.go new file mode 100644 index 000000000..464735bdf --- /dev/null +++ b/pkg/fourslash/tests/gen/navigateToSymbolIterator_test.go @@ -0,0 +1,34 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigateToSymbolIterator(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class C { + [|[Symbol.iterator]() {}|] +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "iterator", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "iterator", + Kind: lsproto.SymbolKindMethod, + Location: f.Ranges()[0].LSLocation(), + ContainerName: PtrTo("C"), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navigationItemsInConstructorsExactMatch_test.go b/pkg/fourslash/tests/gen/navigationItemsInConstructorsExactMatch_test.go new file mode 100644 index 000000000..be9456428 --- /dev/null +++ b/pkg/fourslash/tests/gen/navigationItemsInConstructorsExactMatch_test.go @@ -0,0 +1,49 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigationItemsInConstructorsExactMatch(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +class Test { + [|private search1: number;|] + constructor([|public search2: boolean|], [|readonly search3: string|], search4: string) { + } +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "search", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "search1", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[0].LSLocation(), + ContainerName: PtrTo("Test"), + }, + { + Name: "search2", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[1].LSLocation(), + ContainerName: PtrTo("Test"), + }, + { + Name: "search3", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[2].LSLocation(), + ContainerName: PtrTo("Test"), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navigationItemsPrefixMatch2_test.go b/pkg/fourslash/tests/gen/navigationItemsPrefixMatch2_test.go new file mode 100644 index 000000000..19ff68461 --- /dev/null +++ b/pkg/fourslash/tests/gen/navigationItemsPrefixMatch2_test.go @@ -0,0 +1,94 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigationItemsPrefixMatch2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `module Shapes { + export class Point { + [|private originality = 0.0;|] + [|private distanceFromOrig = 0.0;|] + [|get distanceFarFarAway(distanceFarFarAwayParam: number): number { + var [|distanceFarFarAwayLocal|]; + return 0; + }|] + } +} +var pointsSquareBox = new Shapes.Point(); +function PointsFunc(): void { + var pointFuncLocal; +} +[|interface OriginI { + 123; + [|origin1;|] + [|public _distance(distanceParam): void;|] +}|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "origin", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "origin1", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[5].LSLocation(), + ContainerName: PtrTo("OriginI"), + }, + { + Name: "originality", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[0].LSLocation(), + ContainerName: PtrTo("Point"), + }, + { + Name: "OriginI", + Kind: lsproto.SymbolKindInterface, + Location: f.Ranges()[4].LSLocation(), + }, + }), + }, { + Pattern: "distance", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "distanceFarFarAway", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[2].LSLocation(), + ContainerName: PtrTo("Point"), + }, + { + Name: "distanceFarFarAwayLocal", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[3].LSLocation(), + ContainerName: PtrTo("distanceFarFarAway"), + }, + { + Name: "distanceFromOrig", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[1].LSLocation(), + ContainerName: PtrTo("Point"), + }, + { + Name: "_distance", + Kind: lsproto.SymbolKindMethod, + Location: f.Ranges()[6].LSLocation(), + ContainerName: PtrTo("OriginI"), + }, + }), + }, { + Pattern: "mPointThatIJustInitiated wrongKeyWord", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{}), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navto_emptyPattern_test.go b/pkg/fourslash/tests/gen/navto_emptyPattern_test.go new file mode 100644 index 000000000..777bc3564 --- /dev/null +++ b/pkg/fourslash/tests/gen/navto_emptyPattern_test.go @@ -0,0 +1,38 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavto_emptyPattern(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: foo.ts +const [|x: number = 1|]; +[|function y(x: string): string { return x; }|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "x", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + { + Name: "y", + Kind: lsproto.SymbolKindFunction, + Location: f.Ranges()[1].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/gen/navto_excludeLib3_test.go b/pkg/fourslash/tests/gen/navto_excludeLib3_test.go new file mode 100644 index 000000000..395f4a350 --- /dev/null +++ b/pkg/fourslash/tests/gen/navto_excludeLib3_test.go @@ -0,0 +1,32 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavto_excludeLib3(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /index.ts +[|function parseInt(s: string): number {}|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "parseInt", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "parseInt", + Kind: lsproto.SymbolKindFunction, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/manual/navigationItemsExactMatch2_test.go b/pkg/fourslash/tests/manual/navigationItemsExactMatch2_test.go new file mode 100644 index 000000000..6aad46e4c --- /dev/null +++ b/pkg/fourslash/tests/manual/navigationItemsExactMatch2_test.go @@ -0,0 +1,101 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigationItemsExactMatch2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `module Shapes { + [|class Point { + [|private _origin = 0.0;|] + [|private distanceFromA = 0.0;|] + + [|get distance1(distanceParam): number { + var [|distanceLocal|]; + return 0; + }|] + }|] +} + +var [|point = new Shapes.Point()|]; +[|function distance2(distanceParam1): void { + var [|distanceLocal1|]; +}|]` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "point", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "Point", + Kind: lsproto.SymbolKindClass, + Location: f.Ranges()[0].LSLocation(), + ContainerName: PtrTo("Shapes"), + }, + { + Name: "point", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[5].LSLocation(), + }, + }), + }, { + Pattern: "distance", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "distance1", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[3].LSLocation(), + ContainerName: PtrTo("Point"), + }, + { + Name: "distance2", + Kind: lsproto.SymbolKindFunction, + Location: f.Ranges()[6].LSLocation(), + }, + { + Name: "distanceFromA", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[2].LSLocation(), + ContainerName: PtrTo("Point"), + }, + { + Name: "distanceLocal", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[4].LSLocation(), + ContainerName: PtrTo("distance1"), + }, + { + Name: "distanceLocal1", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[7].LSLocation(), + ContainerName: PtrTo("distance2"), + }, + }), + }, { + Pattern: "origin", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "_origin", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[1].LSLocation(), + ContainerName: PtrTo("Point"), + }, + }), + }, { + Pattern: "square", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{}), + }, + }) +} diff --git a/pkg/fourslash/tests/manual/navigationItemsSpecialPropertyAssignment_test.go b/pkg/fourslash/tests/manual/navigationItemsSpecialPropertyAssignment_test.go new file mode 100644 index 000000000..c87995c0e --- /dev/null +++ b/pkg/fourslash/tests/manual/navigationItemsSpecialPropertyAssignment_test.go @@ -0,0 +1,92 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavigationItemsSpecialPropertyAssignment(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @noLib: true +// @allowJs: true +// @Filename: /a.js +[|exports.x = 0|]; +[|exports.z = function() {}|]; +function Cls() { + [|this.instanceProp = 0|]; +} +[|Cls.staticMethod = function() {}|]; +[|Cls.staticProperty = 0|]; +[|Cls.prototype.instanceMethod = function() {}|];` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "x", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "x", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, { + Pattern: "z", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "z", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[1].LSLocation(), + }, + }), + }, { + Pattern: "instanceProp", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "instanceProp", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[2].LSLocation(), + ContainerName: PtrTo("Cls"), + }, + }), + }, { + Pattern: "staticMethod", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "staticMethod", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[3].LSLocation(), + }, + }), + }, { + Pattern: "staticProperty", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "staticProperty", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[4].LSLocation(), + }, + }), + }, { + Pattern: "instanceMethod", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "instanceMethod", + Kind: lsproto.SymbolKindProperty, + Location: f.Ranges()[5].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/manual/navto_excludeLib1_test.go b/pkg/fourslash/tests/manual/navto_excludeLib1_test.go new file mode 100644 index 000000000..f28042586 --- /dev/null +++ b/pkg/fourslash/tests/manual/navto_excludeLib1_test.go @@ -0,0 +1,58 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/ls/lsutil" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavto_excludeLib1(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /index.ts +import { weirdName as otherName } from "bar"; +const [|weirdName: number = 1|]; +// @filename: /tsconfig.json +{} +// @filename: /node_modules/bar/index.d.ts +export const [|weirdName: number|]; +// @filename: /node_modules/bar/package.json +{}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "weirdName", + Preferences: &lsutil.UserPreferences{ExcludeLibrarySymbolsInNavTo: false}, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "weirdName", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + { + Name: "weirdName", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[1].LSLocation(), + }, + }), + }, + }) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "weirdName", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "weirdName", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/manual/navto_excludeLib2_test.go b/pkg/fourslash/tests/manual/navto_excludeLib2_test.go new file mode 100644 index 000000000..dd2b6455a --- /dev/null +++ b/pkg/fourslash/tests/manual/navto_excludeLib2_test.go @@ -0,0 +1,52 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + . "github.com/buke/typescript-go-internal/pkg/fourslash/tests/util" + "github.com/buke/typescript-go-internal/pkg/ls/lsutil" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestNavto_excludeLib2(t *testing.T) { + t.Parallel() + + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @filename: /index.ts +import { [|someName as weirdName|] } from "bar"; +// @filename: /tsconfig.json +{} +// @filename: /node_modules/bar/index.d.ts +export const someName: number; +// @filename: /node_modules/bar/package.json +{}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "weirdName", + Preferences: &lsutil.UserPreferences{ExcludeLibrarySymbolsInNavTo: false}, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "weirdName", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, + }) + f.VerifyWorkspaceSymbol(t, []*fourslash.VerifyWorkspaceSymbolCase{ + { + Pattern: "weirdName", + Preferences: nil, + Exact: PtrTo([]*lsproto.SymbolInformation{ + { + Name: "weirdName", + Kind: lsproto.SymbolKindVariable, + Location: f.Ranges()[0].LSLocation(), + }, + }), + }, + }) +} diff --git a/pkg/fourslash/tests/statedeclarationmaps_test.go b/pkg/fourslash/tests/statedeclarationmaps_test.go new file mode 100644 index 000000000..ef5bed548 --- /dev/null +++ b/pkg/fourslash/tests/statedeclarationmaps_test.go @@ -0,0 +1,380 @@ +package fourslash_test + +import ( + "fmt" + "strings" + "testing" + + "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestDeclarationMapsOpeningOriginalLocationProject(t *testing.T) { + t.Parallel() + for _, disableSourceOfProjectReferenceRedirect := range []bool{false, true} { + t.Run("TestDeclarationMapsOpeningOriginalLocationProject"+core.IfElse(disableSourceOfProjectReferenceRedirect, "DisableSourceOfProjectReferenceRedirect", ""), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := fmt.Sprintf(` +// @stateBaseline: true +// @Filename: a/a.ts +export class A { } +// @Filename: a/tsconfig.json +{} +// @Filename: a/a.d.ts +export declare class A { +} +//# sourceMappingURL=a.d.ts.map +// @Filename: a/a.d.ts.map +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["./a.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;CAAI" +} +// @Filename: b/b.ts +import {A} from "../a/a"; +new /*1*/A(); +// @Filename: b/tsconfig.json +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": %t + }, + "references": [ + { "path": "../a" } + ] +}`, disableSourceOfProjectReferenceRedirect) + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineFindAllReferences(t, "1") + }) + } +} + +func TestDeclarationMapTestCasesForMaps(t *testing.T) { + t.Parallel() + type testCase struct { + name string + goToMarker string + opMarker string + } + tests := []testCase{ + {"FindAllRefs", "userFnA", "userFnA"}, + {"FindAllRefsStartingAtDefinition", "userFnA", "fnADef"}, + {"FindAllRefsTargetDoesNotExist", "userFnB", "userFnB"}, + {"Rename", "userFnA", "userFnA"}, + {"RenameStartingAtDefinition", "userFnA", "fnADef"}, + {"RenameTargetDoesNotExist", "userFnB", "userFnB"}, + } + for _, tc := range tests { + t.Run("TestDeclarationMaps"+tc.name, func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: a/a.ts +export function /*fnADef*/fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +// @Filename: a/tsconfig.json +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +// @Filename: a/bin/a.d.ts.map +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +// @Filename: a/bin/a.d.ts +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +// @Filename: b/tsconfig.json +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +// @Filename: b/bin/b.d.ts.map +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +// @Filename: b/bin/b.d.ts +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +// @Filename: user/user.ts +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a./*userFnA*/fnA(); b./*userFnB*/fnB(); a.instanceA; } +// @Filename: dummy/dummy.ts +/*dummy*/export const a = 10; +// @Filename: dummy/tsconfig.json +{}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, tc.goToMarker) + // Ref projects are loaded after as part of this command + if strings.HasPrefix(tc.name, "Rename") { + f.VerifyBaselineRename(t, nil /*preferences*/, tc.opMarker) + } else { + f.VerifyBaselineFindAllReferences(t, tc.opMarker) + } + // Open temp file and verify all projects alive + f.CloseFileOfMarker(t, tc.goToMarker) + f.GoToMarker(t, "dummy") + }) + } +} + +func TestDeclarationMapsWorkspaceSymbols(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := `// @stateBaseline: true +// @Filename: a/a.ts +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +// @Filename: a/tsconfig.json +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +// @Filename: a/bin/a.d.ts.map +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +// @Filename: a/bin/a.d.ts +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +// @Filename: b/b.ts +export function fnB() {} +// @Filename: b/c.ts +export function fnC() {} +// @Filename: b/tsconfig.json +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +// @Filename: b/bin/b.d.ts.map +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +// @Filename: b/bin/b.d.ts +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +// @Filename: user/user.ts +/*user*/import * as a from "../a/a"; +import * as b from "../b/b"; +export function fnUser() { + a.fnA(); + b.fnB(); + a.instanceA; +} +// @Filename: user/tsconfig.json +{ + "references": [ + { "path": "../a" }, + { "path": "../b" } + ] +} +// @Filename: dummy/dummy.ts +/*dummy*/export const a = 10; +// @Filename: dummy/tsconfig.json +{}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "user") + // Ref projects are loaded after as part of this command + f.VerifyBaselineWorkspaceSymbol(t, "fn") + // Open temp file and verify all projects alive + f.CloseFileOfMarker(t, "user") + f.GoToMarker(t, "dummy") +} + +func TestDeclarationMapsFindAllRefsDefinitionInMappedFile(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +//@Filename: a/a.ts +export function f() {} +// @Filename: a/tsconfig.json +{ + "compilerOptions": { + "outDir": "../bin", + "declarationMap": true, + "composite": true + } +} +//@Filename: b/b.ts +import { f } from "../bin/a"; +/*1*/f(); +// @Filename: b/tsconfig.json +{ + "references": [ + { "path": "../a" } + ] +} +// @Filename: bin/a.d.ts +export declare function f(): void; +//# sourceMappingURL=a.d.ts.map +// @Filename: bin/a.d.ts.map +{ + "version":3, + "file":"a.d.ts", + "sourceRoot":"", + "sources":["a.ts"], + "names":[], + "mappings":"AAAA,wBAAgB,CAAC,SAAK" +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineFindAllReferences(t, "1") +} + +func TestDeclarationMapsRename(t *testing.T) { + t.Parallel() + type testCase struct { + name string + dontBuild bool + mainWithNoRef bool + disableSourceOfProjectReferenceRedirect bool + tsconfigNotSolution bool + } + for _, tc := range []testCase{ + {name: "ProjectReferences", dontBuild: true}, + {name: "DisableSourceOfProjectReferenceRedirect", disableSourceOfProjectReferenceRedirect: true}, + {name: "SourceMaps", mainWithNoRef: true}, + {name: "SourceMapsNotSolution", mainWithNoRef: true, tsconfigNotSolution: true}, + } { + buildStr := core.IfElse(!tc.dontBuild, "// @tsc: --build /myproject/dependency,--build /myproject/main", "") + mainRefsStr := core.IfElse(!tc.mainWithNoRef, `"references": [{ "path": "../dependency" }]`, "") + filesStr := core.IfElse(!tc.tsconfigNotSolution, `"files": [],`, "") + content := fmt.Sprintf(` +// @stateBaseline: true +%s +//@Filename: myproject/dependency/FnS.ts +/*firstLine*/export function fn1() { } +export function fn2() { } +export function /*rename*/fn3() { } +export function fn4() { } +export function fn5() { } +/*lastLine*/ +// @Filename: myproject/dependency/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//@Filename: myproject/main/main.ts +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +// @Filename: myproject/main/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": %t + }, + %s +} +// @Filename: myproject/tsconfig.json +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": %t + }, + %s + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +// @Filename: random/random.ts +/*dummy*/export const a = 10; +// @Filename: random/tsconfig.json +{}`, buildStr, tc.disableSourceOfProjectReferenceRedirect, mainRefsStr, tc.disableSourceOfProjectReferenceRedirect, filesStr) + t.Run("TestDeclarationMapsRenameWith"+tc.name, func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "dummy") + // Ref projects are loaded after as part of this command + f.VerifyBaselineRename(t, nil /*preferences*/, "rename") + // Collecting at this point retains dependency.d.ts and map + f.CloseFileOfMarker(t, "dummy") + f.GoToMarker(t, "dummy") + // Closing open file, removes dependencies too + f.CloseFileOfMarker(t, "rename") + f.CloseFileOfMarker(t, "dummy") + f.GoToMarker(t, "dummy") + }) + t.Run("TestDeclarationMapsRenameWith"+tc.name+"Edit", func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ref projects are loaded after as part of this command + f.VerifyBaselineRename(t, nil /*preferences*/, "rename") + f.GoToMarker(t, "firstLine") + f.Insert(t, "function fooBar() { }\n") + f.VerifyBaselineRename(t, nil /*preferences*/, "rename") + }) + t.Run("TestDeclarationMapsRenameWith"+tc.name+"EditEnd", func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ref projects are loaded after as part of this command + f.VerifyBaselineRename(t, nil /*preferences*/, "rename") + f.GoToMarker(t, "lastLine") + f.Insert(t, "const x = 10;") + f.VerifyBaselineRename(t, nil /*preferences*/, "rename") + }) + } +} diff --git a/pkg/fourslash/tests/statefindallrefs_test.go b/pkg/fourslash/tests/statefindallrefs_test.go new file mode 100644 index 000000000..6d7d23ff0 --- /dev/null +++ b/pkg/fourslash/tests/statefindallrefs_test.go @@ -0,0 +1,1120 @@ +package fourslash_test + +import ( + "fmt" + "strings" + "testing" + + "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/testutil" + "github.com/buke/typescript-go-internal/pkg/testutil/stringtestutil" +) + +func TestFindAllRefsSolutionReferencingDefaultProjectDirectly(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "files": [], + "references": [{ "path": "./tsconfig-src.json" }] +} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsSolutionReferencingDefaultProjectIndirectly(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +// @FileName: myproject/indirect1/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect1.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +// @FileName: myproject/indirect2/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect2.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "compilerOptions": { + "disableReferencedProjectLoad": true + }, + "files": [], + "references": [{ "path": "./tsconfig-src.json" }] +} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +// @FileName: myproject/indirect1/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect1.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +// @FileName: myproject/indirect2/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect2.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +// @FileName: myproject/indirect1/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect1.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +// @FileName: myproject/indirect2/main.ts +export const indirect = 1; +// @Filename: myproject/tsconfig-indirect2.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @tsc: --build /myproject/tsconfig.json +// @Filename: dummy/dummy.ts +/*dummy*/const x = 1; +// @Filename: dummy/tsconfig.json +{ } +// @Filename: myproject/tsconfig.json +{ + "files": ["./own/main.ts"], + "references": [{ "path": "./tsconfig-src.json" }] +} +// @Filename: myproject/own/main.ts +import { foo } from '../target/src/main'; +foo(); +export function bar() {} +// @Filename: myproject/tsconfig-src.json +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +// @Filename: myproject/src/main.ts +import { foo } from './helpers/functions'; +export { /*mainFoo*/foo }; +// @Filename: myproject/src/helpers/functions.ts +export function foo() { return 1; } +// @Filename: myproject/indirect3/tsconfig.json +{ } +// @Filename: myproject/indirect3/main.ts +import { /*fooIndirect3Import*/foo } from '../target/src/main'; +foo() +export function bar() {} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Ensure configured project is found for open file + f.GoToMarker(t, "mainFoo") + // !!! TODO Verify errors + f.GoToMarker(t, "dummy") + + // Projects lifetime + f.CloseFileOfMarker(t, "dummy") + f.CloseFileOfMarker(t, "mainFoo") + f.GoToMarker(t, "dummy") + + f.CloseFileOfMarker(t, "dummy") + + // Find all refs in default project + f.VerifyBaselineFindAllReferences(t, "mainFoo") + + f.CloseFileOfMarker(t, "mainFoo") + + // Find all ref in non default project + f.VerifyBaselineFindAllReferences(t, "fooIndirect3Import") +} + +func TestFindAllRefsRootOfReferencedProject(t *testing.T) { + t.Parallel() + for _, disableSourceOfProjectReferenceRedirect := range []bool{false, true} { + t.Run("TestFindAllRefsRootOfReferencedProject"+core.IfElse(disableSourceOfProjectReferenceRedirect, "DeclarationMaps", ""), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := fmt.Sprintf(` +// @stateBaseline: true +%s +// @Filename: src/common/input/keyboard.ts +function bar() { return "just a random function so .d.ts location doesnt match"; } +export function /*keyboard*/evaluateKeyboardEvent() { } +// @Filename: src/common/input/keyboard.test.ts +import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function testEvaluateKeyboardEvent() { + return evaluateKeyboardEvent(); +} +// @Filename: src/terminal.ts +/*terminal*/import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function foo() { + return evaluateKeyboardEvent(); +} +// @Filename: /src/common/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../../out", + "disableSourceOfProjectReferenceRedirect": %v, + "paths": { + "*": ["../*"], + }, + }, + "include": ["./\**/*"] +} +// @Filename: src/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../out", + "disableSourceOfProjectReferenceRedirect": %v, + "paths": { + "common/*": ["./common/*"], + }, + "tsBuildInfoFile": "../out/src.tsconfig.tsbuildinfo" + }, + "include": ["./\**/*"], + "references": [ + { "path": "./common" }, + ], +}`, core.IfElse(disableSourceOfProjectReferenceRedirect, "// @tsc: --build /src/tsconfig.json", ""), disableSourceOfProjectReferenceRedirect, disableSourceOfProjectReferenceRedirect) + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "keyboard") + f.GoToMarker(t, "terminal") + // Find all ref in default project + f.VerifyBaselineFindAllReferences(t, "keyboard") + }) + } +} + +func TestFindAllRefsAncestorSiblingProjectsLoading(t *testing.T) { + t.Parallel() + for _, disableSolutionSearching := range []bool{false, true} { + t.Run("TestFindAllRefsAncestorSiblingProjectsLoading"+core.IfElse(disableSolutionSearching, "DisableSolutionSearching", ""), func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := fmt.Sprintf(` +// @stateBaseline: true +// @Filename: solution/tsconfig.json +{ + "files": [], + "include": [], + "references": [ + { "path": "./compiler" }, + { "path": "./services" }, + ], +} +// @Filename: solution/compiler/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "disableSolutionSearching": %t, + }, + "files": ["./types.ts", "./program.ts"] +} +// @Filename: solution/compiler/types.ts +namespace ts { + export interface Program { + getSourceFiles(): string[]; + } +} +// @Filename: solution/compiler/program.ts +namespace ts { + export const program: Program = { + /*notLocal*/getSourceFiles: () => [/*local*/getSourceFile()] + }; + function getSourceFile() { return "something"; } +} +// @Filename: solution/services/tsconfig.json +{ + "compilerOptions": { + "composite": true + }, + "files": ["./services.ts"], + "references": [ + { "path": "../compiler" }, + ], +} +// @Filename: solution/services/services.ts +/// +/// +namespace ts { + const result = program.getSourceFiles(); +}`, disableSolutionSearching) + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + // Find all references for getSourceFile + // Shouldnt load more projects + f.VerifyBaselineFindAllReferences(t, "local") + + // Find all references for getSourceFiles + // Should load more projects only if disableSolutionSearching is not set to true + f.VerifyBaselineFindAllReferences(t, "notLocal") + }) + } +} + +func TestFindAllRefsOverlappingProjects(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: solution/tsconfig.json +{ + "files": [], + "include": [], + "references": [ + { "path": "./a" }, + { "path": "./b" }, + { "path": "./c" }, + { "path": "./d" }, + ], +} +// @Filename: solution/a/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "files": ["./index.ts"] +} +// @Filename: solution/a/index.ts +export interface I { + M(): void; +} +// @Filename: solution/b/tsconfig.json +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../a" }, + ], +} +// @Filename: solution/b/index.ts +import { I } from "../a"; +export class B implements /**/I { + M() {} +} +// @Filename: solution/c/tsconfig.json +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../b" }, + ], +} +// @Filename: solution/c/index.ts +import { I } from "../a"; +import { B } from "../b"; +export const C: I = new B(); +// @Filename: solution/d/tsconfig.json +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../c" }, + ], +} +// @Filename: solution/d/index.ts +import { I } from "../a"; +import { C } from "../c"; +export const D: I = C; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + + // The first search will trigger project loads + f.VerifyBaselineFindAllReferences(t, "") + + // The second search starts with the projects already loaded + // Formerly, this would search some projects multiple times + f.VerifyBaselineFindAllReferences(t, "") +} + +func TestFindAllRefsTwoProjectsOpenAndOneProjectReferences(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: /myproject/main/src/file1.ts +/*main*/export const mainConst = 10; +// @Filename: /myproject/main/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + { "path": "../indirect" }, + { "path": "../noCoreRef1" }, + { "path": "../indirectDisabledChildLoad1" }, + { "path": "../indirectDisabledChildLoad2" }, + { "path": "../refToCoreRef3" }, + { "path": "../indirectNoCoreRef" } + ] +} +// @Filename: /myproject/core/src/file1.ts +export const /*find*/coreConst = 10; +// @Filename: /myproject/core/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, +} +// @Filename: /myproject/noCoreRef1/src/file1.ts +export const noCoreRef1Const = 10; +// @Filename: /myproject/noCoreRef1/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, +} +// @Filename: /myproject/indirect/src/file1.ts +export const indirectConst = 10; +// @Filename: /myproject/indirect/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../coreRef1" }, + ] +} +// @Filename: /myproject/coreRef1/src/file1.ts +export const coreRef1Const = 10; +// @Filename: /myproject/coreRef1/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +// @Filename: /myproject/indirectDisabledChildLoad1/src/file1.ts +export const indirectDisabledChildLoad1Const = 10; +// @Filename: /myproject/indirectDisabledChildLoad1/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "disableReferencedProjectLoad": true, + }, + "references": [ + { "path": "../coreRef2" }, + ] +} +// @Filename: /myproject/coreRef2/src/file1.ts +export const coreRef2Const = 10; +// @Filename: /myproject/coreRef2/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +// @Filename: /myproject/indirectDisabledChildLoad2/src/file1.ts +export const indirectDisabledChildLoad2Const = 10; +// @Filename: /myproject/indirectDisabledChildLoad2/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "disableReferencedProjectLoad": true, + }, + "references": [ + { "path": "../coreRef3" }, + ] +} +// @Filename: /myproject/coreRef3/src/file1.ts +export const coreRef3Const = 10; +// @Filename: /myproject/coreRef3/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +// @Filename: /myproject/refToCoreRef3/src/file1.ts +export const refToCoreRef3Const = 10; +// @Filename: /myproject/refToCoreRef3/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../coreRef3" }, + ] +} +// @Filename: /myproject/indirectNoCoreRef/src/file1.ts +export const indirectNoCoreRefConst = 10; +// @Filename: /myproject/indirectNoCoreRef/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../noCoreRef2" }, + ] +} +// @Filename: /myproject/noCoreRef2/src/file1.ts +export const noCoreRef2Const = 10; +// @Filename: /myproject/noCoreRef2/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "main") + f.VerifyBaselineFindAllReferences(t, "find") +} + +func TestFindAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: /packages/babel-loader/tsconfig.json +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "composite": true, + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"], + "references": [{"path": "../core"}] +} +// @Filename: /packages/babel-loader/src/index.ts +/*change*/import type { Foo } from "../../core/src/index.js"; +// @Filename: /packages/core/tsconfig.json +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "composite": true, + "rootDir": "./src", + "outDir": "./dist", + }, + "include": ["./src"] +} +// @Filename: /packages/core/src/index.ts +import { Bar } from "./loading-indicator.js"; +export type Foo = {}; +const bar: Bar = { + /*prop*/prop: 0 +} +// @Filename: /packages/core/src/loading-indicator.ts +export interface Bar { + prop: number; +} +const bar: Bar = { + prop: 1 +}` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "change") + f.GoToMarker(t, "prop") + + // Now change `babel-loader` project to no longer import `core` project + f.GoToMarker(t, "change") + f.Insert(t, "// comment") + + // At this point, we haven't updated `babel-loader` project yet, + // so `babel-loader` is still a containing project of `loading-indicator` file. + // When calling find all references, + // we shouldn't crash due to using outdated information on a file's containing projects. + f.VerifyBaselineFindAllReferences(t, "prop") +} + +func TestFindAllRefsOpenFileInConfiguredProjectThatWillBeRemoved(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: /myproject/playground/tsconfig.json +{} +// @Filename: /myproject/playground/tests.ts +/*tests*/export function foo() {} +// @Filename: /myproject/playground/tsconfig-json/tsconfig.json +{ + "include": ["./src"] +} +// @Filename: /myproject/playground/tsconfig-json/src/src.ts +export function foobar() {} +// @Filename: /myproject/playground/tsconfig-json/tests/spec.ts +export function /*find*/bar() { } +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "tests") + f.CloseFileOfMarker(t, "tests") + f.VerifyBaselineFindAllReferences(t, "find") +} + +func TestFindAllRefsSpecialHandlingOfLocalness(t *testing.T) { + t.Parallel() + type testCase struct { + name string + definition string + usage string + referenceTerm string + } + + for _, tc := range []testCase{ + { + "ArrowFunctionAssignment", + `export const dog = () => { };`, + `shared.dog();`, + "dog", + }, + { + "ArrowFunctionAsObjectLiteralPropertyTypes", + `export const foo = { bar: () => { } };`, + `shared.foo.bar();`, + "bar", + }, + { + "ObjectLiteralProperty", + `export const foo = { baz: "BAZ" };`, + `shared.foo.baz;`, + "baz", + }, + { + "MethodOfClassExpression", + `export const foo = class { fly() {} };`, + stringtestutil.Dedent(` + const instance = new shared.foo(); + instance.fly();`), + "fly", + }, + { + // when using arrow function as object literal property is loaded through indirect assignment with original declaration local to project is treated as local + "ArrowFunctionAsObjectLiteralProperty", + stringtestutil.Dedent(` + const local = { bar: () => { } }; + export const foo = local;`), + `shared.foo.bar();`, + "bar", + }, + } { + t.Run("TestFindAllRefsSpecialHandlingOfLocalness"+tc.name, func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + usageWithMarker := tc.usage[:strings.Index(tc.usage, tc.referenceTerm)] + "/*ref*/" + tc.usage[strings.Index(tc.usage, tc.referenceTerm):] + content := ` +// @stateBaseline: true +// @Filename: /solution/tsconfig.json +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} +// @Filename: /solution/api/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +// @Filename: /solution/api/src/server.ts +import * as shared from "../../shared/dist" +` + usageWithMarker + ` +// @Filename: /solution/app/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +// @Filename: /solution/app/src/app.ts +import * as shared from "../../shared/dist" +` + tc.usage + ` +// @Filename: /solution/app/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +// @Filename: /solution/shared/tsconfig.json +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +// @Filename: /solution/shared/src/index.ts +` + tc.definition + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.VerifyBaselineFindAllReferences(t, "ref") + }) + } +} + +func TestFindAllRefsDeclarationInOtherProject(t *testing.T) { + t.Parallel() + type testCase struct { + projectAlreadyLoaded bool + disableReferencedProjectLoad bool + disableSourceOfProjectReferenceRedirect bool + dtsMapPresent bool + } + // Pre-loaded = A file from project B is already open when FindAllRefs is invoked + // dRPL = Project A has disableReferencedProjectLoad + // dSOPRR = Project A has disableSourceOfProjectReferenceRedirect + // Map = The declaration map file b/lib/index.d.ts.map exists + // B refs = files under directory b in which references are found (all scenarios find all references in a/index.ts) + //Pre-loaded |dRPL|dSOPRR|Map| B state | Notes | B refs | Notes + //-----------+----+------+- -+------------------+--------------+---------------------+--------------------------------------------------- + for _, tc := range []testCase{ + {true, true, true, true}, // Pre-loaded | | index.ts, helper.ts | Via map and pre-loaded project + {true, true, true, false}, // Pre-loaded | | lib/index.d.ts | Even though project is loaded + {true, true, false, true}, // Pre-loaded | | index.ts, helper.ts | + {true, true, false, false}, // Pre-loaded | | index.ts, helper.ts | + {true, false, true, true}, // Pre-loaded | | index.ts, helper.ts | Via map and pre-loaded project + {true, false, true, false}, // Pre-loaded | | lib/index.d.ts | Even though project is loaded + {true, false, false, true}, // Pre-loaded | | index.ts, helper.ts | + {true, false, false, false}, // Pre-loaded | | index.ts, helper.ts | + {false, true, true, true}, // Not loaded | | lib/index.d.ts | Even though map is present + {false, true, true, false}, // Not loaded | | lib/index.d.ts | + {false, true, false, true}, // Not loaded | | index.ts | But not helper.ts, which is not referenced from a + {false, true, false, false}, // Not loaded | | index.ts | But not helper.ts, which is not referenced from a + {false, false, true, true}, // Loaded | Via map | index.ts, helper.ts | Via map and newly loaded project + {false, false, true, false}, // Not loaded | | lib/index.d.ts | + {false, false, false, true}, // Loaded | Via redirect | index.ts, helper.ts | + {false, false, false, false}, // Loaded | Via redirect | index.ts, helper.ts | + } { + subScenario := fmt.Sprintf(`Proj%sLoaded`, core.IfElse(tc.projectAlreadyLoaded, "Is", "IsNot")) + + `RefdProjLoadingIs` + core.IfElse(tc.disableReferencedProjectLoad, "Disabled", "Enabled") + + `ProjRefRedirectsAre` + core.IfElse(tc.disableSourceOfProjectReferenceRedirect, "Disabled", "Enabled") + + `DeclMapIs` + core.IfElse(tc.dtsMapPresent, "Present", "Missing") + t.Run("TestFindAllRefsDeclarationInOtherProject"+subScenario, func(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := fmt.Sprintf(` +// @stateBaseline: true +// @Filename: /myproject/a/tsconfig.json +{ + "disableReferencedProjectLoad": %t, + "disableSourceOfProjectReferenceRedirect": %t, + "composite": true +} +// @Filename: /myproject/a/index.ts +import { B } from "../b/lib"; +const b: /*ref*/B = new B(); +// @Filename: /myproject/b/tsconfig.json +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} +// @Filename: /myproject/b/index.ts +export class B { + M() {} +} +// @Filename: /myproject/b/helper.ts +/*bHelper*/import { B } from "."; +const b: B = new B(); +// @Filename: /myproject/b/lib/index.d.ts +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map`, tc.disableReferencedProjectLoad, tc.disableSourceOfProjectReferenceRedirect) + if tc.dtsMapPresent { + content += ` +// @Filename: /myproject/b/lib/index.d.ts.map +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +}` + } + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + if tc.projectAlreadyLoaded { + f.GoToMarker(t, "ref") + f.GoToMarker(t, "bHelper") + } + f.VerifyBaselineFindAllReferences(t, "ref") + }) + } +} diff --git a/pkg/fourslash/tests/staterename_test.go b/pkg/fourslash/tests/staterename_test.go new file mode 100644 index 000000000..ab7c1c19c --- /dev/null +++ b/pkg/fourslash/tests/staterename_test.go @@ -0,0 +1,132 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestRenameAncestorProjectRefMangement(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: /projects/temp/temp.ts +/*temp*/let x = 10 +// @Filename: /projects/temp/tsconfig.json +{} +// @Filename: /projects/container/lib/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + references: [], + files: [ + "index.ts", + ], +} +// @Filename: /projects/container/lib/index.ts +export const myConst = 30; +// @Filename: /projects/container/exec/tsconfig.json +{ + "files": ["./index.ts"], + "references": [ + { "path": "../lib" }, + ], +} +// @Filename: /projects/container/exec/index.ts +import { myConst } from "../lib"; +export function getMyConst() { + return myConst; +} +// @Filename: /projects/container/compositeExec/tsconfig.json +{ + "compilerOptions": { + "composite": true, + }, + "files": ["./index.ts"], + "references": [ + { "path": "../lib" }, + ], +} +// @Filename: /projects/container/compositeExec/index.ts +import { /*find*/myConst } from "../lib"; +export function getMyConst() { + return myConst; +} +// @Filename: /projects/container/tsconfig.json +{ + "files": [], + "include": [], + "references": [ + { "path": "./exec" }, + { "path": "./compositeExec" }, + ], +} +// @Filename: /projects/container/tsconfig.json +{ + "files": [], + "include": [], + "references": [ + { "path": "./exec" }, + { "path": "./compositeExec" }, + ], +} +// @Filename: /projects/container/tsconfig.json +{ + "files": [], + "include": [], + "references": [ + { "path": "./exec" }, + { "path": "./compositeExec" }, + ], +} +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "find") + // Open temp file and verify all projects alive + f.GoToMarker(t, "temp") + + // Ref projects are loaded after as part of this command + f.VerifyBaselineRename(t, nil /*preferences*/, "find") + + // Open temp file and verify all projects alive + f.CloseFileOfMarker(t, "temp") + f.GoToMarker(t, "temp") + + // Close all files and open temp file, only inferred project should be alive + f.CloseFileOfMarker(t, "find") + f.CloseFileOfMarker(t, "temp") + f.GoToMarker(t, "temp") +} + +func TestRenameInCommonFile(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + content := ` +// @stateBaseline: true +// @Filename: /projects/a/a.ts +/*aTs*/import {C} from "./c/fc"; +console.log(C) +// @Filename: /projects/a/tsconfig.json +{} +// @link: /projects/c -> /projects/a/c +// @Filename: /projects/b/b.ts +/*bTs*/import {C} from "../c/fc"; +console.log(C) +// @Filename: /projects/b/tsconfig.json +{} +// @link: /projects/c -> /projects/b/c +// @Filename: /projects/c/fc.ts +export const /*find*/C = 42; +` + f := fourslash.NewFourslash(t, nil /*capabilities*/, content) + f.GoToMarker(t, "aTs") + f.GoToMarker(t, "bTs") + findMarker := f.MarkerByName(t, "find") + aFcMarker := findMarker.MakerWithSymlink("/projects/a/c/fc.ts") + f.GoToMarkerOrRange(t, aFcMarker) + f.GoToMarkerOrRange(t, findMarker.MakerWithSymlink("/projects/b/c/fc.ts")) + f.VerifyBaselineRename(t, nil /*preferences*/, aFcMarker) +} diff --git a/pkg/locale/locale.go b/pkg/locale/locale.go new file mode 100644 index 000000000..20d6e14a3 --- /dev/null +++ b/pkg/locale/locale.go @@ -0,0 +1,28 @@ +package locale + +import ( + "context" + + "golang.org/x/text/language" +) + +type contextKey int + +type Locale language.Tag + +var Default Locale + +func WithLocale(ctx context.Context, locale Locale) context.Context { + return context.WithValue(ctx, contextKey(0), locale) +} + +func FromContext(ctx context.Context) Locale { + locale, _ := ctx.Value(contextKey(0)).(Locale) + return locale +} + +func Parse(localeStr string) (locale Locale, ok bool) { + // Parse gracefully fails. + tag, err := language.Parse(localeStr) + return Locale(tag), err == nil +} diff --git a/pkg/ls/autoimports.go b/pkg/ls/autoimports.go index 3af18b13c..2f00c5406 100644 --- a/pkg/ls/autoimports.go +++ b/pkg/ls/autoimports.go @@ -14,6 +14,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/debug" "github.com/buke/typescript-go-internal/pkg/diagnostics" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/ls/change" "github.com/buke/typescript-go-internal/pkg/ls/lsutil" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" @@ -1439,25 +1440,28 @@ func (l *LanguageService) codeActionForFix( includeSymbolNameInDescription bool, ) codeAction { tracker := change.NewTracker(ctx, l.GetProgram().Options(), l.FormatOptions(), l.converters) // !!! changetracker.with - diag := l.codeActionForFixWorker(tracker, sourceFile, symbolName, fix, includeSymbolNameInDescription) + diag := l.codeActionForFixWorker(ctx, tracker, sourceFile, symbolName, fix, includeSymbolNameInDescription) changes := tracker.GetChanges()[sourceFile.FileName()] - return codeAction{description: diag.Message(), changes: changes} + return codeAction{description: diag, changes: changes} } func (l *LanguageService) codeActionForFixWorker( + ctx context.Context, changeTracker *change.Tracker, sourceFile *ast.SourceFile, symbolName string, fix *ImportFix, includeSymbolNameInDescription bool, -) *diagnostics.Message { +) string { + locale := locale.FromContext(ctx) + switch fix.kind { case ImportFixKindUseNamespace: addNamespaceQualifier(changeTracker, sourceFile, fix.qualification()) - return diagnostics.FormatMessage(diagnostics.Change_0_to_1, symbolName, fmt.Sprintf("%s.%s", *fix.namespacePrefix, symbolName)) + return diagnostics.Change_0_to_1.Localize(locale, symbolName, fmt.Sprintf("%s.%s", *fix.namespacePrefix, symbolName)) case ImportFixKindJsdocTypeImport: if fix.usagePosition == nil { - return nil + return "" } quotePreference := getQuotePreference(sourceFile, l.UserPreferences()) quoteChar := "\"" @@ -1466,7 +1470,7 @@ func (l *LanguageService) codeActionForFixWorker( } importTypePrefix := fmt.Sprintf("import(%s%s%s).", quoteChar, fix.moduleSpecifier, quoteChar) changeTracker.InsertText(sourceFile, *fix.usagePosition, importTypePrefix) - return diagnostics.FormatMessage(diagnostics.Change_0_to_1, symbolName, importTypePrefix+symbolName) + return diagnostics.Change_0_to_1.Localize(locale, symbolName, importTypePrefix+symbolName) case ImportFixKindAddToExisting: var defaultImport *Import var namedImports []*Import @@ -1484,9 +1488,9 @@ func (l *LanguageService) codeActionForFixWorker( ) moduleSpecifierWithoutQuotes := stringutil.StripQuotes(fix.moduleSpecifier) if includeSymbolNameInDescription { - return diagnostics.FormatMessage(diagnostics.Import_0_from_1, symbolName, moduleSpecifierWithoutQuotes) + return diagnostics.Import_0_from_1.Localize(locale, symbolName, moduleSpecifierWithoutQuotes) } - return diagnostics.FormatMessage(diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes) + return diagnostics.Update_import_from_0.Localize(locale, moduleSpecifierWithoutQuotes) case ImportFixKindAddNew: var declarations []*ast.Statement var defaultImport *Import @@ -1521,17 +1525,17 @@ func (l *LanguageService) codeActionForFixWorker( addNamespaceQualifier(changeTracker, sourceFile, qualification) } if includeSymbolNameInDescription { - return diagnostics.FormatMessage(diagnostics.Import_0_from_1, symbolName, fix.moduleSpecifier) + return diagnostics.Import_0_from_1.Localize(locale, symbolName, fix.moduleSpecifier) } - return diagnostics.FormatMessage(diagnostics.Add_import_from_0, fix.moduleSpecifier) + return diagnostics.Add_import_from_0.Localize(locale, fix.moduleSpecifier) case ImportFixKindPromoteTypeOnly: promotedDeclaration := promoteFromTypeOnly(changeTracker, fix.typeOnlyAliasDeclaration, l.GetProgram(), sourceFile, l) if promotedDeclaration.Kind == ast.KindImportSpecifier { moduleSpec := getModuleSpecifierText(promotedDeclaration.Parent.Parent) - return diagnostics.FormatMessage(diagnostics.Remove_type_from_import_of_0_from_1, symbolName, moduleSpec) + return diagnostics.Remove_type_from_import_of_0_from_1.Localize(locale, symbolName, moduleSpec) } moduleSpec := getModuleSpecifierText(promotedDeclaration) - return diagnostics.FormatMessage(diagnostics.Remove_type_from_import_declaration_from_0, moduleSpec) + return diagnostics.Remove_type_from_import_declaration_from_0.Localize(locale, moduleSpec) default: panic(fmt.Sprintf(`Unexpected fix kind %v`, fix.kind)) } diff --git a/pkg/ls/codeactions_importfixes.go b/pkg/ls/codeactions_importfixes.go index 407ec8775..8b78426c0 100644 --- a/pkg/ls/codeactions_importfixes.go +++ b/pkg/ls/codeactions_importfixes.go @@ -75,6 +75,7 @@ func getImportCodeActions(ctx context.Context, fixContext *CodeFixContext) []Cod for _, fixInfo := range info { tracker := change.NewTracker(ctx, fixContext.Program.Options(), fixContext.LS.FormatOptions(), fixContext.LS.converters) msg := fixContext.LS.codeActionForFixWorker( + ctx, tracker, fixContext.SourceFile, fixInfo.symbolName, @@ -82,7 +83,7 @@ func getImportCodeActions(ctx context.Context, fixContext *CodeFixContext) []Cod fixInfo.symbolName != fixInfo.errorIdentifierText, ) - if msg != nil { + if msg != "" { // Convert changes to LSP edits changes := tracker.GetChanges() var edits []*lsproto.TextEdit @@ -91,7 +92,7 @@ func getImportCodeActions(ctx context.Context, fixContext *CodeFixContext) []Cod } actions = append(actions, CodeAction{ - Description: msg.Message(), + Description: msg, Changes: edits, }) } diff --git a/pkg/ls/documenthighlights.go b/pkg/ls/documenthighlights.go index f34c0bd22..1d5567aa7 100644 --- a/pkg/ls/documenthighlights.go +++ b/pkg/ls/documenthighlights.go @@ -75,7 +75,7 @@ func (l *LanguageService) toDocumentHighlight(entry *ReferenceEntry) (string, *l kind := lsproto.DocumentHighlightKindRead if entry.kind == entryKindRange { return entry.fileName, &lsproto.DocumentHighlight{ - Range: *entry.textRange, + Range: *l.getRangeOfEntry(entry), Kind: &kind, } } @@ -86,7 +86,7 @@ func (l *LanguageService) toDocumentHighlight(entry *ReferenceEntry) (string, *l } dh := &lsproto.DocumentHighlight{ - Range: *entry.textRange, + Range: *l.getRangeOfEntry(entry), Kind: &kind, } diff --git a/pkg/ls/findallreferences.go b/pkg/ls/findallreferences.go index bc99f2e1d..182bf94bd 100644 --- a/pkg/ls/findallreferences.go +++ b/pkg/ls/findallreferences.go @@ -6,6 +6,7 @@ import ( "fmt" "slices" "strings" + "sync" "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/astnav" @@ -104,33 +105,52 @@ type ReferenceEntry struct { node *ast.Node context *ast.Node // !!! ContextWithStartAndEndNode, optional fileName string - textRange *lsproto.Range + textRange *core.TextRange + lspRange *lsproto.Location +} + +func (entry *SymbolAndEntries) canUseDefinitionSymbol() bool { + if entry.definition == nil { + return false + } + + switch entry.definition.Kind { + case definitionKindSymbol, definitionKindThis: + return entry.definition.symbol != nil + case definitionKindTripleSlashReference: + // !!! TODO : need to find file reference instead? + // May need to return true to indicate this to be file search instead and might need to do for import stuff as well + // For now + return false + default: + return false + } } func (l *LanguageService) getRangeOfEntry(entry *ReferenceEntry) *lsproto.Range { - return l.resolveEntry(entry).textRange + return &l.resolveEntry(entry).lspRange.Range +} + +func (l *LanguageService) getFileNameOfEntry(entry *ReferenceEntry) lsproto.DocumentUri { + return l.resolveEntry(entry).lspRange.Uri } -func (l *LanguageService) getFileNameOfEntry(entry *ReferenceEntry) string { - return l.resolveEntry(entry).fileName +func (l *LanguageService) getLocationOfEntry(entry *ReferenceEntry) *lsproto.Location { + return l.resolveEntry(entry).lspRange } func (l *LanguageService) resolveEntry(entry *ReferenceEntry) *ReferenceEntry { if entry.textRange == nil { sourceFile := ast.GetSourceFileOfNode(entry.node) - entry.textRange = l.getLspRangeOfNode(entry.node, sourceFile, nil /*endNode*/) + textRange := getRangeOfNode(entry.node, sourceFile, nil /*endNode*/) + entry.textRange = &textRange entry.fileName = sourceFile.FileName() } - return entry -} - -func (l *LanguageService) newRangeEntry(file *ast.SourceFile, start, end int) *ReferenceEntry { - // !!! used in not-yet implemented features - return &ReferenceEntry{ - kind: entryKindRange, - fileName: file.FileName(), - textRange: l.createLspRangeFromBounds(start, end, file), + if entry.lspRange == nil { + location := l.getMappedLocation(entry.fileName, *entry.textRange) + entry.lspRange = &location } + return entry } func newNodeEntryWithKind(node *ast.Node, kind entryKind) *ReferenceEntry { @@ -266,10 +286,9 @@ func (l *LanguageService) getLspRangeOfNode(node *ast.Node, sourceFile *ast.Sour sourceFile = ast.GetSourceFileOfNode(node) } textRange := getRangeOfNode(node, sourceFile, endNode) - return l.createLspRangeFromRange(textRange, sourceFile) + return l.createLspRangeFromBounds(textRange.Pos(), textRange.End(), sourceFile) } -// `getTextSpan` func getRangeOfNode(node *ast.Node, sourceFile *ast.SourceFile, endNode *ast.Node) core.TextRange { if sourceFile == nil { sourceFile = ast.GetSourceFileOfNode(node) @@ -416,16 +435,170 @@ func getSymbolScope(symbol *ast.Symbol) *ast.Node { // === functions on (*ls) === -func (l *LanguageService) ProvideReferences(ctx context.Context, params *lsproto.ReferenceParams) (lsproto.ReferencesResponse, error) { +type position struct { + uri lsproto.DocumentUri + pos lsproto.Position +} + +var _ lsproto.HasTextDocumentPosition = (*position)(nil) + +func (nld *position) TextDocumentURI() lsproto.DocumentUri { return nld.uri } +func (nld *position) TextDocumentPosition() lsproto.Position { return nld.pos } + +type NonLocalDefinition struct { + position + GetSourcePosition func() lsproto.HasTextDocumentPosition + GetGeneratedPosition func() lsproto.HasTextDocumentPosition +} + +func getFileAndStartPosFromDeclaration(declaration *ast.Node) (*ast.SourceFile, core.TextPos) { + file := ast.GetSourceFileOfNode(declaration) + name := core.OrElse(ast.GetNameOfDeclaration(declaration), declaration) + textRange := getRangeOfNode(name, file, nil /*endNode*/) + + return file, core.TextPos(textRange.Pos()) +} + +func (l *LanguageService) GetNonLocalDefinition(ctx context.Context, entry *SymbolAndEntries) *NonLocalDefinition { + if !entry.canUseDefinitionSymbol() { + return nil + } + + program := l.GetProgram() + checker, done := program.GetTypeChecker(ctx) + defer done() + emitResolver := checker.GetEmitResolver() + for _, d := range entry.definition.symbol.Declarations { + if isDefinitionVisible(emitResolver, d) { + file, startPos := getFileAndStartPosFromDeclaration(d) + fileName := file.FileName() + return &NonLocalDefinition{ + position: position{ + uri: lsconv.FileNameToDocumentURI(fileName), + pos: l.converters.PositionToLineAndCharacter(file, startPos), + }, + GetSourcePosition: sync.OnceValue(func() lsproto.HasTextDocumentPosition { + mapped := l.tryGetSourcePosition(fileName, startPos) + if mapped != nil { + return &position{ + uri: lsconv.FileNameToDocumentURI(mapped.FileName), + pos: l.converters.PositionToLineAndCharacter(l.getScript(mapped.FileName), core.TextPos(mapped.Pos)), + } + } + return nil + }), + GetGeneratedPosition: sync.OnceValue(func() lsproto.HasTextDocumentPosition { + mapped := l.tryGetGeneratedPosition(fileName, startPos) + if mapped != nil { + return &position{ + uri: lsconv.FileNameToDocumentURI(mapped.FileName), + pos: l.converters.PositionToLineAndCharacter(l.getScript(mapped.FileName), core.TextPos(mapped.Pos)), + } + } + return nil + }), + } + } + } + return nil +} + +// This is special handling to determine if we should load up more projects and find location in other projects +// By default arrows (and such other ast kinds) are not visible as declaration emitter doesnt need them +// But we want to handle them specially so that they are visible if their parent is visible +func isDefinitionVisible(emitResolver *checker.EmitResolver, declaration *ast.Node) bool { + if emitResolver.IsDeclarationVisible(declaration) { + return true + } + if declaration.Parent == nil { + return false + } + + // Variable initializers are visible if variable is visible + if ast.HasInitializer(declaration.Parent) && declaration.Parent.Initializer() == declaration { + return isDefinitionVisible(emitResolver, declaration.Parent) + } + + // Handle some exceptions here like arrow function, members of class and object literal expression which are technically not visible but we want the definition to be determined by its parent + switch declaration.Kind { + case ast.KindPropertyDeclaration, + ast.KindGetAccessor, + ast.KindSetAccessor, + ast.KindMethodDeclaration: + // Private/protected properties/methods are not visible + if ast.HasModifier(declaration, ast.ModifierFlagsPrivate) || ast.IsPrivateIdentifier(declaration.Name()) { + return false + } + // Public properties/methods are visible if its parents are visible, so: + // falls through + fallthrough + case ast.KindConstructor, + ast.KindPropertyAssignment, + ast.KindShorthandPropertyAssignment, + ast.KindObjectLiteralExpression, + ast.KindClassExpression, + ast.KindArrowFunction, + ast.KindFunctionExpression: + return isDefinitionVisible(emitResolver, declaration.Parent) + default: + return false + } +} + +func (l *LanguageService) ForEachOriginalDefinitionLocation( + ctx context.Context, + entry *SymbolAndEntries, + cb func(lsproto.DocumentUri, lsproto.Position), +) { + if !entry.canUseDefinitionSymbol() { + return + } + + program := l.GetProgram() + for _, d := range entry.definition.symbol.Declarations { + file, startPos := getFileAndStartPosFromDeclaration(d) + fileName := file.FileName() + if tspath.IsDeclarationFileName(fileName) { + // Map to ts position + mapped := l.tryGetSourcePosition(file.FileName(), startPos) + if mapped != nil { + cb( + lsconv.FileNameToDocumentURI(mapped.FileName), + l.converters.PositionToLineAndCharacter(l.getScript(mapped.FileName), core.TextPos(mapped.Pos)), + ) + } + } else if program.IsSourceFromProjectReference(l.toPath(fileName)) { + cb( + lsconv.FileNameToDocumentURI(fileName), + l.converters.PositionToLineAndCharacter(file, startPos), + ) + } + } +} + +func (l *LanguageService) ProvideSymbolsAndEntries(ctx context.Context, uri lsproto.DocumentUri, documentPosition lsproto.Position, isRename bool) (*ast.Node, []*SymbolAndEntries, bool) { // `findReferencedSymbols` except only computes the information needed to return reference locations - program, sourceFile := l.getProgramAndFile(params.TextDocument.Uri) - position := int(l.converters.LineAndCharacterToPosition(sourceFile, params.Position)) + program, sourceFile := l.getProgramAndFile(uri) + position := int(l.converters.LineAndCharacterToPosition(sourceFile, documentPosition)) node := astnav.GetTouchingPropertyName(sourceFile, position) - options := refOptions{use: referenceUseReferences} + if isRename && node.Kind != ast.KindIdentifier { + return node, nil, false + } - symbolsAndEntries := l.getReferencedSymbolsForNode(ctx, position, node, program, program.GetSourceFiles(), options, nil) + var options refOptions + if !isRename { + options.use = referenceUseReferences + } else { + options.use = referenceUseRename + options.useAliasesForRename = true + } + + return node, l.getReferencedSymbolsForNode(ctx, position, node, program, program.GetSourceFiles(), options, nil), true +} +func (l *LanguageService) ProvideReferencesFromSymbolAndEntries(ctx context.Context, params *lsproto.ReferenceParams, originalNode *ast.Node, symbolsAndEntries []*SymbolAndEntries) (lsproto.ReferencesResponse, error) { + // `findReferencedSymbols` except only computes the information needed to return reference locations locations := core.FlatMap(symbolsAndEntries, l.convertSymbolAndEntriesToLocations) return lsproto.LocationsOrNull{Locations: &locations}, nil } @@ -466,24 +639,21 @@ func (l *LanguageService) getImplementationReferenceEntries(ctx context.Context, return core.FlatMap(symbolsAndEntries, func(s *SymbolAndEntries) []*ReferenceEntry { return s.references }) } -func (l *LanguageService) ProvideRename(ctx context.Context, params *lsproto.RenameParams) (lsproto.WorkspaceEditOrNull, error) { - program, sourceFile := l.getProgramAndFile(params.TextDocument.Uri) - position := int(l.converters.LineAndCharacterToPosition(sourceFile, params.Position)) - node := astnav.GetTouchingPropertyName(sourceFile, position) - if node.Kind != ast.KindIdentifier { +func (l *LanguageService) ProvideRenameFromSymbolAndEntries(ctx context.Context, params *lsproto.RenameParams, originalNode *ast.Node, symbolsAndEntries []*SymbolAndEntries) (lsproto.WorkspaceEditOrNull, error) { + if originalNode.Kind != ast.KindIdentifier { return lsproto.WorkspaceEditOrNull{}, nil } - options := refOptions{use: referenceUseRename, useAliasesForRename: true} - symbolsAndEntries := l.getReferencedSymbolsForNode(ctx, position, node, program, program.GetSourceFiles(), options, nil) + + program := l.GetProgram() entries := core.FlatMap(symbolsAndEntries, func(s *SymbolAndEntries) []*ReferenceEntry { return s.references }) changes := make(map[lsproto.DocumentUri][]*lsproto.TextEdit) checker, done := program.GetTypeChecker(ctx) defer done() for _, entry := range entries { - uri := lsconv.FileNameToDocumentURI(l.getFileNameOfEntry(entry)) + uri := l.getFileNameOfEntry(entry) textEdit := &lsproto.TextEdit{ Range: *l.getRangeOfEntry(entry), - NewText: l.getTextForRename(node, entry, params.NewName, checker), + NewText: l.getTextForRename(originalNode, entry, params.NewName, checker), } changes[uri] = append(changes[uri], textEdit) } @@ -550,10 +720,7 @@ func (l *LanguageService) convertSymbolAndEntriesToLocations(s *SymbolAndEntries func (l *LanguageService) convertEntriesToLocations(entries []*ReferenceEntry) []lsproto.Location { locations := make([]lsproto.Location, len(entries)) for i, entry := range entries { - locations[i] = lsproto.Location{ - Uri: lsconv.FileNameToDocumentURI(l.getFileNameOfEntry(entry)), - Range: *l.getRangeOfEntry(entry), - } + locations[i] = *l.getLocationOfEntry(entry) } return locations } @@ -561,29 +728,19 @@ func (l *LanguageService) convertEntriesToLocations(entries []*ReferenceEntry) [ func (l *LanguageService) convertEntriesToLocationLinks(entries []*ReferenceEntry) []*lsproto.LocationLink { links := make([]*lsproto.LocationLink, len(entries)) for i, entry := range entries { - var targetSelectionRange, targetRange *lsproto.Range + + // Get the selection range (the actual reference) + targetSelectionRange := &l.getLocationOfEntry(entry).Range + targetRange := targetSelectionRange // For entries with nodes, compute ranges directly from the node if entry.node != nil { - sourceFile := ast.GetSourceFileOfNode(entry.node) - entry.fileName = sourceFile.FileName() - - // Get the selection range (the actual reference) - selectionTextRange := getRangeOfNode(entry.node, sourceFile, nil /*endNode*/) - targetSelectionRange = l.createLspRangeFromRange(selectionTextRange, sourceFile) - // Get the context range (broader scope including declaration context) - contextTextRange := toContextRange(&selectionTextRange, sourceFile, entry.context) + contextTextRange := toContextRange(entry.textRange, l.program.GetSourceFile(entry.fileName), entry.context) if contextTextRange != nil { - targetRange = l.createLspRangeFromRange(*contextTextRange, sourceFile) - } else { - targetRange = targetSelectionRange + contextLocation := l.getMappedLocation(entry.fileName, *contextTextRange) + targetRange = &contextLocation.Range } - } else { - // For range entries, use the pre-computed range - l.resolveEntry(entry) - targetSelectionRange = entry.textRange - targetRange = targetSelectionRange } links[i] = &lsproto.LocationLink{ @@ -902,7 +1059,7 @@ func getReferencesForThisKeyword(thisOrSuperKeyword *ast.Node, sourceFiles []*as if thisParameter == nil { thisParameter = thisOrSuperKeyword } - return []*SymbolAndEntries{NewSymbolAndEntries(definitionKindThis, thisParameter, nil, references)} + return []*SymbolAndEntries{NewSymbolAndEntries(definitionKindThis, thisParameter, searchSpaceNode.Symbol(), references)} } func getReferencesForSuperKeyword(superKeyword *ast.Node) []*SymbolAndEntries { @@ -1116,7 +1273,7 @@ func (l *LanguageService) getReferencedSymbolsForModule(ctx context.Context, pro return &ReferenceEntry{ kind: entryKindRange, fileName: reference.referencingFile.FileName(), - textRange: l.createLspRangeFromBounds(reference.ref.Pos(), reference.ref.End(), reference.referencingFile), + textRange: &reference.ref.TextRange, } } return nil diff --git a/pkg/ls/hover.go b/pkg/ls/hover.go index e71e8e94b..883559d84 100644 --- a/pkg/ls/hover.go +++ b/pkg/ls/hover.go @@ -9,6 +9,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/astnav" "github.com/buke/typescript-go-internal/pkg/checker" + "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" ) @@ -59,6 +60,9 @@ func (l *LanguageService) ProvideHover(ctx context.Context, documentURI lsproto. } func (l *LanguageService) getQuickInfoAndDocumentationForSymbol(c *checker.Checker, symbol *ast.Symbol, node *ast.Node, contentFormat lsproto.MarkupKind) (string, string) { + if symbol == nil { + return "", "" + } quickInfo, declaration := getQuickInfoAndDeclarationAtLocation(c, symbol, node) if quickInfo == "" { return "", "" @@ -131,149 +135,164 @@ func formatQuickInfo(quickInfo string) string { } func getQuickInfoAndDeclarationAtLocation(c *checker.Checker, symbol *ast.Symbol, node *ast.Node) (string, *ast.Node) { + var b strings.Builder + var visitedAliases collections.Set[*ast.Symbol] container := getContainerNode(node) if node.Kind == ast.KindThisKeyword && ast.IsInExpressionContext(node) { return c.TypeToStringEx(c.GetTypeAtLocation(node), container, typeFormatFlags), nil } - isAlias := symbol != nil && symbol.Flags&ast.SymbolFlagsAlias != 0 - if isAlias { - symbol = c.GetAliasedSymbol(symbol) - } - if symbol == nil || symbol == c.GetUnknownSymbol() { - return "", nil - } - declaration := symbol.ValueDeclaration - flags := symbol.Flags - if flags&ast.SymbolFlagsProperty != 0 && declaration != nil && ast.IsMethodDeclaration(declaration) { - flags = ast.SymbolFlagsMethod - } - if flags&ast.SymbolFlagsType != 0 && (ast.IsPartOfTypeNode(node) || ast.IsTypeDeclarationName(node)) { - // If the symbol has a type meaning and we're in a type context, remove value-only meanings - flags &^= ast.SymbolFlagsVariable | ast.SymbolFlagsFunction - } - var b strings.Builder - if isAlias { - b.WriteString("(alias) ") - } - switch { - case flags&(ast.SymbolFlagsVariable|ast.SymbolFlagsProperty|ast.SymbolFlagsAccessor) != 0: - switch { - case flags&ast.SymbolFlagsProperty != 0: - b.WriteString("(property) ") - case flags&ast.SymbolFlagsAccessor != 0: - b.WriteString("(accessor) ") - default: - decl := symbol.ValueDeclaration - if decl != nil { - switch { - case ast.IsParameter(decl): - b.WriteString("(parameter) ") - case ast.IsVarLet(decl): - b.WriteString("let ") - case ast.IsVarConst(decl): - b.WriteString("const ") - case ast.IsVarUsing(decl): - b.WriteString("using ") - case ast.IsVarAwaitUsing(decl): - b.WriteString("await using ") - default: - b.WriteString("var ") - } - } + writeSymbolMeaning := func(symbol *ast.Symbol, meaning ast.SymbolFlags, isAlias bool) *ast.Node { + flags := symbol.Flags & meaning + if flags == 0 { + return nil } - if symbol.Name == ast.InternalSymbolNameExportEquals && symbol.Parent != nil && symbol.Parent.Flags&ast.SymbolFlagsModule != 0 { - b.WriteString("exports") - } else { - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + declaration := symbol.ValueDeclaration + if flags&ast.SymbolFlagsProperty != 0 && declaration != nil && ast.IsMethodDeclaration(declaration) { + flags = ast.SymbolFlagsMethod } - b.WriteString(": ") - if callNode := getCallOrNewExpression(node); callNode != nil { - b.WriteString(c.SignatureToStringEx(c.GetResolvedSignature(callNode), container, typeFormatFlags|checker.TypeFormatFlagsWriteCallStyleSignature|checker.TypeFormatFlagsWriteTypeArgumentsOfSignature|checker.TypeFormatFlagsWriteArrowStyleSignature)) - } else { - b.WriteString(c.TypeToStringEx(c.GetTypeOfSymbolAtLocation(symbol, node), container, typeFormatFlags)) + if b.Len() != 0 { + b.WriteString("\n") } - case flags&ast.SymbolFlagsEnumMember != 0: - b.WriteString("(enum member) ") - t := c.GetTypeOfSymbol(symbol) - b.WriteString(c.TypeToStringEx(t, container, typeFormatFlags)) - if t.Flags()&checker.TypeFlagsLiteral != 0 { - b.WriteString(" = ") - b.WriteString(t.AsLiteralType().String()) + if isAlias { + b.WriteString("(alias) ") } - case flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsMethod) != 0: - prefix := core.IfElse(flags&ast.SymbolFlagsMethod != 0, "(method) ", "function ") - if ast.IsIdentifier(node) && ast.IsFunctionLikeDeclaration(node.Parent) && node.Parent.Name() == node { - declaration = node.Parent - signatures := []*checker.Signature{c.GetSignatureFromDeclaration(declaration)} - writeSignatures(&b, c, signatures, container, prefix, symbol) - } else { - signatures := getSignaturesAtLocation(c, symbol, checker.SignatureKindCall, node) - if len(signatures) == 1 { - if d := signatures[0].Declaration(); d != nil && d.Flags&ast.NodeFlagsJSDoc == 0 { - declaration = d + switch { + case flags&(ast.SymbolFlagsVariable|ast.SymbolFlagsProperty|ast.SymbolFlagsAccessor) != 0: + switch { + case flags&ast.SymbolFlagsProperty != 0: + b.WriteString("(property) ") + case flags&ast.SymbolFlagsAccessor != 0: + b.WriteString("(accessor) ") + default: + decl := symbol.ValueDeclaration + if decl != nil { + switch { + case ast.IsParameter(decl): + b.WriteString("(parameter) ") + case ast.IsVarLet(decl): + b.WriteString("let ") + case ast.IsVarConst(decl): + b.WriteString("const ") + case ast.IsVarUsing(decl): + b.WriteString("using ") + case ast.IsVarAwaitUsing(decl): + b.WriteString("await using ") + default: + b.WriteString("var ") + } } } - writeSignatures(&b, c, signatures, container, prefix, symbol) - } - case flags&(ast.SymbolFlagsClass|ast.SymbolFlagsInterface) != 0: - if node.Kind == ast.KindThisKeyword || ast.IsThisInTypeQuery(node) { - b.WriteString("this") - } else if node.Kind == ast.KindConstructorKeyword && (ast.IsConstructorDeclaration(node.Parent) || ast.IsConstructSignatureDeclaration(node.Parent)) { - declaration = node.Parent - signatures := []*checker.Signature{c.GetSignatureFromDeclaration(declaration)} - writeSignatures(&b, c, signatures, container, "constructor ", symbol) - } else { - var signatures []*checker.Signature - if flags&ast.SymbolFlagsClass != 0 && getCallOrNewExpression(node) != nil { - signatures = getSignaturesAtLocation(c, symbol, checker.SignatureKindConstruct, node) + if symbol.Name == ast.InternalSymbolNameExportEquals && symbol.Parent != nil && symbol.Parent.Flags&ast.SymbolFlagsModule != 0 { + b.WriteString("exports") + } else { + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + } + b.WriteString(": ") + if callNode := getCallOrNewExpression(node); callNode != nil { + b.WriteString(c.SignatureToStringEx(c.GetResolvedSignature(callNode), container, typeFormatFlags|checker.TypeFormatFlagsWriteCallStyleSignature|checker.TypeFormatFlagsWriteTypeArgumentsOfSignature|checker.TypeFormatFlagsWriteArrowStyleSignature)) + } else { + b.WriteString(c.TypeToStringEx(c.GetTypeOfSymbolAtLocation(symbol, node), container, typeFormatFlags)) } - if len(signatures) == 1 { - if d := signatures[0].Declaration(); d != nil && d.Flags&ast.NodeFlagsJSDoc == 0 { - declaration = d + case flags&ast.SymbolFlagsEnumMember != 0: + b.WriteString("(enum member) ") + t := c.GetTypeOfSymbol(symbol) + b.WriteString(c.TypeToStringEx(t, container, typeFormatFlags)) + if t.Flags()&checker.TypeFlagsLiteral != 0 { + b.WriteString(" = ") + b.WriteString(t.AsLiteralType().String()) + } + case flags&(ast.SymbolFlagsFunction|ast.SymbolFlagsMethod) != 0: + prefix := core.IfElse(flags&ast.SymbolFlagsMethod != 0, "(method) ", "function ") + if ast.IsIdentifier(node) && ast.IsFunctionLikeDeclaration(node.Parent) && node.Parent.Name() == node { + declaration = node.Parent + signatures := []*checker.Signature{c.GetSignatureFromDeclaration(declaration)} + writeSignatures(&b, c, signatures, container, isAlias, prefix, symbol) + } else { + signatures := getSignaturesAtLocation(c, symbol, checker.SignatureKindCall, node) + if len(signatures) == 1 { + if d := signatures[0].Declaration(); d != nil && d.Flags&ast.NodeFlagsJSDoc == 0 { + declaration = d + } } - writeSignatures(&b, c, signatures, container, "constructor ", symbol) + writeSignatures(&b, c, signatures, container, isAlias, prefix, symbol) + } + case flags&(ast.SymbolFlagsClass|ast.SymbolFlagsInterface) != 0: + if node.Kind == ast.KindThisKeyword || ast.IsThisInTypeQuery(node) { + b.WriteString("this") + } else if node.Kind == ast.KindConstructorKeyword && (ast.IsConstructorDeclaration(node.Parent) || ast.IsConstructSignatureDeclaration(node.Parent)) { + declaration = node.Parent + signatures := []*checker.Signature{c.GetSignatureFromDeclaration(declaration)} + writeSignatures(&b, c, signatures, container, isAlias, "constructor ", symbol) } else { - b.WriteString(core.IfElse(flags&ast.SymbolFlagsClass != 0, "class ", "interface ")) - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - params := c.GetDeclaredTypeOfSymbol(symbol).AsInterfaceType().LocalTypeParameters() - writeTypeParams(&b, c, params) + var signatures []*checker.Signature + if flags&ast.SymbolFlagsClass != 0 && getCallOrNewExpression(node) != nil { + signatures = getSignaturesAtLocation(c, symbol, checker.SignatureKindConstruct, node) + } + if len(signatures) == 1 { + if d := signatures[0].Declaration(); d != nil && d.Flags&ast.NodeFlagsJSDoc == 0 { + declaration = d + } + writeSignatures(&b, c, signatures, container, isAlias, "constructor ", symbol) + } else { + b.WriteString(core.IfElse(flags&ast.SymbolFlagsClass != 0, "class ", "interface ")) + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + params := c.GetDeclaredTypeOfSymbol(symbol).AsInterfaceType().LocalTypeParameters() + writeTypeParams(&b, c, params) + } } + if flags&ast.SymbolFlagsInterface != 0 { + declaration = core.Find(symbol.Declarations, ast.IsInterfaceDeclaration) + } + case flags&ast.SymbolFlagsEnum != 0: + b.WriteString("enum ") + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + case flags&ast.SymbolFlagsModule != 0: + b.WriteString(core.IfElse(symbol.ValueDeclaration != nil && ast.IsSourceFile(symbol.ValueDeclaration), "module ", "namespace ")) + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + case flags&ast.SymbolFlagsTypeParameter != 0: + b.WriteString("(type parameter) ") + tp := c.GetDeclaredTypeOfSymbol(symbol) + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + cons := c.GetConstraintOfTypeParameter(tp) + if cons != nil { + b.WriteString(" extends ") + b.WriteString(c.TypeToStringEx(cons, container, typeFormatFlags)) + } + declaration = core.Find(symbol.Declarations, ast.IsTypeParameterDeclaration) + case flags&ast.SymbolFlagsTypeAlias != 0: + b.WriteString("type ") + b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) + writeTypeParams(&b, c, c.GetTypeAliasTypeParameters(symbol)) + if len(symbol.Declarations) != 0 { + b.WriteString(" = ") + b.WriteString(c.TypeToStringEx(c.GetDeclaredTypeOfSymbol(symbol), container, typeFormatFlags|checker.TypeFormatFlagsInTypeAlias)) + } + declaration = core.Find(symbol.Declarations, ast.IsTypeAliasDeclaration) + default: + b.WriteString(c.TypeToStringEx(c.GetTypeOfSymbol(symbol), container, typeFormatFlags)) } - if flags&ast.SymbolFlagsInterface != 0 { - declaration = core.Find(symbol.Declarations, ast.IsInterfaceDeclaration) - } - case flags&ast.SymbolFlagsEnum != 0: - b.WriteString("enum ") - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - case flags&ast.SymbolFlagsModule != 0: - b.WriteString(core.IfElse(symbol.ValueDeclaration != nil && ast.IsSourceFile(symbol.ValueDeclaration), "module ", "namespace ")) - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - case flags&ast.SymbolFlagsTypeParameter != 0: - b.WriteString("(type parameter) ") - tp := c.GetDeclaredTypeOfSymbol(symbol) - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - cons := c.GetConstraintOfTypeParameter(tp) - if cons != nil { - b.WriteString(" extends ") - b.WriteString(c.TypeToStringEx(cons, container, typeFormatFlags)) - } - declaration = core.Find(symbol.Declarations, ast.IsTypeParameterDeclaration) - case flags&ast.SymbolFlagsTypeAlias != 0: - b.WriteString("type ") - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - writeTypeParams(&b, c, c.GetTypeAliasTypeParameters(symbol)) - if len(symbol.Declarations) != 0 { - b.WriteString(" = ") - b.WriteString(c.TypeToStringEx(c.GetDeclaredTypeOfSymbol(symbol), container, typeFormatFlags|checker.TypeFormatFlagsInTypeAlias)) + return declaration + } + var writeSymbol func(*ast.Symbol, bool) *ast.Node + writeSymbol = func(symbol *ast.Symbol, isAlias bool) *ast.Node { + var declaration *ast.Node + // Recursively write all meanings of alias + if symbol.Flags&ast.SymbolFlagsAlias != 0 && visitedAliases.AddIfAbsent(symbol) { + if aliasedSymbol := c.GetAliasedSymbol(symbol); aliasedSymbol != c.GetUnknownSymbol() { + declaration = writeSymbol(aliasedSymbol, true /*isAlias*/) + } } - declaration = core.Find(symbol.Declarations, ast.IsTypeAliasDeclaration) - case flags&ast.SymbolFlagsAlias != 0: - b.WriteString("import ") - b.WriteString(c.SymbolToStringEx(symbol, container, ast.SymbolFlagsNone, symbolFormatFlags)) - default: - b.WriteString(c.TypeToStringEx(c.GetTypeOfSymbol(symbol), container, typeFormatFlags)) - } - return b.String(), declaration + // Write the value meaning, if any + declaration = core.OrElse(declaration, writeSymbolMeaning(symbol, ast.SymbolFlagsValue|ast.SymbolFlagsSignature, isAlias)) + // Write the type meaning, if any + declaration = core.OrElse(declaration, writeSymbolMeaning(symbol, ast.SymbolFlagsType&^ast.SymbolFlagsValue, isAlias)) + // Write the namespace meaning, if any + declaration = core.OrElse(declaration, writeSymbolMeaning(symbol, ast.SymbolFlagsNamespace&^ast.SymbolFlagsValue, isAlias)) + // Return the first declaration + return declaration + } + firstDeclaration := writeSymbol(symbol, false /*isAlias*/) + return b.String(), firstDeclaration } func getNodeForQuickInfo(node *ast.Node) *ast.Node { @@ -306,21 +325,6 @@ func getSymbolAtLocationForQuickInfo(c *checker.Checker, node *ast.Node) *ast.Sy return c.GetSymbolAtLocation(node) } -func inConstructorContext(node *ast.Node) bool { - if node.Kind == ast.KindConstructorKeyword { - return true - } - if ast.IsIdentifier(node) { - for ast.IsRightSideOfQualifiedNameOrPropertyAccess(node) { - node = node.Parent - } - if ast.IsNewExpression(node.Parent) { - return true - } - } - return false -} - func getSignaturesAtLocation(c *checker.Checker, symbol *ast.Symbol, kind checker.SignatureKind, node *ast.Node) []*checker.Signature { signatures := c.GetSignaturesOfType(c.GetTypeOfSymbol(symbol), kind) if len(signatures) > 1 || len(signatures) == 1 && len(signatures[0].TypeParameters()) != 0 { @@ -367,10 +371,13 @@ func writeTypeParams(b *strings.Builder, c *checker.Checker, params []*checker.T } } -func writeSignatures(b *strings.Builder, c *checker.Checker, signatures []*checker.Signature, container *ast.Node, prefix string, symbol *ast.Symbol) { +func writeSignatures(b *strings.Builder, c *checker.Checker, signatures []*checker.Signature, container *ast.Node, isAlias bool, prefix string, symbol *ast.Symbol) { for i, sig := range signatures { if i != 0 { b.WriteString("\n") + if isAlias { + b.WriteString("(alias) ") + } } if i == 3 && len(signatures) >= 5 { b.WriteString(fmt.Sprintf("// +%v more overloads", len(signatures)-3)) diff --git a/pkg/ls/languageservice.go b/pkg/ls/languageservice.go index 170817f70..45817d63b 100644 --- a/pkg/ls/languageservice.go +++ b/pkg/ls/languageservice.go @@ -8,6 +8,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ls/lsutil" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" "github.com/buke/typescript-go-internal/pkg/sourcemap" + "github.com/buke/typescript-go-internal/pkg/tspath" ) type LanguageService struct { @@ -29,6 +30,10 @@ func NewLanguageService( } } +func (l *LanguageService) toPath(fileName string) tspath.Path { + return tspath.ToPath(fileName, l.program.GetCurrentDirectory(), l.UseCaseSensitiveFileNames()) +} + func (l *LanguageService) GetProgram() *compiler.Program { return l.program } diff --git a/pkg/ls/lsconv/converters.go b/pkg/ls/lsconv/converters.go index e65bb99be..6249f1767 100644 --- a/pkg/ls/lsconv/converters.go +++ b/pkg/ls/lsconv/converters.go @@ -14,6 +14,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/diagnosticwriter" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" "github.com/buke/typescript-go-internal/pkg/tspath" ) @@ -214,7 +215,7 @@ type diagnosticOptions struct { // DiagnosticToLSPPull converts a diagnostic for pull diagnostics (textDocument/diagnostic) func DiagnosticToLSPPull(ctx context.Context, converters *Converters, diagnostic *ast.Diagnostic, reportStyleChecksAsWarnings bool) *lsproto.Diagnostic { clientCaps := lsproto.GetClientCapabilities(ctx).TextDocument.Diagnostic - return diagnosticToLSP(converters, diagnostic, diagnosticOptions{ + return diagnosticToLSP(ctx, converters, diagnostic, diagnosticOptions{ reportStyleChecksAsWarnings: reportStyleChecksAsWarnings, // !!! get through context UserPreferences relatedInformation: clientCaps.RelatedInformation, tagValueSet: clientCaps.TagSupport.ValueSet, @@ -224,7 +225,7 @@ func DiagnosticToLSPPull(ctx context.Context, converters *Converters, diagnostic // DiagnosticToLSPPush converts a diagnostic for push diagnostics (textDocument/publishDiagnostics) func DiagnosticToLSPPush(ctx context.Context, converters *Converters, diagnostic *ast.Diagnostic) *lsproto.Diagnostic { clientCaps := lsproto.GetClientCapabilities(ctx).TextDocument.PublishDiagnostics - return diagnosticToLSP(converters, diagnostic, diagnosticOptions{ + return diagnosticToLSP(ctx, converters, diagnostic, diagnosticOptions{ relatedInformation: clientCaps.RelatedInformation, tagValueSet: clientCaps.TagSupport.ValueSet, }) @@ -242,7 +243,8 @@ var styleCheckDiagnostics = collections.NewSetFromItems( diagnostics.Not_all_code_paths_return_a_value.Code(), ) -func diagnosticToLSP(converters *Converters, diagnostic *ast.Diagnostic, opts diagnosticOptions) *lsproto.Diagnostic { +func diagnosticToLSP(ctx context.Context, converters *Converters, diagnostic *ast.Diagnostic, opts diagnosticOptions) *lsproto.Diagnostic { + locale := locale.FromContext(ctx) var severity lsproto.DiagnosticSeverity switch diagnostic.Category() { case diagnostics.CategorySuggestion: @@ -268,7 +270,7 @@ func diagnosticToLSP(converters *Converters, diagnostic *ast.Diagnostic, opts di Uri: FileNameToDocumentURI(related.File().FileName()), Range: converters.ToLSPRange(related.File(), related.Loc()), }, - Message: related.Message(), + Message: related.Localize(locale), }) } } @@ -296,19 +298,19 @@ func diagnosticToLSP(converters *Converters, diagnostic *ast.Diagnostic, opts di Integer: ptrTo(diagnostic.Code()), }, Severity: &severity, - Message: messageChainToString(diagnostic), + Message: messageChainToString(diagnostic, locale), Source: ptrTo("ts"), RelatedInformation: ptrToSliceIfNonEmpty(relatedInformation), Tags: ptrToSliceIfNonEmpty(tags), } } -func messageChainToString(diagnostic *ast.Diagnostic) string { +func messageChainToString(diagnostic *ast.Diagnostic, locale locale.Locale) string { if len(diagnostic.MessageChain()) == 0 { - return diagnostic.Message() + return diagnostic.Localize(locale) } var b strings.Builder - diagnosticwriter.WriteFlattenedASTDiagnosticMessage(&b, diagnostic, "\n") + diagnosticwriter.WriteFlattenedASTDiagnosticMessage(&b, diagnostic, "\n", locale) return b.String() } diff --git a/pkg/ls/lsutil/userpreferences.go b/pkg/ls/lsutil/userpreferences.go index 9e6063bd3..42379361c 100644 --- a/pkg/ls/lsutil/userpreferences.go +++ b/pkg/ls/lsutil/userpreferences.go @@ -20,6 +20,8 @@ func NewDefaultUserPreferences() *UserPreferences { DisplayPartsForJSDoc: true, DisableLineTextInReferences: true, ReportStyleChecksAsWarnings: true, + + ExcludeLibrarySymbolsInNavTo: true, } } @@ -143,13 +145,16 @@ type UserPreferences struct { IncludeInlayFunctionLikeReturnTypeHints bool IncludeInlayEnumMemberValueHints bool + // ------- Symbols ------- + + ExcludeLibrarySymbolsInNavTo bool + // ------- Misc ------- - ExcludeLibrarySymbolsInNavTo bool // !!! - DisableSuggestions bool // !!! - DisableLineTextInReferences bool // !!! - DisplayPartsForJSDoc bool // !!! - ReportStyleChecksAsWarnings bool // !!! If this changes, we need to ask the client to recompute diagnostics + DisableSuggestions bool // !!! + DisableLineTextInReferences bool // !!! + DisplayPartsForJSDoc bool // !!! + ReportStyleChecksAsWarnings bool // !!! If this changes, we need to ask the client to recompute diagnostics } type JsxAttributeCompletionStyle string @@ -380,6 +385,8 @@ func (p *UserPreferences) parseWorker(config map[string]any) { p.parseSuggest(values) case "preferences": p.parsePreferences(values) + case "workspaceSymbols": + p.parseWorkspaceSymbols(values) case "format": // !!! case "tsserver": @@ -516,6 +523,22 @@ func (p *UserPreferences) parseOrganizeImportsPreferences(prefs any) { } } +func (p *UserPreferences) parseWorkspaceSymbols(prefs any) { + symbolPreferences, ok := prefs.(map[string]any) + if !ok { + return + } + for name, value := range symbolPreferences { + switch name { + // !!! scope + case "excludeLibrarySymbols": + p.ExcludeLibrarySymbolsInNavTo = parseBoolWithDefault(value, true) + default: + p.set(name, value) + } + } +} + func parseEnabledBool(v map[string]any) bool { // vscode nested option if enabled, ok := v["enabled"]; ok { @@ -623,7 +646,7 @@ func (p *UserPreferences) set(name string, value any) { case "includeinlayenummembervaluehints": p.IncludeInlayEnumMemberValueHints = parseBoolWithDefault(value, false) case "excludelibrarysymbolsinnavto": - p.ExcludeLibrarySymbolsInNavTo = parseBoolWithDefault(value, false) + p.ExcludeLibrarySymbolsInNavTo = parseBoolWithDefault(value, true) case "disablesuggestions": p.DisableSuggestions = parseBoolWithDefault(value, false) case "disablelinetextinreferences": diff --git a/pkg/ls/source_map.go b/pkg/ls/source_map.go index 376b83957..28ba3100a 100644 --- a/pkg/ls/source_map.go +++ b/pkg/ls/source_map.go @@ -5,6 +5,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/debug" "github.com/buke/typescript-go-internal/pkg/ls/lsconv" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/outputpaths" "github.com/buke/typescript-go-internal/pkg/sourcemap" "github.com/buke/typescript-go-internal/pkg/tspath" ) @@ -86,3 +87,47 @@ func (l *LanguageService) tryGetSourcePositionWorker( } return documentPos } + +func (l *LanguageService) tryGetGeneratedPosition( + fileName string, + position core.TextPos, +) *sourcemap.DocumentPosition { + newPos := l.tryGetGeneratedPositionWorker(fileName, position) + if newPos != nil { + if _, ok := l.ReadFile(newPos.FileName); !ok { // File doesn't exist + return nil + } + } + return newPos +} + +func (l *LanguageService) tryGetGeneratedPositionWorker( + fileName string, + position core.TextPos, +) *sourcemap.DocumentPosition { + if tspath.IsDeclarationFileName(fileName) { + return nil + } + + program := l.GetProgram() + if program == nil || program.GetSourceFile(fileName) == nil { + return nil + } + + path := l.toPath(fileName) + // If this is source file of project reference source (instead of redirect) there is no generated position + if program.IsSourceFromProjectReference(path) { + return nil + } + + declarationFileName := outputpaths.GetOutputDeclarationFileNameWorker(fileName, program.Options(), program) + positionMapper := l.GetDocumentPositionMapper(declarationFileName) + documentPos := positionMapper.GetGeneratedPosition(&sourcemap.DocumentPosition{FileName: fileName, Pos: int(position)}) + if documentPos == nil { + return nil + } + if newPos := l.tryGetGeneratedPositionWorker(documentPos.FileName, core.TextPos(documentPos.Pos)); newPos != nil { + return newPos + } + return documentPos +} diff --git a/pkg/ls/symbols.go b/pkg/ls/symbols.go index afd5a8539..fca82a186 100644 --- a/pkg/ls/symbols.go +++ b/pkg/ls/symbols.go @@ -8,14 +8,16 @@ import ( "unicode/utf8" "github.com/buke/typescript-go-internal/pkg/ast" - "github.com/buke/typescript-go-internal/pkg/collections" + "github.com/buke/typescript-go-internal/pkg/astnav" "github.com/buke/typescript-go-internal/pkg/compiler" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/ls/lsconv" + "github.com/buke/typescript-go-internal/pkg/ls/lsutil" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" "github.com/buke/typescript-go-internal/pkg/printer" "github.com/buke/typescript-go-internal/pkg/scanner" "github.com/buke/typescript-go-internal/pkg/stringutil" + "github.com/buke/typescript-go-internal/pkg/tspath" ) func (l *LanguageService) ProvideDocumentSymbols(ctx context.Context, documentURI lsproto.DocumentUri) (lsproto.DocumentSymbolResponse, error) { @@ -238,19 +240,27 @@ type DeclarationInfo struct { matchScore int } -func ProvideWorkspaceSymbols(ctx context.Context, programs []*compiler.Program, converters *lsconv.Converters, query string) (lsproto.WorkspaceSymbolResponse, error) { +func ProvideWorkspaceSymbols( + ctx context.Context, + programs []*compiler.Program, + converters *lsconv.Converters, + preferences *lsutil.UserPreferences, + query string, +) (lsproto.WorkspaceSymbolResponse, error) { + excludeLibrarySymbols := preferences.ExcludeLibrarySymbolsInNavTo // Obtain set of non-declaration source files from all active programs. - var sourceFiles collections.Set[*ast.SourceFile] + sourceFiles := map[tspath.Path]*ast.SourceFile{} for _, program := range programs { for _, sourceFile := range program.SourceFiles() { - if !sourceFile.IsDeclarationFile { - sourceFiles.Add(sourceFile) + if (program.HasTSFile() || !sourceFile.IsDeclarationFile) && + !shouldExcludeFile(sourceFile, program, excludeLibrarySymbols) { + sourceFiles[sourceFile.Path()] = sourceFile } } } // Create DeclarationInfos for all declarations in the source files. var infos []DeclarationInfo - for sourceFile := range sourceFiles.Keys() { + for _, sourceFile := range sourceFiles { if ctx.Err() != nil { return lsproto.SymbolInformationsOrWorkspaceSymbolsOrNull{}, nil } @@ -269,18 +279,33 @@ func ProvideWorkspaceSymbols(ctx context.Context, programs []*compiler.Program, count := min(len(infos), 256) symbols := make([]*lsproto.SymbolInformation, count) for i, info := range infos[0:count] { - node := core.OrElse(ast.GetNameOfDeclaration(info.declaration), info.declaration) + node := info.declaration sourceFile := ast.GetSourceFileOfNode(node) - pos := scanner.SkipTrivia(sourceFile.Text(), node.Pos()) + pos := astnav.GetStartOfNode(node, sourceFile, false /*includeJsDoc*/) + container := getContainerNode(info.declaration) + var containerName *string + if container != nil { + containerName = strPtrTo(ast.GetDeclarationName(container)) + } var symbol lsproto.SymbolInformation symbol.Name = info.name symbol.Kind = getSymbolKindFromNode(info.declaration) symbol.Location = converters.ToLSPLocation(sourceFile, core.NewTextRange(pos, node.End())) + symbol.ContainerName = containerName symbols[i] = &symbol } + return lsproto.SymbolInformationsOrWorkspaceSymbolsOrNull{SymbolInformations: &symbols}, nil } +func shouldExcludeFile(file *ast.SourceFile, program *compiler.Program, excludeLibrarySymbols bool) bool { + return excludeLibrarySymbols && (isInsideNodeModules(file.FileName()) || program.IsLibFile(file)) +} + +func isInsideNodeModules(fileName string) bool { + return strings.Contains(fileName, "/node_modules/") +} + // Return a score for matching `s` against `pattern`. In order to match, `s` must contain each of the characters in // `pattern` in the same order. Upper case characters in `pattern` must match exactly, whereas lower case characters // in `pattern` match either case in `s`. If `s` doesn't match, -1 is returned. Otherwise, the returned score is the @@ -347,6 +372,16 @@ func getSymbolKindFromNode(node *ast.Node) lsproto.SymbolKind { return lsproto.SymbolKindEnumMember case ast.KindTypeParameter: return lsproto.SymbolKindTypeParameter + case ast.KindParameter: + if ast.HasSyntacticModifier(node, ast.ModifierFlagsParameterPropertyModifier) { + return lsproto.SymbolKindProperty + } + return lsproto.SymbolKindVariable + case ast.KindBinaryExpression: + switch ast.GetAssignmentDeclarationKind(node.AsBinaryExpression()) { + case ast.JSDeclarationKindThisProperty, ast.JSDeclarationKindProperty: + return lsproto.SymbolKindProperty + } } return lsproto.SymbolKindVariable } diff --git a/pkg/lsp/lsproto/_generate/generate.mts b/pkg/lsp/lsproto/_generate/generate.mts index a8dbf3211..43a78e3a2 100644 --- a/pkg/lsp/lsproto/_generate/generate.mts +++ b/pkg/lsp/lsproto/_generate/generate.mts @@ -927,6 +927,14 @@ function generateCode() { writeLine(`\treturn s.TextDocument.Uri`); writeLine(`}`); writeLine(""); + + if (hasTextDocumentPosition(structure)) { + // Generate TextDocumentPosition method + writeLine(`func (s *${structure.name}) TextDocumentPosition() Position {`); + writeLine(`\treturn s.Position`); + writeLine(`}`); + writeLine(""); + } } // Generate UnmarshalJSONFrom method for structure validation @@ -1005,6 +1013,14 @@ function generateCode() { } } + // Helper function to detect if an enum is a bitflag enum + // Hardcoded list of bitflag enums + const bitflagEnums = new Set(["WatchKind"]); + + function isBitflagEnum(enumeration: any): boolean { + return bitflagEnums.has(enumeration.name); + } + // Generate enumerations writeLine("// Enumerations\n"); @@ -1033,6 +1049,8 @@ function generateCode() { const enumValues = enumeration.values.map(value => ({ value: String(value.value), + numericValue: Number(value.value), + name: value.name, identifier: `${enumeration.name}${value.name}`, documentation: value.documentation, deprecated: value.deprecated, @@ -1058,6 +1076,194 @@ function generateCode() { writeLine(")"); writeLine(""); + + // Generate String() method for non-string enums + if (enumeration.type.name !== "string") { + const isBitflag = isBitflagEnum(enumeration); + + if (isBitflag) { + // Generate bitflag-aware String() method using stringer-style efficiency + const sortedValues = [...enumValues].sort((a, b) => a.numericValue - b.numericValue); + const names = sortedValues.map(v => v.name); + const values = sortedValues.map(v => v.numericValue); + + const nameConst = `_${enumeration.name}_name`; + const indexVar = `_${enumeration.name}_index`; + const combinedNames = names.join(""); + + writeLine(`const ${nameConst} = "${combinedNames}"`); + write(`var ${indexVar} = [...]uint16{0`); + let offset = 0; + for (const name of names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tif e == 0 {`); + writeLine(`\t\treturn "0"`); + writeLine(`\t}`); + writeLine(`\tvar parts []string`); + for (let i = 0; i < values.length; i++) { + writeLine(`\tif e&${values[i]} != 0 {`); + writeLine(`\t\tparts = append(parts, ${nameConst}[${indexVar}[${i}]:${indexVar}[${i + 1}]])`); + writeLine(`\t}`); + } + writeLine(`\tif len(parts) == 0 {`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`\treturn strings.Join(parts, "|")`); + writeLine(`}`); + writeLine(""); + } + else { + // Generate regular String() method using stringer-style approach + // Split values into runs of contiguous values + const sortedValues = [...enumValues].sort((a, b) => a.numericValue - b.numericValue); + + // Split into runs + const runs: Array<{ names: string[]; values: number[]; }> = []; + let currentRun = { names: [sortedValues[0].name], values: [sortedValues[0].numericValue] }; + + for (let i = 1; i < sortedValues.length; i++) { + if (sortedValues[i].numericValue === sortedValues[i - 1].numericValue + 1) { + currentRun.names.push(sortedValues[i].name); + currentRun.values.push(sortedValues[i].numericValue); + } + else { + runs.push(currentRun); + currentRun = { names: [sortedValues[i].name], values: [sortedValues[i].numericValue] }; + } + } + runs.push(currentRun); + + const nameConst = `_${enumeration.name}_name`; + const indexVar = `_${enumeration.name}_index`; + + if (runs.length === 1) { + // Single contiguous run - simple case + const combinedNames = runs[0].names.join(""); + writeLine(`const ${nameConst} = "${combinedNames}"`); + write(`var ${indexVar} = [...]uint16{0`); + let offset = 0; + for (const name of runs[0].names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + writeLine(""); + + const minVal = runs[0].values[0]; + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\ti := int(e) - ${minVal}`); + // For unsigned types, i can still be negative if e < minVal (due to underflow in conversion) + // So we always need to check both bounds + writeLine(`\tif i < 0 || i >= len(${indexVar})-1 {`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`\treturn ${nameConst}[${indexVar}[i]:${indexVar}[i+1]]`); + writeLine(`}`); + writeLine(""); + } + else if (runs.length <= 10) { + // Multiple runs - use switch statement + let allNames = ""; + const runInfo: Array<{ startOffset: number; endOffset: number; minVal: number; maxVal: number; }> = []; + + for (const run of runs) { + const startOffset = allNames.length; + allNames += run.names.join(""); + const endOffset = allNames.length; + runInfo.push({ + startOffset, + endOffset, + minVal: run.values[0], + maxVal: run.values[run.values.length - 1], + }); + } + + writeLine(`const ${nameConst} = "${allNames}"`); + writeLine(""); + + // Generate index variables for each run + for (let i = 0; i < runs.length; i++) { + write(`var ${indexVar}_${i} = [...]uint16{0`); + let offset = 0; + for (const name of runs[i].names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + } + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tswitch {`); + + for (let i = 0; i < runs.length; i++) { + const run = runs[i]; + const info = runInfo[i]; + + if (run.values.length === 1) { + writeLine(`\tcase e == ${run.values[0]}:`); + writeLine(`\t\treturn ${nameConst}[${info.startOffset}:${info.endOffset}]`); + } + else { + if (info.minVal === 0 && baseType.startsWith("uint")) { + writeLine(`\tcase e <= ${info.maxVal}:`); + } + else if (info.minVal === 0) { + writeLine(`\tcase 0 <= e && e <= ${info.maxVal}:`); + } + else { + writeLine(`\tcase ${info.minVal} <= e && e <= ${info.maxVal}:`); + } + writeLine(`\t\ti := int(e) - ${info.minVal}`); + writeLine(`\t\treturn ${nameConst}[${info.startOffset}+${indexVar}_${i}[i]:${info.startOffset}+${indexVar}_${i}[i+1]]`); + } + } + + writeLine(`\tdefault:`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`}`); + writeLine(""); + } + else { + // Too many runs - use a map + let allNames = ""; + const valueMap: Array<{ value: number; startOffset: number; endOffset: number; }> = []; + + for (const run of runs) { + for (let i = 0; i < run.names.length; i++) { + const startOffset = allNames.length; + allNames += run.names[i]; + const endOffset = allNames.length; + valueMap.push({ value: run.values[i], startOffset, endOffset }); + } + } + + writeLine(`const ${nameConst} = "${allNames}"`); + writeLine(""); + writeLine(`var ${enumeration.name}_map = map[${enumeration.name}]string{`); + for (const entry of valueMap) { + writeLine(`\t${entry.value}: ${nameConst}[${entry.startOffset}:${entry.endOffset}],`); + } + writeLine(`}`); + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tif str, ok := ${enumeration.name}_map[e]; ok {`); + writeLine(`\t\treturn str`); + writeLine(`\t}`); + writeLine(`\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`}`); + writeLine(""); + } + } + } } const requestsAndNotifications: (Request | Notification)[] = [...model.requests, ...model.notifications]; @@ -1365,15 +1571,23 @@ function generateCode() { return parts.join(""); } -function hasTextDocumentURI(structure: Structure) { +function hasSomeProp(structure: Structure, propName: string, propTypeName: string) { return structure.properties?.some(p => !p.optional && - p.name === "textDocument" && + p.name === propName && p.type.kind === "reference" && - p.type.name === "TextDocumentIdentifier" + p.type.name === propTypeName ); } +function hasTextDocumentURI(structure: Structure) { + return hasSomeProp(structure, "textDocument", "TextDocumentIdentifier"); +} + +function hasTextDocumentPosition(structure: Structure) { + return hasSomeProp(structure, "position", "Position"); +} + /** * Main function */ diff --git a/pkg/lsp/lsproto/lsp.go b/pkg/lsp/lsproto/lsp.go index 9ba36997a..63470c847 100644 --- a/pkg/lsp/lsproto/lsp.go +++ b/pkg/lsp/lsproto/lsp.go @@ -61,6 +61,11 @@ type HasTextDocumentURI interface { TextDocumentURI() DocumentUri } +type HasTextDocumentPosition interface { + HasTextDocumentURI + TextDocumentPosition() Position +} + type URI string // !!! type Method string diff --git a/pkg/lsp/lsproto/lsp_generated.go b/pkg/lsp/lsproto/lsp_generated.go index 3c43d47da..8c5585ee6 100644 --- a/pkg/lsp/lsproto/lsp_generated.go +++ b/pkg/lsp/lsproto/lsp_generated.go @@ -33,6 +33,10 @@ func (s *ImplementationParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *ImplementationParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*ImplementationParams)(nil) func (s *ImplementationParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -247,6 +251,10 @@ func (s *TypeDefinitionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *TypeDefinitionParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*TypeDefinitionParams)(nil) func (s *TypeDefinitionParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -1238,6 +1246,10 @@ func (s *DeclarationParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *DeclarationParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*DeclarationParams)(nil) func (s *DeclarationParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -1703,6 +1715,10 @@ func (s *CallHierarchyPrepareParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *CallHierarchyPrepareParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*CallHierarchyPrepareParams)(nil) func (s *CallHierarchyPrepareParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -2951,6 +2967,10 @@ func (s *LinkedEditingRangeParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *LinkedEditingRangeParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*LinkedEditingRangeParams)(nil) func (s *LinkedEditingRangeParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -3423,6 +3443,10 @@ func (s *MonikerParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *MonikerParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*MonikerParams)(nil) func (s *MonikerParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -3651,6 +3675,10 @@ func (s *TypeHierarchyPrepareParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *TypeHierarchyPrepareParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*TypeHierarchyPrepareParams)(nil) func (s *TypeHierarchyPrepareParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -5348,6 +5376,10 @@ func (s *InlineCompletionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *InlineCompletionParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*InlineCompletionParams)(nil) func (s *InlineCompletionParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -7266,6 +7298,10 @@ func (s *CompletionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *CompletionParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*CompletionParams)(nil) func (s *CompletionParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -7829,6 +7865,10 @@ func (s *HoverParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *HoverParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*HoverParams)(nil) func (s *HoverParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -8032,6 +8072,10 @@ func (s *SignatureHelpParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *SignatureHelpParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*SignatureHelpParams)(nil) func (s *SignatureHelpParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -8287,6 +8331,10 @@ func (s *DefinitionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *DefinitionParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*DefinitionParams)(nil) func (s *DefinitionParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -8433,6 +8481,10 @@ func (s *ReferenceParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *ReferenceParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*ReferenceParams)(nil) func (s *ReferenceParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -8586,6 +8638,10 @@ func (s *DocumentHighlightParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *DocumentHighlightParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*DocumentHighlightParams)(nil) func (s *DocumentHighlightParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -10623,6 +10679,10 @@ func (s *DocumentOnTypeFormattingParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *DocumentOnTypeFormattingParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*DocumentOnTypeFormattingParams)(nil) func (s *DocumentOnTypeFormattingParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -10791,6 +10851,10 @@ func (s *RenameParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *RenameParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*RenameParams)(nil) func (s *RenameParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -10944,6 +11008,10 @@ func (s *PrepareRenameParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *PrepareRenameParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*PrepareRenameParams)(nil) func (s *PrepareRenameParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -11755,6 +11823,10 @@ func (s *TextDocumentPositionParams) TextDocumentURI() DocumentUri { return s.TextDocument.Uri } +func (s *TextDocumentPositionParams) TextDocumentPosition() Position { + return s.Position +} + var _ json.UnmarshalerFrom = (*TextDocumentPositionParams)(nil) func (s *TextDocumentPositionParams) UnmarshalJSONFrom(dec *jsontext.Decoder) error { @@ -21755,6 +21827,29 @@ const ( ErrorCodesUnknownErrorCode ErrorCodes = -32001 ) +const _ErrorCodes_name = "ParseErrorInternalErrorInvalidParamsMethodNotFoundInvalidRequestServerNotInitializedUnknownErrorCode" + +var ( + _ErrorCodes_index_0 = [...]uint16{0, 10} + _ErrorCodes_index_1 = [...]uint16{0, 13, 26, 40, 54} + _ErrorCodes_index_2 = [...]uint16{0, 20, 36} +) + +func (e ErrorCodes) String() string { + switch { + case e == -32700: + return _ErrorCodes_name[0:10] + case -32603 <= e && e <= -32600: + i := int(e) - -32603 + return _ErrorCodes_name[10+_ErrorCodes_index_1[i] : 10+_ErrorCodes_index_1[i+1]] + case -32002 <= e && e <= -32001: + i := int(e) - -32002 + return _ErrorCodes_name[64+_ErrorCodes_index_2[i] : 64+_ErrorCodes_index_2[i+1]] + default: + return fmt.Sprintf("ErrorCodes(%d)", e) + } +} + type LSPErrorCodes int32 const ( @@ -21785,6 +21880,18 @@ const ( LSPErrorCodesRequestCancelled LSPErrorCodes = -32800 ) +const _LSPErrorCodes_name = "RequestFailedServerCancelledContentModifiedRequestCancelled" + +var _LSPErrorCodes_index = [...]uint16{0, 13, 28, 43, 59} + +func (e LSPErrorCodes) String() string { + i := int(e) - -32803 + if i < 0 || i >= len(_LSPErrorCodes_index)-1 { + return fmt.Sprintf("LSPErrorCodes(%d)", e) + } + return _LSPErrorCodes_name[_LSPErrorCodes_index[i]:_LSPErrorCodes_index[i+1]] +} + // A set of predefined range kinds. type FoldingRangeKind string @@ -21829,6 +21936,18 @@ const ( SymbolKindTypeParameter SymbolKind = 26 ) +const _SymbolKind_name = "FileModuleNamespacePackageClassMethodPropertyFieldConstructorEnumInterfaceFunctionVariableConstantStringNumberBooleanArrayObjectKeyNullEnumMemberStructEventOperatorTypeParameter" + +var _SymbolKind_index = [...]uint16{0, 4, 10, 19, 26, 31, 37, 45, 50, 61, 65, 74, 82, 90, 98, 104, 110, 117, 122, 128, 131, 135, 145, 151, 156, 164, 177} + +func (e SymbolKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SymbolKind_index)-1 { + return fmt.Sprintf("SymbolKind(%d)", e) + } + return _SymbolKind_name[_SymbolKind_index[i]:_SymbolKind_index[i+1]] +} + // Symbol tags are extra annotations that tweak the rendering of a symbol. // // Since: 3.16 @@ -21839,6 +21958,18 @@ const ( SymbolTagDeprecated SymbolTag = 1 ) +const _SymbolTag_name = "Deprecated" + +var _SymbolTag_index = [...]uint16{0, 10} + +func (e SymbolTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SymbolTag_index)-1 { + return fmt.Sprintf("SymbolTag(%d)", e) + } + return _SymbolTag_name[_SymbolTag_index[i]:_SymbolTag_index[i+1]] +} + // Moniker uniqueness level to define scope of the moniker. // // Since: 3.16.0 @@ -21884,6 +22015,18 @@ const ( InlayHintKindParameter InlayHintKind = 2 ) +const _InlayHintKind_name = "TypeParameter" + +var _InlayHintKind_index = [...]uint16{0, 4, 13} + +func (e InlayHintKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InlayHintKind_index)-1 { + return fmt.Sprintf("InlayHintKind(%d)", e) + } + return _InlayHintKind_name[_InlayHintKind_index[i]:_InlayHintKind_index[i+1]] +} + // The message type type MessageType uint32 @@ -21904,6 +22047,18 @@ const ( MessageTypeDebug MessageType = 5 ) +const _MessageType_name = "ErrorWarningInfoLogDebug" + +var _MessageType_index = [...]uint16{0, 5, 12, 16, 19, 24} + +func (e MessageType) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_MessageType_index)-1 { + return fmt.Sprintf("MessageType(%d)", e) + } + return _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]] +} + // Defines how the host (editor) should sync // document changes to the language server. type TextDocumentSyncKind uint32 @@ -21920,6 +22075,18 @@ const ( TextDocumentSyncKindIncremental TextDocumentSyncKind = 2 ) +const _TextDocumentSyncKind_name = "NoneFullIncremental" + +var _TextDocumentSyncKind_index = [...]uint16{0, 4, 8, 19} + +func (e TextDocumentSyncKind) String() string { + i := int(e) - 0 + if i < 0 || i >= len(_TextDocumentSyncKind_index)-1 { + return fmt.Sprintf("TextDocumentSyncKind(%d)", e) + } + return _TextDocumentSyncKind_name[_TextDocumentSyncKind_index[i]:_TextDocumentSyncKind_index[i+1]] +} + // Represents reasons why a text document is saved. type TextDocumentSaveReason uint32 @@ -21933,6 +22100,18 @@ const ( TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3 ) +const _TextDocumentSaveReason_name = "ManualAfterDelayFocusOut" + +var _TextDocumentSaveReason_index = [...]uint16{0, 6, 16, 24} + +func (e TextDocumentSaveReason) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_TextDocumentSaveReason_index)-1 { + return fmt.Sprintf("TextDocumentSaveReason(%d)", e) + } + return _TextDocumentSaveReason_name[_TextDocumentSaveReason_index[i]:_TextDocumentSaveReason_index[i+1]] +} + // The kind of a completion entry. type CompletionItemKind uint32 @@ -21964,6 +22143,18 @@ const ( CompletionItemKindTypeParameter CompletionItemKind = 25 ) +const _CompletionItemKind_name = "TextMethodFunctionConstructorFieldVariableClassInterfaceModulePropertyUnitValueEnumKeywordSnippetColorFileReferenceFolderEnumMemberConstantStructEventOperatorTypeParameter" + +var _CompletionItemKind_index = [...]uint16{0, 4, 10, 18, 29, 34, 42, 47, 56, 62, 70, 74, 79, 83, 90, 97, 102, 106, 115, 121, 131, 139, 145, 150, 158, 171} + +func (e CompletionItemKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionItemKind_index)-1 { + return fmt.Sprintf("CompletionItemKind(%d)", e) + } + return _CompletionItemKind_name[_CompletionItemKind_index[i]:_CompletionItemKind_index[i+1]] +} + // Completion item tags are extra annotations that tweak the rendering of a completion // item. // @@ -21975,6 +22166,18 @@ const ( CompletionItemTagDeprecated CompletionItemTag = 1 ) +const _CompletionItemTag_name = "Deprecated" + +var _CompletionItemTag_index = [...]uint16{0, 10} + +func (e CompletionItemTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionItemTag_index)-1 { + return fmt.Sprintf("CompletionItemTag(%d)", e) + } + return _CompletionItemTag_name[_CompletionItemTag_index[i]:_CompletionItemTag_index[i+1]] +} + // Defines whether the insert text in a completion item should be interpreted as // plain text or a snippet. type InsertTextFormat uint32 @@ -21993,6 +22196,18 @@ const ( InsertTextFormatSnippet InsertTextFormat = 2 ) +const _InsertTextFormat_name = "PlainTextSnippet" + +var _InsertTextFormat_index = [...]uint16{0, 9, 16} + +func (e InsertTextFormat) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InsertTextFormat_index)-1 { + return fmt.Sprintf("InsertTextFormat(%d)", e) + } + return _InsertTextFormat_name[_InsertTextFormat_index[i]:_InsertTextFormat_index[i+1]] +} + // How whitespace and indentation is handled during completion // item insertion. // @@ -22016,6 +22231,18 @@ const ( InsertTextModeadjustIndentation InsertTextMode = 2 ) +const _InsertTextMode_name = "asIsadjustIndentation" + +var _InsertTextMode_index = [...]uint16{0, 4, 21} + +func (e InsertTextMode) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InsertTextMode_index)-1 { + return fmt.Sprintf("InsertTextMode(%d)", e) + } + return _InsertTextMode_name[_InsertTextMode_index[i]:_InsertTextMode_index[i+1]] +} + // A document highlight kind. type DocumentHighlightKind uint32 @@ -22028,6 +22255,18 @@ const ( DocumentHighlightKindWrite DocumentHighlightKind = 3 ) +const _DocumentHighlightKind_name = "TextReadWrite" + +var _DocumentHighlightKind_index = [...]uint16{0, 4, 8, 13} + +func (e DocumentHighlightKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DocumentHighlightKind_index)-1 { + return fmt.Sprintf("DocumentHighlightKind(%d)", e) + } + return _DocumentHighlightKind_name[_DocumentHighlightKind_index[i]:_DocumentHighlightKind_index[i+1]] +} + // A set of predefined code action kinds type CodeActionKind string @@ -22111,6 +22350,18 @@ const ( CodeActionTagLLMGenerated CodeActionTag = 1 ) +const _CodeActionTag_name = "LLMGenerated" + +var _CodeActionTag_index = [...]uint16{0, 12} + +func (e CodeActionTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CodeActionTag_index)-1 { + return fmt.Sprintf("CodeActionTag(%d)", e) + } + return _CodeActionTag_name[_CodeActionTag_index[i]:_CodeActionTag_index[i+1]] +} + type TraceValue string const ( @@ -22228,6 +22479,18 @@ const ( InlineCompletionTriggerKindAutomatic InlineCompletionTriggerKind = 2 ) +const _InlineCompletionTriggerKind_name = "InvokedAutomatic" + +var _InlineCompletionTriggerKind_index = [...]uint16{0, 7, 16} + +func (e InlineCompletionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InlineCompletionTriggerKind_index)-1 { + return fmt.Sprintf("InlineCompletionTriggerKind(%d)", e) + } + return _InlineCompletionTriggerKind_name[_InlineCompletionTriggerKind_index[i]:_InlineCompletionTriggerKind_index[i+1]] +} + // A set of predefined position encoding kinds. // // Since: 3.17.0 @@ -22261,6 +22524,18 @@ const ( FileChangeTypeDeleted FileChangeType = 3 ) +const _FileChangeType_name = "CreatedChangedDeleted" + +var _FileChangeType_index = [...]uint16{0, 7, 14, 21} + +func (e FileChangeType) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_FileChangeType_index)-1 { + return fmt.Sprintf("FileChangeType(%d)", e) + } + return _FileChangeType_name[_FileChangeType_index[i]:_FileChangeType_index[i+1]] +} + type WatchKind uint32 const ( @@ -22272,6 +22547,30 @@ const ( WatchKindDelete WatchKind = 4 ) +const _WatchKind_name = "CreateChangeDelete" + +var _WatchKind_index = [...]uint16{0, 6, 12, 18} + +func (e WatchKind) String() string { + if e == 0 { + return "0" + } + var parts []string + if e&1 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[0]:_WatchKind_index[1]]) + } + if e&2 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[1]:_WatchKind_index[2]]) + } + if e&4 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[2]:_WatchKind_index[3]]) + } + if len(parts) == 0 { + return fmt.Sprintf("WatchKind(%d)", e) + } + return strings.Join(parts, "|") +} + // The diagnostic's severity. type DiagnosticSeverity uint32 @@ -22286,6 +22585,18 @@ const ( DiagnosticSeverityHint DiagnosticSeverity = 4 ) +const _DiagnosticSeverity_name = "ErrorWarningInformationHint" + +var _DiagnosticSeverity_index = [...]uint16{0, 5, 12, 23, 27} + +func (e DiagnosticSeverity) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DiagnosticSeverity_index)-1 { + return fmt.Sprintf("DiagnosticSeverity(%d)", e) + } + return _DiagnosticSeverity_name[_DiagnosticSeverity_index[i]:_DiagnosticSeverity_index[i+1]] +} + // The diagnostic tags. // // Since: 3.15.0 @@ -22303,6 +22614,18 @@ const ( DiagnosticTagDeprecated DiagnosticTag = 2 ) +const _DiagnosticTag_name = "UnnecessaryDeprecated" + +var _DiagnosticTag_index = [...]uint16{0, 11, 21} + +func (e DiagnosticTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DiagnosticTag_index)-1 { + return fmt.Sprintf("DiagnosticTag(%d)", e) + } + return _DiagnosticTag_name[_DiagnosticTag_index[i]:_DiagnosticTag_index[i+1]] +} + // How a completion was triggered type CompletionTriggerKind uint32 @@ -22317,6 +22640,18 @@ const ( CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3 ) +const _CompletionTriggerKind_name = "InvokedTriggerCharacterTriggerForIncompleteCompletions" + +var _CompletionTriggerKind_index = [...]uint16{0, 7, 23, 54} + +func (e CompletionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionTriggerKind_index)-1 { + return fmt.Sprintf("CompletionTriggerKind(%d)", e) + } + return _CompletionTriggerKind_name[_CompletionTriggerKind_index[i]:_CompletionTriggerKind_index[i+1]] +} + // Defines how values from a set of defaults and an individual item will be // merged. // @@ -22334,6 +22669,18 @@ const ( ApplyKindMerge ApplyKind = 2 ) +const _ApplyKind_name = "ReplaceMerge" + +var _ApplyKind_index = [...]uint16{0, 7, 12} + +func (e ApplyKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_ApplyKind_index)-1 { + return fmt.Sprintf("ApplyKind(%d)", e) + } + return _ApplyKind_name[_ApplyKind_index[i]:_ApplyKind_index[i+1]] +} + // How a signature help was triggered. // // Since: 3.15.0 @@ -22348,6 +22695,18 @@ const ( SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3 ) +const _SignatureHelpTriggerKind_name = "InvokedTriggerCharacterContentChange" + +var _SignatureHelpTriggerKind_index = [...]uint16{0, 7, 23, 36} + +func (e SignatureHelpTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SignatureHelpTriggerKind_index)-1 { + return fmt.Sprintf("SignatureHelpTriggerKind(%d)", e) + } + return _SignatureHelpTriggerKind_name[_SignatureHelpTriggerKind_index[i]:_SignatureHelpTriggerKind_index[i+1]] +} + // The reason why code actions were requested. // // Since: 3.17.0 @@ -22363,6 +22722,18 @@ const ( CodeActionTriggerKindAutomatic CodeActionTriggerKind = 2 ) +const _CodeActionTriggerKind_name = "InvokedAutomatic" + +var _CodeActionTriggerKind_index = [...]uint16{0, 7, 16} + +func (e CodeActionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CodeActionTriggerKind_index)-1 { + return fmt.Sprintf("CodeActionTriggerKind(%d)", e) + } + return _CodeActionTriggerKind_name[_CodeActionTriggerKind_index[i]:_CodeActionTriggerKind_index[i+1]] +} + // A pattern kind describing if a glob pattern matches a file a folder or // both. // @@ -22388,6 +22759,18 @@ const ( NotebookCellKindCode NotebookCellKind = 2 ) +const _NotebookCellKind_name = "MarkupCode" + +var _NotebookCellKind_index = [...]uint16{0, 6, 10} + +func (e NotebookCellKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_NotebookCellKind_index)-1 { + return fmt.Sprintf("NotebookCellKind(%d)", e) + } + return _NotebookCellKind_name[_NotebookCellKind_index[i]:_NotebookCellKind_index[i+1]] +} + type ResourceOperationKind string const ( @@ -22425,6 +22808,18 @@ const ( PrepareSupportDefaultBehaviorIdentifier PrepareSupportDefaultBehavior = 1 ) +const _PrepareSupportDefaultBehavior_name = "Identifier" + +var _PrepareSupportDefaultBehavior_index = [...]uint16{0, 10} + +func (e PrepareSupportDefaultBehavior) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_PrepareSupportDefaultBehavior_index)-1 { + return fmt.Sprintf("PrepareSupportDefaultBehavior(%d)", e) + } + return _PrepareSupportDefaultBehavior_name[_PrepareSupportDefaultBehavior_index[i]:_PrepareSupportDefaultBehavior_index[i+1]] +} + type TokenFormat string const ( diff --git a/pkg/lsp/server.go b/pkg/lsp/server.go index 1c9879d4a..c21f204ff 100644 --- a/pkg/lsp/server.go +++ b/pkg/lsp/server.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "iter" "runtime/debug" "slices" "sync" @@ -12,9 +13,11 @@ import ( "time" "github.com/go-json-experiment/json" + "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/jsonutil" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/ls" "github.com/buke/typescript-go-internal/pkg/ls/lsconv" "github.com/buke/typescript-go-internal/pkg/ls/lsutil" @@ -25,7 +28,6 @@ import ( "github.com/buke/typescript-go-internal/pkg/tspath" "github.com/buke/typescript-go-internal/pkg/vfs" "golang.org/x/sync/errgroup" - "golang.org/x/text/language" ) type ServerOptions struct { @@ -39,17 +41,27 @@ type ServerOptions struct { TypingsLocation string ParseCache *project.ParseCache NpmInstall func(cwd string, args []string) ([]byte, error) + + // Test options + Client project.Client + Logger logging.Logger } func NewServer(opts *ServerOptions) *Server { if opts.Cwd == "" { panic("Cwd is required") } + var logger logging.Logger + if opts.Logger != nil { + logger = opts.Logger + } else { + logger = logging.NewLogger(opts.Err) + } return &Server{ r: opts.In, w: opts.Out, stderr: opts.Err, - logger: logging.NewLogger(opts.Err), + logger: logger, requestQueue: make(chan *lsproto.RequestMessage, 100), outgoingQueue: make(chan *lsproto.Message, 100), pendingClientRequests: make(map[lsproto.ID]pendingClientRequest), @@ -60,6 +72,7 @@ func NewServer(opts *ServerOptions) *Server { typingsLocation: opts.TypingsLocation, parseCache: opts.ParseCache, npmInstall: opts.NpmInstall, + client: opts.Client, } } @@ -147,7 +160,7 @@ type Server struct { initializeParams *lsproto.InitializeParams clientCapabilities lsproto.ResolvedClientCapabilities positionEncoding lsproto.PositionEncodingKind - locale language.Tag + locale locale.Locale watchEnabled bool watcherID atomic.Uint32 @@ -155,6 +168,9 @@ type Server struct { session *project.Session + // Test options for initializing session + client project.Client + // !!! temporary; remove when we have `handleDidChangeConfiguration`/implicit project config support compilerOptionsForInferredProjects *core.CompilerOptions // parseCache can be passed in so separate tests can share ASTs @@ -163,6 +179,8 @@ type Server struct { npmInstall func(cwd string, args []string) ([]byte, error) } +func (s *Server) Session() *project.Session { return s.session } + // WatchFiles implements project.Client. func (s *Server) WatchFiles(ctx context.Context, id project.WatcherID, watchers []*lsproto.FileSystemWatcher) error { _, err := sendClientRequest(ctx, s, lsproto.ClientRegisterCapabilityInfo, &lsproto.RegistrationParams{ @@ -347,7 +365,7 @@ func (s *Server) dispatchLoop(ctx context.Context) error { case <-ctx.Done(): return ctx.Err() case req := <-s.requestQueue: - requestCtx := core.WithLocale(ctx, s.locale) + requestCtx := locale.WithLocale(ctx, s.locale) if req.ID != nil { var cancel context.CancelFunc requestCtx, cancel = context.WithCancel(core.WithRequestID(requestCtx, req.ID.String())) @@ -489,18 +507,20 @@ var handlers = sync.OnceValue(func() handlerMap { registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentDefinitionInfo, (*Server).handleDefinition) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentTypeDefinitionInfo, (*Server).handleTypeDefinition) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentCompletionInfo, (*Server).handleCompletion) - registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentReferencesInfo, (*Server).handleReferences) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentImplementationInfo, (*Server).handleImplementations) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentSignatureHelpInfo, (*Server).handleSignatureHelp) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentFormattingInfo, (*Server).handleDocumentFormat) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentRangeFormattingInfo, (*Server).handleDocumentRangeFormat) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentOnTypeFormattingInfo, (*Server).handleDocumentOnTypeFormat) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentDocumentSymbolInfo, (*Server).handleDocumentSymbol) - registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentRenameInfo, (*Server).handleRename) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentDocumentHighlightInfo, (*Server).handleDocumentHighlight) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentSelectionRangeInfo, (*Server).handleSelectionRange) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentInlayHintInfo, (*Server).handleInlayHint) registerLanguageServiceDocumentRequestHandler(handlers, lsproto.TextDocumentCodeActionInfo, (*Server).handleCodeAction) + + registerMultiProjectReferenceRequestHandler(handlers, lsproto.TextDocumentReferencesInfo, (*Server).handleReferences, combineReferences) + registerMultiProjectReferenceRequestHandler(handlers, lsproto.TextDocumentRenameInfo, (*Server).handleRename, combineRenameResponse) + registerRequestHandler(handlers, lsproto.WorkspaceSymbolInfo, (*Server).handleWorkspaceSymbol) registerRequestHandler(handlers, lsproto.CompletionItemResolveInfo, (*Server).handleCompletionItemResolve) @@ -576,6 +596,243 @@ func registerLanguageServiceDocumentRequestHandler[Req lsproto.HasTextDocumentUR } } +type projectAndTextDocumentPosition struct { + project *project.Project + ls *ls.LanguageService + Uri lsproto.DocumentUri + Position lsproto.Position + forOriginalLocation bool +} + +type response[Resp any] struct { + complete bool + result Resp + forOriginalLocation bool +} + +func registerMultiProjectReferenceRequestHandler[Req lsproto.HasTextDocumentPosition, Resp any]( + handlers handlerMap, + info lsproto.RequestInfo[Req, Resp], + fn func(*Server, context.Context, *ls.LanguageService, Req, *ast.Node, []*ls.SymbolAndEntries) (Resp, error), + combineResults func(iter.Seq[Resp]) Resp, +) { + handlers[info.Method] = func(s *Server, ctx context.Context, req *lsproto.RequestMessage) error { + var params Req + // Ignore empty params. + if req.Params != nil { + params = req.Params.(Req) + } + // !!! sheetal: multiple projects that contain the file through symlinks + defaultProject, defaultLs, allProjects, err := s.session.GetLanguageServiceAndProjectsForFile(ctx, params.TextDocumentURI()) + if err != nil { + return err + } + defer s.recover(req) + + var results collections.SyncMap[tspath.Path, *response[Resp]] + var defaultDefinition *ls.NonLocalDefinition + canSearchProject := func(project *project.Project) bool { + _, searched := results.Load(project.Id()) + return !searched + } + wg := core.NewWorkGroup(false) + var errMu sync.Mutex + var enqueueItem func(item projectAndTextDocumentPosition) + enqueueItem = func(item projectAndTextDocumentPosition) { + var response response[Resp] + if _, loaded := results.LoadOrStore(item.project.Id(), &response); loaded { + return + } + wg.Queue(func() { + if ctx.Err() != nil { + return + } + defer s.recover(req) + // Process the item + ls := item.ls + if ls == nil { + // Get it now + ls = s.session.GetLanguageServiceForProjectWithFile(ctx, item.project, item.Uri) + if ls == nil { + return + } + } + originalNode, symbolsAndEntries, ok := ls.ProvideSymbolsAndEntries(ctx, item.Uri, item.Position, info.Method == lsproto.MethodTextDocumentRename) + if ok { + for _, entry := range symbolsAndEntries { + // Find the default definition that can be in another project + // Later we will use this load ancestor tree that references this location and expand search + if item.project == defaultProject && defaultDefinition == nil { + defaultDefinition = ls.GetNonLocalDefinition(ctx, entry) + } + ls.ForEachOriginalDefinitionLocation(ctx, entry, func(uri lsproto.DocumentUri, position lsproto.Position) { + // Get default configured project for this file + defProjects, errProjects := s.session.GetProjectsForFile(ctx, uri) + if errProjects != nil { + return + } + for _, defProject := range defProjects { + // Optimization: don't enqueue if will be discarded + if canSearchProject(defProject) { + enqueueItem(projectAndTextDocumentPosition{ + project: defProject, + Uri: uri, + Position: position, + forOriginalLocation: true, + }) + } + } + }) + } + } + + if result, errSearch := fn(s, ctx, ls, params, originalNode, symbolsAndEntries); errSearch == nil { + response.complete = true + response.result = result + response.forOriginalLocation = item.forOriginalLocation + } else { + errMu.Lock() + defer errMu.Unlock() + if err != nil { + err = errSearch + } + } + }) + } + + // Initial set of projects and locations in the queue, starting with default project + enqueueItem(projectAndTextDocumentPosition{ + project: defaultProject, + ls: defaultLs, + Uri: params.TextDocumentURI(), + Position: params.TextDocumentPosition(), + }) + for _, project := range allProjects { + if project != defaultProject { + enqueueItem(projectAndTextDocumentPosition{ + project: project, + // TODO!! symlinks need to change the URI + Uri: params.TextDocumentURI(), + Position: params.TextDocumentPosition(), + }) + } + } + + getResultsIterator := func() iter.Seq[Resp] { + return func(yield func(Resp) bool) { + var seenProjects collections.SyncSet[tspath.Path] + if response, loaded := results.Load(defaultProject.Id()); loaded && response.complete { + if !yield(response.result) { + return + } + } + seenProjects.Add(defaultProject.Id()) + for _, project := range allProjects { + if seenProjects.AddIfAbsent(project.Id()) { + if response, loaded := results.Load(project.Id()); loaded && response.complete { + if !yield(response.result) { + return + } + } + } + } + // Prefer the searches from locations for default definition + results.Range(func(key tspath.Path, response *response[Resp]) bool { + if !response.forOriginalLocation && seenProjects.AddIfAbsent(key) && response.complete { + return yield(response.result) + } + return true + }) + // Then the searches from original locations + results.Range(func(key tspath.Path, response *response[Resp]) bool { + if response.forOriginalLocation && seenProjects.AddIfAbsent(key) && response.complete { + return yield(response.result) + } + return true + }) + } + } + + // Outer loop - to complete work if more is added after completing existing queue + for { + // Process existing known projects first + wg.RunAndWait() + if ctx.Err() != nil { + return ctx.Err() + } + // No need to use mu here since we are not in parallel at this point + if err != nil { + return err + } + + wg = core.NewWorkGroup(false) + hasMoreWork := false + if defaultDefinition != nil { + requestedProjectTrees := make(map[tspath.Path]struct{}) + results.Range(func(key tspath.Path, response *response[Resp]) bool { + if response.complete { + requestedProjectTrees[key] = struct{}{} + } + return true + }) + + // Load more projects based on default definition found + for _, loadedProject := range s.session.GetSnapshotLoadingProjectTree(ctx, requestedProjectTrees).ProjectCollection.Projects() { + if ctx.Err() != nil { + return ctx.Err() + } + + // Can loop forever without this (enqueue here, dequeue above, repeat) + if !canSearchProject(loadedProject) || loadedProject.GetProgram() == nil { + continue + } + + // Enqueue the project and location for further processing + if loadedProject.HasFile(defaultDefinition.TextDocumentURI().FileName()) { + enqueueItem(projectAndTextDocumentPosition{ + project: loadedProject, + Uri: defaultDefinition.TextDocumentURI(), + Position: defaultDefinition.TextDocumentPosition(), + }) + hasMoreWork = true + } else if sourcePos := defaultDefinition.GetSourcePosition(); sourcePos != nil && loadedProject.HasFile(sourcePos.TextDocumentURI().FileName()) { + enqueueItem(projectAndTextDocumentPosition{ + project: loadedProject, + Uri: sourcePos.TextDocumentURI(), + Position: sourcePos.TextDocumentPosition(), + }) + hasMoreWork = true + } else if generatedPos := defaultDefinition.GetGeneratedPosition(); generatedPos != nil && loadedProject.HasFile(generatedPos.TextDocumentURI().FileName()) { + enqueueItem(projectAndTextDocumentPosition{ + project: loadedProject, + Uri: generatedPos.TextDocumentURI(), + Position: generatedPos.TextDocumentPosition(), + }) + hasMoreWork = true + } + } + } + if !hasMoreWork { + break + } + } + + var resp Resp + if results.Size() > 1 { + resp = combineResults(getResultsIterator()) + } else { + // Single result, return that directly + for value := range getResultsIterator() { + resp = value + break + } + } + + s.sendResult(req.ID, resp) + return nil + } +} + func (s *Server) recover(req *lsproto.RequestMessage) { if r := recover(); r != nil { stack := debug.Stack() @@ -609,11 +866,7 @@ func (s *Server) handleInitialize(ctx context.Context, params *lsproto.Initializ } if s.initializeParams.Locale != nil { - locale, err := language.Parse(*s.initializeParams.Locale) - if err != nil { - return nil, err - } - s.locale = locale + s.locale, _ = locale.Parse(*s.initializeParams.Locale) } if s.initializeParams.Trace != nil && *s.initializeParams.Trace == "verbose" { @@ -742,6 +995,7 @@ func (s *Server) handleInitialized(ctx context.Context, params *lsproto.Initiali LoggingEnabled: true, DebounceDelay: 500 * time.Millisecond, PushDiagnosticsEnabled: !disablePushDiagnostics, + Locale: s.locale, }, FS: s.fs, Logger: s.logger, @@ -875,9 +1129,25 @@ func (s *Server) handleTypeDefinition(ctx context.Context, ls *ls.LanguageServic return ls.ProvideTypeDefinition(ctx, params.TextDocument.Uri, params.Position) } -func (s *Server) handleReferences(ctx context.Context, ls *ls.LanguageService, params *lsproto.ReferenceParams) (lsproto.ReferencesResponse, error) { +func (s *Server) handleReferences(ctx context.Context, ls *ls.LanguageService, params *lsproto.ReferenceParams, originalNode *ast.Node, symbolAndEntries []*ls.SymbolAndEntries) (lsproto.ReferencesResponse, error) { // findAllReferences - return ls.ProvideReferences(ctx, params) + return ls.ProvideReferencesFromSymbolAndEntries(ctx, params, originalNode, symbolAndEntries) +} + +func combineReferences(results iter.Seq[lsproto.ReferencesResponse]) lsproto.ReferencesResponse { + var combined []lsproto.Location + var seenLocations collections.Set[lsproto.Location] + for resp := range results { + if resp.Locations != nil { + for _, loc := range *resp.Locations { + if !seenLocations.Has(loc) { + seenLocations.Add(loc) + combined = append(combined, loc) + } + } + } + } + return lsproto.LocationsOrNull{Locations: &combined} } func (s *Server) handleImplementations(ctx context.Context, ls *ls.LanguageService, params *lsproto.ImplementationParams) (lsproto.ImplementationResponse, error) { @@ -936,19 +1206,63 @@ func (s *Server) handleDocumentOnTypeFormat(ctx context.Context, ls *ls.Language } func (s *Server) handleWorkspaceSymbol(ctx context.Context, params *lsproto.WorkspaceSymbolParams, reqMsg *lsproto.RequestMessage) (lsproto.WorkspaceSymbolResponse, error) { - snapshot, release := s.session.Snapshot() - defer release() + snapshot := s.session.GetSnapshotLoadingProjectTree(ctx, nil) defer s.recover(reqMsg) + programs := core.Map(snapshot.ProjectCollection.Projects(), (*project.Project).GetProgram) - return ls.ProvideWorkspaceSymbols(ctx, programs, snapshot.Converters(), params.Query) + return ls.ProvideWorkspaceSymbols( + ctx, + programs, + snapshot.Converters(), + snapshot.UserPreferences(), + params.Query) } func (s *Server) handleDocumentSymbol(ctx context.Context, ls *ls.LanguageService, params *lsproto.DocumentSymbolParams) (lsproto.DocumentSymbolResponse, error) { return ls.ProvideDocumentSymbols(ctx, params.TextDocument.Uri) } -func (s *Server) handleRename(ctx context.Context, ls *ls.LanguageService, params *lsproto.RenameParams) (lsproto.RenameResponse, error) { - return ls.ProvideRename(ctx, params) +func (s *Server) handleRename(ctx context.Context, ls *ls.LanguageService, params *lsproto.RenameParams, originalNode *ast.Node, symbolAndEntries []*ls.SymbolAndEntries) (lsproto.RenameResponse, error) { + return ls.ProvideRenameFromSymbolAndEntries(ctx, params, originalNode, symbolAndEntries) +} + +func combineRenameResponse(results iter.Seq[lsproto.RenameResponse]) lsproto.RenameResponse { + combined := make(map[lsproto.DocumentUri][]*lsproto.TextEdit) + seenChanges := make(map[lsproto.DocumentUri]*collections.Set[lsproto.Range]) + // !!! this is not used any more so we will skip this part of deduplication and combining + // DocumentChanges *[]TextDocumentEditOrCreateFileOrRenameFileOrDeleteFile `json:"documentChanges,omitzero"` + // ChangeAnnotations *map[string]*ChangeAnnotation `json:"changeAnnotations,omitzero"` + + for resp := range results { + if resp.WorkspaceEdit != nil && resp.WorkspaceEdit.Changes != nil { + for doc, changes := range *resp.WorkspaceEdit.Changes { + seenSet, ok := seenChanges[doc] + if !ok { + seenSet = &collections.Set[lsproto.Range]{} + seenChanges[doc] = seenSet + } + changesForDoc, exists := combined[doc] + if !exists { + changesForDoc = []*lsproto.TextEdit{} + } + for _, change := range changes { + if !seenSet.Has(change.Range) { + seenSet.Add(change.Range) + changesForDoc = append(changesForDoc, change) + } + } + combined[doc] = changesForDoc + } + } + } + if len(combined) > 0 { + return lsproto.RenameResponse{ + WorkspaceEdit: &lsproto.WorkspaceEdit{ + Changes: &combined, + }, + } + } + return lsproto.RenameResponse{} } func (s *Server) handleDocumentHighlight(ctx context.Context, ls *ls.LanguageService, params *lsproto.DocumentHighlightParams) (lsproto.DocumentHighlightResponse, error) { diff --git a/pkg/module/resolver.go b/pkg/module/resolver.go index a7d00ffc8..5c88f2add 100644 --- a/pkg/module/resolver.go +++ b/pkg/module/resolver.go @@ -42,16 +42,21 @@ func unresolved() *resolved { type resolutionKindSpecificLoader = func(extensions extensions, candidate string, onlyRecordFailures bool) *resolved type tracer struct { - traces []string + traces []DiagAndArgs } -func (t *tracer) write(msg string) { +type DiagAndArgs struct { + Message *diagnostics.Message + Args []any +} + +func (t *tracer) write(diag *diagnostics.Message, args ...any) { if t != nil { - t.traces = append(t.traces, msg) + t.traces = append(t.traces, DiagAndArgs{Message: diag, Args: args}) } } -func (t *tracer) getTraces() []string { +func (t *tracer) getTraces() []DiagAndArgs { if t != nil { return t.traces } @@ -192,7 +197,7 @@ func (r *Resolver) GetPackageJsonScopeIfApplicable(path string) *packagejson.Inf func (r *tracer) traceResolutionUsingProjectReference(redirectedReference ResolvedProjectReference) { if redirectedReference != nil && redirectedReference.CompilerOptions() != nil { - r.write(diagnostics.Using_compiler_options_of_project_reference_redirect_0.Format(redirectedReference.ConfigName())) + r.write(diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.ConfigName()) } } @@ -201,7 +206,7 @@ func (r *Resolver) ResolveTypeReferenceDirective( containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference, -) (*ResolvedTypeReferenceDirective, []string) { +) (*ResolvedTypeReferenceDirective, []DiagAndArgs) { traceBuilder := r.newTraceBuilder() compilerOptions := GetCompilerOptionsWithRedirect(r.compilerOptions, redirectedReference) @@ -209,7 +214,7 @@ func (r *Resolver) ResolveTypeReferenceDirective( typeRoots, fromConfig := compilerOptions.GetEffectiveTypeRoots(r.host.GetCurrentDirectory()) if traceBuilder != nil { - traceBuilder.write(diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2.Format(typeReferenceDirectiveName, containingFile, strings.Join(typeRoots, ","))) + traceBuilder.write(diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, strings.Join(typeRoots, ",")) traceBuilder.traceResolutionUsingProjectReference(redirectedReference) } @@ -222,11 +227,11 @@ func (r *Resolver) ResolveTypeReferenceDirective( return result, traceBuilder.getTraces() } -func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference) (*ResolvedModule, []string) { +func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, resolutionMode core.ResolutionMode, redirectedReference ResolvedProjectReference) (*ResolvedModule, []DiagAndArgs) { traceBuilder := r.newTraceBuilder() compilerOptions := GetCompilerOptionsWithRedirect(r.compilerOptions, redirectedReference) if traceBuilder != nil { - traceBuilder.write(diagnostics.Resolving_module_0_from_1.Format(moduleName, containingFile)) + traceBuilder.write(diagnostics.Resolving_module_0_from_1, moduleName, containingFile) traceBuilder.traceResolutionUsingProjectReference(redirectedReference) } containingDirectory := tspath.GetDirectoryPath(containingFile) @@ -234,11 +239,11 @@ func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, r moduleResolution := compilerOptions.GetModuleResolutionKind() if compilerOptions.ModuleResolution != moduleResolution { if traceBuilder != nil { - traceBuilder.write(diagnostics.Module_resolution_kind_is_not_specified_using_0.Format(moduleResolution.String())) + traceBuilder.write(diagnostics.Module_resolution_kind_is_not_specified_using_0, moduleResolution.String()) } } else { if traceBuilder != nil { - traceBuilder.write(diagnostics.Explicitly_specified_module_resolution_kind_Colon_0.Format(moduleResolution.String())) + traceBuilder.write(diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, moduleResolution.String()) } } @@ -254,12 +259,12 @@ func (r *Resolver) ResolveModuleName(moduleName string, containingFile string, r if traceBuilder != nil { if result.IsResolved() { if result.PackageId.Name != "" { - traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2.Format(moduleName, result.ResolvedFileName, result.PackageId.String())) + traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName, result.ResolvedFileName, result.PackageId.String()) } else { - traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1.Format(moduleName, result.ResolvedFileName)) + traceBuilder.write(diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.ResolvedFileName) } } else { - traceBuilder.write(diagnostics.Module_name_0_was_not_resolved.Format(moduleName)) + traceBuilder.write(diagnostics.Module_name_0_was_not_resolved, moduleName) } } @@ -284,7 +289,7 @@ func (r *Resolver) tryResolveFromTypingsLocation(moduleName string, containingDi traceBuilder, ) if traceBuilder != nil { - traceBuilder.write(diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2.Format(r.projectName, moduleName, r.typingsLocation)) + traceBuilder.write(diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, r.projectName, moduleName, r.typingsLocation) } globalResolved := state.loadModuleFromImmediateNodeModulesDirectory(extensionsDeclaration, r.typingsLocation, false) if globalResolved == nil { @@ -307,20 +312,20 @@ func (r *Resolver) resolveConfig(moduleName string, containingFile string) *Reso func (r *tracer) traceTypeReferenceDirectiveResult(typeReferenceDirectiveName string, result *ResolvedTypeReferenceDirective) { if !result.IsResolved() { - r.write(diagnostics.Type_reference_directive_0_was_not_resolved.Format(typeReferenceDirectiveName)) + r.write(diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName) } else if result.PackageId.Name != "" { - r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3.Format( + r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result.ResolvedFileName, result.PackageId.String(), result.Primary, - )) + ) } else { - r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2.Format( + r.write(diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result.ResolvedFileName, result.Primary, - )) + ) } } @@ -328,13 +333,13 @@ func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, from // Primary lookup if len(typeRoots) > 0 { if r.tracer != nil { - r.tracer.write(diagnostics.Resolving_with_primary_search_path_0.Format(strings.Join(typeRoots, ", "))) + r.tracer.write(diagnostics.Resolving_with_primary_search_path_0, strings.Join(typeRoots, ", ")) } for _, typeRoot := range typeRoots { candidate := r.getCandidateFromTypeRoot(typeRoot) directoryExists := r.resolver.host.FS().DirectoryExists(candidate) if !directoryExists && r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(typeRoot)) + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot) } if fromConfig { // Custom typeRoots resolve as file or directory just like we do modules @@ -351,14 +356,14 @@ func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, from } } } else if r.tracer != nil { - r.tracer.write(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths.Format()) + r.tracer.write(diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths) } // Secondary lookup var resolved *resolved if !fromConfig || !fromInferredTypesContainingFile { if r.tracer != nil { - r.tracer.write(diagnostics.Looking_up_in_node_modules_folder_initial_location_0.Format(r.containingDirectory)) + r.tracer.write(diagnostics.Looking_up_in_node_modules_folder_initial_location_0, r.containingDirectory) } if !tspath.IsExternalModuleNameRelative(r.name) { resolved = r.loadModuleFromNearestNodeModulesDirectory(false /*typesScopeOnly*/) @@ -367,7 +372,7 @@ func (r *resolutionState) resolveTypeReferenceDirective(typeRoots []string, from resolved = r.nodeLoadModuleByRelativeName(extensionsDeclaration, candidate, false /*onlyRecordFailures*/, true /*considerPackageJson*/) } } else if r.tracer != nil { - r.tracer.write(diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder.Format()) + r.tracer.write(diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder) } return r.createResolvedTypeReferenceDirective(resolved, false /*primary*/) } @@ -383,7 +388,7 @@ func (r *resolutionState) getCandidateFromTypeRoot(typeRoot string) string { func (r *resolutionState) mangleScopedPackageName(name string) string { mangled := MangleScopedPackageName(name) if r.tracer != nil && mangled != name { - r.tracer.write(diagnostics.Scoped_package_detected_looking_in_0.Format(mangled)) + r.tracer.write(diagnostics.Scoped_package_detected_looking_in_0, mangled) } return mangled } @@ -406,9 +411,9 @@ func (r *resolutionState) resolveNodeLike() *ResolvedModule { if r.tracer != nil { conditions := strings.Join(core.Map(r.conditions, func(c string) string { return `'` + c + `'` }), ", ") if r.esmMode { - r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("ESM", conditions)) + r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1, "ESM", conditions) } else { - r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1.Format("CJS", conditions)) + r.tracer.write(diagnostics.Resolving_in_0_mode_with_conditions_1, "CJS", conditions) } } result := r.resolveNodeLikeWorker() @@ -422,7 +427,7 @@ func (r *resolutionState) resolveNodeLike() *ResolvedModule { !extensionIsOk(extensionsTypeScript|extensionsDeclaration, result.Extension) && slices.Contains(r.conditions, "import") { if r.tracer != nil { - r.tracer.write(diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update.Format()) + r.tracer.write(diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update) } r.features = r.features & ^NodeResolutionFeaturesExports r.extensions = r.extensions & (extensionsTypeScript | extensionsDeclaration) @@ -453,12 +458,12 @@ func (r *resolutionState) resolveNodeLikeWorker() *ResolvedModule { } if strings.Contains(r.name, ":") { if r.tracer != nil { - r.tracer.write(diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1.Format(r.name, r.extensions.String())) + r.tracer.write(diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, r.name, r.extensions.String()) } return r.createResolvedModule(nil, false) } if r.tracer != nil { - r.tracer.write(diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1.Format(r.name, r.extensions.String())) + r.tracer.write(diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, r.name, r.extensions.String()) } if resolved := r.loadModuleFromNearestNodeModulesDirectory(false /*typesScopeOnly*/); !resolved.shouldContinueSearching() { return r.createResolvedModuleHandlingSymlink(resolved) @@ -530,7 +535,7 @@ func (r *resolutionState) loadModuleFromSelfNameReference() *resolved { func (r *resolutionState) loadModuleFromImports() *resolved { if r.name == "#" || strings.HasPrefix(r.name, "#/") { if r.tracer != nil { - r.tracer.write(diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions.Format(r.name)) + r.tracer.write(diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, r.name) } return continueSearching() } @@ -538,7 +543,7 @@ func (r *resolutionState) loadModuleFromImports() *resolved { scope := r.getPackageScopeForPath(directoryPath) if !scope.Exists() { if r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve.Format(directoryPath)) + r.tracer.write(diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath) } return continueSearching() } @@ -546,7 +551,7 @@ func (r *resolutionState) loadModuleFromImports() *resolved { // !!! Old compiler only checks for undefined, but then assumes `imports` is an object if present. // Maybe should have a new diagnostic for imports of an invalid type. Also, array should be handled? if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_no_imports_defined.Format(scope.PackageDirectory)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_no_imports_defined, scope.PackageDirectory) } return continueSearching() } @@ -556,7 +561,7 @@ func (r *resolutionState) loadModuleFromImports() *resolved { } if r.tracer != nil { - r.tracer.write(diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(r.name, scope.PackageDirectory)) + r.tracer.write(diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, r.name, scope.PackageDirectory) } return continueSearching() } @@ -589,7 +594,7 @@ func (r *resolutionState) loadModuleFromExports(packageInfo *packagejson.InfoCac } if r.tracer != nil { - r.tracer.write(diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1.Format(subpath, packageInfo.PackageDirectory)) + r.tracer.write(diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, packageInfo.PackageDirectory) } return continueSearching() } @@ -641,7 +646,7 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio targetString, _ := target.Value.(string) if !isPattern && len(subpath) > 0 && !strings.HasSuffix(targetString, "/") { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -652,8 +657,8 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio combinedLookup = strings.ReplaceAll(targetString, "*", subpath) } if r.tracer != nil { - r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2.Format("imports", key, combinedLookup)) - r.tracer.write(diagnostics.Resolving_module_0_from_1.Format(combinedLookup, scope.PackageDirectory+"/")) + r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup) + r.tracer.write(diagnostics.Resolving_module_0_from_1, combinedLookup, scope.PackageDirectory+"/") } name, containingDirectory := r.name, r.containingDirectory r.name, r.containingDirectory = combinedLookup, scope.PackageDirectory+"/" @@ -672,7 +677,7 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio return continueSearching() } if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -685,7 +690,7 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio partsAfterFirst := parts[1:] if slices.Contains(partsAfterFirst, "..") || slices.Contains(partsAfterFirst, ".") || slices.Contains(partsAfterFirst, "node_modules") { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -695,7 +700,7 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio subpathParts := tspath.GetPathComponents(subpath, "") if slices.Contains(subpathParts, "..") || slices.Contains(subpathParts, ".") || slices.Contains(subpathParts, "node_modules") { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -707,7 +712,7 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio } else { messageTarget = targetString + subpath } - r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2.Format(core.IfElse(isImports, "imports", "exports"), key, messageTarget)) + r.tracer.write(diagnostics.Using_0_subpath_1_with_target_2, core.IfElse(isImports, "imports", "exports"), key, messageTarget) } var finalPath string if isPattern { @@ -726,39 +731,39 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio case packagejson.JSONValueTypeObject: if r.tracer != nil { - r.tracer.write(diagnostics.Entering_conditional_exports.Format()) + r.tracer.write(diagnostics.Entering_conditional_exports) } for condition := range target.AsObject().Keys() { if r.conditionMatches(condition) { if r.tracer != nil { - r.tracer.write(diagnostics.Matched_0_condition_1.Format(core.IfElse(isImports, "imports", "exports"), condition)) + r.tracer.write(diagnostics.Matched_0_condition_1, core.IfElse(isImports, "imports", "exports"), condition) } subTarget, _ := target.AsObject().Get(condition) if result := r.loadModuleFromTargetExportOrImport(extensions, moduleName, scope, isImports, subTarget, subpath, isPattern, key); !result.shouldContinueSearching() { if r.tracer != nil { - r.tracer.write(diagnostics.Resolved_under_condition_0.Format(condition)) + r.tracer.write(diagnostics.Resolved_under_condition_0, condition) } if r.tracer != nil { - r.tracer.write(diagnostics.Exiting_conditional_exports.Format()) + r.tracer.write(diagnostics.Exiting_conditional_exports) } return result } else if r.tracer != nil { - r.tracer.write(diagnostics.Failed_to_resolve_under_condition_0.Format(condition)) + r.tracer.write(diagnostics.Failed_to_resolve_under_condition_0, condition) } } else { if r.tracer != nil { - r.tracer.write(diagnostics.Saw_non_matching_condition_0.Format(condition)) + r.tracer.write(diagnostics.Saw_non_matching_condition_0, condition) } } } if r.tracer != nil { - r.tracer.write(diagnostics.Exiting_conditional_exports.Format()) + r.tracer.write(diagnostics.Exiting_conditional_exports) } return continueSearching() case packagejson.JSONValueTypeArray: if len(target.AsArray()) == 0 { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -770,13 +775,13 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio case packagejson.JSONValueTypeNull: if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_explicitly_maps_specifier_1_to_null.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.PackageDirectory, moduleName) } return continueSearching() } if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1.Format(scope.PackageDirectory, moduleName)) + r.tracer.write(diagnostics.X_package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.PackageDirectory, moduleName) } return continueSearching() } @@ -896,7 +901,7 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn // (1) if priorityExtensions != 0 { if r.tracer != nil { - r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0.Format(priorityExtensions.String())) + r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, priorityExtensions.String()) } if result := r.loadModuleFromNearestNodeModulesDirectoryWorker(priorityExtensions, mode, typesScopeOnly); !result.shouldContinueSearching() { return result @@ -905,7 +910,7 @@ func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOn // (2) if secondaryExtensions != 0 && !typesScopeOnly { if r.tracer != nil { - r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0.Format(secondaryExtensions.String())) + r.tracer.write(diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, secondaryExtensions.String()) } return r.loadModuleFromNearestNodeModulesDirectoryWorker(secondaryExtensions, mode, typesScopeOnly) } @@ -931,7 +936,7 @@ func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions nodeModulesFolder := tspath.CombinePaths(directory, "node_modules") nodeModulesFolderExists := r.resolver.host.FS().DirectoryExists(nodeModulesFolder) if !nodeModulesFolderExists && r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesFolder)) + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder) } if !typesScopeOnly { @@ -944,7 +949,7 @@ func (r *resolutionState) loadModuleFromImmediateNodeModulesDirectory(extensions nodeModulesAtTypes := tspath.CombinePaths(nodeModulesFolder, "@types") nodeModulesAtTypesExists := nodeModulesFolderExists && r.resolver.host.FS().DirectoryExists(nodeModulesAtTypes) if !nodeModulesAtTypesExists && r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(nodeModulesAtTypes)) + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes) } return r.loadModuleFromSpecificNodeModulesDirectory(extensionsDeclaration, r.mangleScopedPackageName(r.name), nodeModulesAtTypes, nodeModulesAtTypesExists) } @@ -1021,7 +1026,7 @@ func (r *resolutionState) loadModuleFromSpecificNodeModulesDirectory(ext extensi versionPaths := packageInfo.Contents.GetVersionPaths(r.getTraceFunc()) if versionPaths.Exists() { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), rest)) + r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.Version, core.Version(), rest) } packageDirectoryExists := nodeModulesDirectoryExists && r.resolver.host.FS().DirectoryExists(packageDirectory) pathPatterns := TryParsePatterns(versionPaths.GetPaths()) @@ -1136,7 +1141,7 @@ func (r *resolutionState) getParsedPatternsForPaths() *ParsedPatterns { func (r *resolutionState) tryLoadModuleUsingPathsIfEligible() *resolved { if r.compilerOptions.Paths.Size() > 0 && !tspath.PathIsRelative(r.name) { if r.tracer != nil { - r.tracer.write(diagnostics.X_paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0.Format(r.name)) + r.tracer.write(diagnostics.X_paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, r.name) } } else { return continueSearching() @@ -1160,13 +1165,13 @@ func (r *resolutionState) tryLoadModuleUsingPaths(extensions extensions, moduleN if matchedPattern := MatchPatternOrExact(pathPatterns, moduleName); matchedPattern.IsValid() { matchedStar := matchedPattern.MatchedText(moduleName) if r.tracer != nil { - r.tracer.write(diagnostics.Module_name_0_matched_pattern_1.Format(moduleName, matchedPattern.Text)) + r.tracer.write(diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPattern.Text) } for _, subst := range paths.GetOrZero(matchedPattern.Text) { path := strings.Replace(subst, "*", matchedStar, 1) candidate := tspath.NormalizePath(tspath.CombinePaths(containingDirectory, path)) if r.tracer != nil { - r.tracer.write(diagnostics.Trying_substitution_0_candidate_module_location_Colon_1.Format(subst, path)) + r.tracer.write(diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path) } // A path mapping may have an extension if extension := tspath.TryGetExtensionFromPath(subst); extension != "" { @@ -1191,7 +1196,7 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { } if r.tracer != nil { - r.tracer.write(diagnostics.X_rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0.Format(r.name)) + r.tracer.write(diagnostics.X_rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, r.name) } candidate := tspath.NormalizePath(tspath.CombinePaths(r.containingDirectory, r.name)) @@ -1210,7 +1215,7 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { (matchedNormalizedPrefix == "" || len(matchedNormalizedPrefix) < len(normalizedRoot)) if r.tracer != nil { - r.tracer.write(diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2.Format(normalizedRoot, candidate, isLongestMatchingPrefix)) + r.tracer.write(diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix) } if isLongestMatchingPrefix { @@ -1221,13 +1226,13 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { if matchedNormalizedPrefix != "" { if r.tracer != nil { - r.tracer.write(diagnostics.Longest_matching_prefix_for_0_is_1.Format(candidate, matchedNormalizedPrefix)) + r.tracer.write(diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix) } suffix := candidate[len(matchedNormalizedPrefix):] // first - try to load from a initial location if r.tracer != nil { - r.tracer.write(diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2.Format(suffix, matchedNormalizedPrefix, candidate)) + r.tracer.write(diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate) } loader := func(extensions extensions, candidate string, onlyRecordFailures bool) *resolved { return r.nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, true /*considerPackageJson*/) @@ -1237,7 +1242,7 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { } if r.tracer != nil { - r.tracer.write(diagnostics.Trying_other_entries_in_rootDirs.Format()) + r.tracer.write(diagnostics.Trying_other_entries_in_rootDirs) } // then try to resolve using remaining entries in rootDirs for _, rootDir := range r.compilerOptions.RootDirs { @@ -1247,7 +1252,7 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { } candidate := tspath.CombinePaths(tspath.NormalizePath(rootDir), suffix) if r.tracer != nil { - r.tracer.write(diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2.Format(suffix, rootDir, candidate)) + r.tracer.write(diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate) } baseDirectory := tspath.GetDirectoryPath(candidate) if resolvedFileName := loader(r.extensions, candidate, !r.resolver.host.FS().DirectoryExists(baseDirectory)); !resolvedFileName.shouldContinueSearching() { @@ -1255,7 +1260,7 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { } } if r.tracer != nil { - r.tracer.write(diagnostics.Module_resolution_using_rootDirs_has_failed.Format()) + r.tracer.write(diagnostics.Module_resolution_using_rootDirs_has_failed) } } return continueSearching() @@ -1263,14 +1268,14 @@ func (r *resolutionState) tryLoadModuleUsingRootDirs() *resolved { func (r *resolutionState) nodeLoadModuleByRelativeName(extensions extensions, candidate string, onlyRecordFailures bool, considerPackageJson bool) *resolved { if r.tracer != nil { - r.tracer.write(diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1.Format(candidate, extensions.String())) + r.tracer.write(diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, extensions.String()) } if !tspath.HasTrailingDirectorySeparator(candidate) { if !onlyRecordFailures { parentOfCandidate := tspath.GetDirectoryPath(candidate) if !r.resolver.host.FS().DirectoryExists(parentOfCandidate) { if r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(parentOfCandidate)) + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate) } onlyRecordFailures = true } @@ -1289,7 +1294,7 @@ func (r *resolutionState) nodeLoadModuleByRelativeName(extensions extensions, ca candidateExists := r.resolver.host.FS().DirectoryExists(candidate) if !candidateExists { if r.tracer != nil { - r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it.Format(candidate)) + r.tracer.write(diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate) } onlyRecordFailures = true } @@ -1331,7 +1336,7 @@ func (r *resolutionState) loadModuleFromFileNoImplicitExtensions(extensions exte extension := candidate[len(extensionless):] if r.tracer != nil { - r.tracer.write(diagnostics.File_name_0_has_a_1_extension_stripping_it.Format(candidate, extension)) + r.tracer.write(diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension) } return r.tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures) } @@ -1485,11 +1490,11 @@ func (r *resolutionState) tryFileLookup(fileName string, onlyRecordFailures bool if !onlyRecordFailures { if r.resolver.host.FS().FileExists(fileName) { if r.tracer != nil { - r.tracer.write(diagnostics.File_0_exists_use_it_as_a_name_resolution_result.Format(fileName)) + r.tracer.write(diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName) } return true } else if r.tracer != nil { - r.tracer.write(diagnostics.File_0_does_not_exist.Format(fileName)) + r.tracer.write(diagnostics.File_0_does_not_exist, fileName) } } r.failedLookupLocations = append(r.failedLookupLocations, fileName) @@ -1561,7 +1566,7 @@ func (r *resolutionState) loadNodeModuleFromDirectoryWorker(ext extensions, cand moduleName = tspath.GetRelativePathFromDirectory(candidate, indexPath, tspath.ComparePathsOptions{}) } if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2.Format(versionPaths.Version, core.Version(), moduleName)) + r.tracer.write(diagnostics.X_package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.Version, core.Version(), moduleName) } pathPatterns := TryParsePatterns(versionPaths.GetPaths()) if result := r.tryLoadModuleUsingPaths(ext, moduleName, candidate, versionPaths.GetPaths(), pathPatterns, loader, onlyRecordFailuresForPackageFile); !result.shouldContinueSearching() { @@ -1649,7 +1654,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord if existing := r.resolver.packageJsonInfoCache.Get(packageJsonPath); existing != nil { if existing.Contents != nil { if r.tracer != nil { - r.tracer.write(diagnostics.File_0_exists_according_to_earlier_cached_lookups.Format(packageJsonPath)) + r.tracer.write(diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath) } r.affectingLocations = append(r.affectingLocations, packageJsonPath) if existing.PackageDirectory == packageDirectory { @@ -1663,7 +1668,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord } } else { if existing.DirectoryExists && r.tracer != nil { - r.tracer.write(diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups.Format(packageJsonPath)) + r.tracer.write(diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath) } r.failedLookupLocations = append(r.failedLookupLocations, packageJsonPath) return nil @@ -1676,7 +1681,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord contents, _ := r.resolver.host.FS().ReadFile(packageJsonPath) packageJsonContent, err := packagejson.Parse([]byte(contents)) if r.tracer != nil { - r.tracer.write(diagnostics.Found_package_json_at_0.Format(packageJsonPath)) + r.tracer.write(diagnostics.Found_package_json_at_0, packageJsonPath) } result := &packagejson.InfoCacheEntry{ PackageDirectory: packageDirectory, @@ -1691,7 +1696,7 @@ func (r *resolutionState) getPackageJsonInfo(packageDirectory string, onlyRecord return result } else { if directoryExists && r.tracer != nil { - r.tracer.write(diagnostics.File_0_does_not_exist.Format(packageJsonPath)) + r.tracer.write(diagnostics.File_0_does_not_exist, packageJsonPath) } _ = r.resolver.packageJsonInfoCache.Set(packageJsonPath, &packagejson.InfoCacheEntry{ PackageDirectory: packageDirectory, @@ -1730,7 +1735,7 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa return "" } if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_has_a_peerDependencies_field.Message()) + r.tracer.write(diagnostics.X_package_json_has_a_peerDependencies_field) } packageDirectory := r.realPath(packageJsonInfo.PackageDirectory) nodeModulesIndex := strings.LastIndex(packageDirectory, "/node_modules") @@ -1748,10 +1753,10 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa builder.WriteString("@") builder.WriteString(version) if r.tracer != nil { - r.tracer.write(diagnostics.Found_peerDependency_0_with_1_version.Format(name, version)) + r.tracer.write(diagnostics.Found_peerDependency_0_with_1_version, name, version) } } else if r.tracer != nil { - r.tracer.write(diagnostics.Failed_to_find_peerDependency_0.Format(name)) + r.tracer.write(diagnostics.Failed_to_find_peerDependency_0, name) } } return builder.String() @@ -1760,7 +1765,7 @@ func (r *resolutionState) readPackageJsonPeerDependencies(packageJsonInfo *packa func (r *resolutionState) realPath(path string) string { rp := tspath.NormalizePath(r.resolver.host.FS().Realpath(path)) if r.tracer != nil { - r.tracer.write(diagnostics.Resolving_real_path_for_0_result_1.Format(path, rp)) + r.tracer.write(diagnostics.Resolving_real_path_for_0_result_1, path, rp) } return rp } @@ -1771,11 +1776,11 @@ func (r *resolutionState) validatePackageJSONField(fieldName string, field packa return true } if r.tracer != nil { - r.tracer.write(diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2.Format(fieldName, field.ExpectedJSONType(), field.ActualJSONType())) + r.tracer.write(diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, field.ExpectedJSONType(), field.ActualJSONType()) } } if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_does_not_have_a_0_field.Format(fieldName)) + r.tracer.write(diagnostics.X_package_json_does_not_have_a_0_field, fieldName) } return false } @@ -1786,13 +1791,13 @@ func (r *resolutionState) getPackageJSONPathField(fieldName string, field *packa } if field.Value == "" { if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_had_a_falsy_0_field.Format(fieldName)) + r.tracer.write(diagnostics.X_package_json_had_a_falsy_0_field, fieldName) } return "", false } path := tspath.NormalizePath(tspath.CombinePaths(directory, field.Value)) if r.tracer != nil { - r.tracer.write(diagnostics.X_package_json_has_0_field_1_that_references_2.Format(fieldName, field.Value, path)) + r.tracer.write(diagnostics.X_package_json_has_0_field_1_that_references_2, fieldName, field.Value, path) } return path, true } @@ -1813,7 +1818,7 @@ func (r *resolutionState) conditionMatches(condition string) bool { return false } -func (r *resolutionState) getTraceFunc() func(string) { +func (r *resolutionState) getTraceFunc() func(m *diagnostics.Message, args ...any) { if r.tracer != nil { return r.tracer.write } diff --git a/pkg/packagejson/cache.go b/pkg/packagejson/cache.go index 15adf5ffd..d0dacc978 100644 --- a/pkg/packagejson/cache.go +++ b/pkg/packagejson/cache.go @@ -16,32 +16,52 @@ type PackageJson struct { Fields Parseable bool versionPaths VersionPaths - versionTraces []string + versionTraces []diagnosticAndArgs once sync.Once } -func (p *PackageJson) GetVersionPaths(trace func(string)) VersionPaths { +type diagnosticAndArgs struct { + message *diagnostics.Message + args []any +} + +func (p *PackageJson) GetVersionPaths(trace func(m *diagnostics.Message, args ...any)) VersionPaths { p.once.Do(func() { if p.Fields.TypesVersions.Type == JSONValueTypeNotPresent { - p.versionTraces = append(p.versionTraces, diagnostics.X_package_json_does_not_have_a_0_field.Format("typesVersions")) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.X_package_json_does_not_have_a_0_field, + []any{"typesVersions"}, + }) return } if p.Fields.TypesVersions.Type != JSONValueTypeObject { - p.versionTraces = append(p.versionTraces, diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2.Format("typesVersions", "object", p.Fields.TypesVersions.Type.String())) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, + []any{"typesVersions", "object", p.Fields.TypesVersions.Type.String()}, + }) return } - p.versionTraces = append(p.versionTraces, diagnostics.X_package_json_has_a_typesVersions_field_with_version_specific_path_mappings.Format("typesVersions")) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.X_package_json_has_a_typesVersions_field_with_version_specific_path_mappings, + []any{"typesVersions"}, + }) for key, value := range p.Fields.TypesVersions.AsObject().Entries() { keyRange, ok := semver.TryParseVersionRange(key) if !ok { - p.versionTraces = append(p.versionTraces, diagnostics.X_package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range.Format(key)) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.X_package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, + []any{key}, + }) continue } if keyRange.Test(&typeScriptVersion) { if value.Type != JSONValueTypeObject { - p.versionTraces = append(p.versionTraces, diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2.Format("typesVersions['"+key+"']", "object", value.Type.String())) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, + []any{"typesVersions['" + key + "']", "object", value.Type.String()}, + }) return } p.versionPaths = VersionPaths{ @@ -52,11 +72,14 @@ func (p *PackageJson) GetVersionPaths(trace func(string)) VersionPaths { } } - p.versionTraces = append(p.versionTraces, diagnostics.X_package_json_does_not_have_a_typesVersions_entry_that_matches_version_0.Format(core.VersionMajorMinor())) + p.versionTraces = append(p.versionTraces, diagnosticAndArgs{ + diagnostics.X_package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, + []any{core.VersionMajorMinor()}, + }) }) if trace != nil { for _, msg := range p.versionTraces { - trace(msg) + trace(msg.message, msg.args...) } } return p.versionPaths diff --git a/pkg/project/compilerhost.go b/pkg/project/compilerhost.go index 50c13a002..c234b2fcc 100644 --- a/pkg/project/compilerhost.go +++ b/pkg/project/compilerhost.go @@ -6,6 +6,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/project/logging" "github.com/buke/typescript-go-internal/pkg/tsoptions" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -131,7 +132,7 @@ func (c *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.Sourc } // Trace implements compiler.CompilerHost. -func (c *compilerHost) Trace(msg string) { +func (c *compilerHost) Trace(msg *diagnostics.Message, args ...any) { panic("unimplemented") } diff --git a/pkg/project/configfileregistry.go b/pkg/project/configfileregistry.go index eafe421f2..11837285d 100644 --- a/pkg/project/configfileregistry.go +++ b/pkg/project/configfileregistry.go @@ -1,6 +1,7 @@ package project import ( + "iter" "maps" "github.com/buke/typescript-go-internal/pkg/core" @@ -108,6 +109,73 @@ func (c *ConfigFileRegistry) clone() *ConfigFileRegistry { } } +// For testing +type TestConfigEntry struct { + FileName string + RetainingProjects iter.Seq[tspath.Path] + RetainingOpenFiles iter.Seq[tspath.Path] + RetainingConfigs iter.Seq[tspath.Path] +} + +// For testing +func (c *ConfigFileRegistry) ForEachTestConfigEntry(cb func(tspath.Path, *TestConfigEntry)) { + if c != nil { + for path, entry := range c.configs { + cb(path, &TestConfigEntry{ + FileName: entry.fileName, + RetainingProjects: maps.Keys(entry.retainingProjects), + RetainingOpenFiles: maps.Keys(entry.retainingOpenFiles), + RetainingConfigs: maps.Keys(entry.retainingConfigs), + }) + } + } +} + +// For testing +func (c *ConfigFileRegistry) GetTestConfigEntry(path tspath.Path) *TestConfigEntry { + if c != nil { + if entry, ok := c.configs[path]; ok { + return &TestConfigEntry{ + FileName: entry.fileName, + RetainingProjects: maps.Keys(entry.retainingProjects), + RetainingOpenFiles: maps.Keys(entry.retainingOpenFiles), + RetainingConfigs: maps.Keys(entry.retainingConfigs), + } + } + } + return nil +} + +type TestConfigFileNamesEntry struct { + NearestConfigFileName string + Ancestors map[string]string +} + +// For testing +func (c *ConfigFileRegistry) ForEachTestConfigFileNamesEntry(cb func(tspath.Path, *TestConfigFileNamesEntry)) { + if c != nil { + for path, entry := range c.configFileNames { + cb(path, &TestConfigFileNamesEntry{ + NearestConfigFileName: entry.nearestConfigFileName, + Ancestors: entry.ancestors, + }) + } + } +} + +// For testing +func (c *ConfigFileRegistry) GetTestConfigFileNamesEntry(path tspath.Path) *TestConfigFileNamesEntry { + if c != nil { + if entry, ok := c.configFileNames[path]; ok { + return &TestConfigFileNamesEntry{ + NearestConfigFileName: entry.nearestConfigFileName, + Ancestors: entry.ancestors, + } + } + } + return nil +} + type configFileNames struct { // nearestConfigFileName is the file name of the nearest ancestor config file. nearestConfigFileName string diff --git a/pkg/project/configfileregistrybuilder.go b/pkg/project/configfileregistrybuilder.go index eed56d1d0..3423bd42d 100644 --- a/pkg/project/configfileregistrybuilder.go +++ b/pkg/project/configfileregistrybuilder.go @@ -76,10 +76,10 @@ func (c *configFileRegistryBuilder) Finalize() *ConfigFileRegistry { return newRegistry } -func (c *configFileRegistryBuilder) findOrAcquireConfigForOpenFile( +func (c *configFileRegistryBuilder) findOrAcquireConfigForFile( configFileName string, configFilePath tspath.Path, - openFilePath tspath.Path, + filePath tspath.Path, loadKind projectLoadKind, logger *logging.LogTree, ) *tsoptions.ParsedCommandLine { @@ -90,7 +90,7 @@ func (c *configFileRegistryBuilder) findOrAcquireConfigForOpenFile( } return nil case projectLoadKindCreate: - return c.acquireConfigForOpenFile(configFileName, configFilePath, openFilePath, logger) + return c.acquireConfigForFile(configFileName, configFilePath, filePath, logger) default: panic(fmt.Sprintf("unknown project load kind: %d", loadKind)) } @@ -248,17 +248,19 @@ func (c *configFileRegistryBuilder) acquireConfigForProject(fileName string, pat return entry.Value().commandLine } -// acquireConfigForOpenFile loads a config file entry from the cache, or parses it if not already +// acquireConfigForFile loads a config file entry from the cache, or parses it if not already // cached, then adds the open file to `retainingOpenFiles` to keep it alive in the cache. -// Each `acquireConfigForOpenFile` call that passes an `openFilePath` +// Each `acquireConfigForFile` call that passes an `openFilePath` // should be accompanied by an eventual `releaseConfigForOpenFile` call with the same open file. -func (c *configFileRegistryBuilder) acquireConfigForOpenFile(configFileName string, configFilePath tspath.Path, openFilePath tspath.Path, logger *logging.LogTree) *tsoptions.ParsedCommandLine { +func (c *configFileRegistryBuilder) acquireConfigForFile(configFileName string, configFilePath tspath.Path, filePath tspath.Path, logger *logging.LogTree) *tsoptions.ParsedCommandLine { entry, _ := c.configs.LoadOrStore(configFilePath, newConfigFileEntry(configFileName)) var needsRetainOpenFile bool entry.ChangeIf( func(config *configFileEntry) bool { - _, alreadyRetaining := config.retainingOpenFiles[openFilePath] - needsRetainOpenFile = !alreadyRetaining + if c.fs.isOpenFile(filePath) { + _, alreadyRetaining := config.retainingOpenFiles[filePath] + needsRetainOpenFile = !alreadyRetaining + } return needsRetainOpenFile || config.pendingReload != PendingReloadNone }, func(config *configFileEntry) { @@ -266,7 +268,7 @@ func (c *configFileRegistryBuilder) acquireConfigForOpenFile(configFileName stri if config.retainingOpenFiles == nil { config.retainingOpenFiles = make(map[tspath.Path]struct{}) } - config.retainingOpenFiles[openFilePath] = struct{}{} + config.retainingOpenFiles[filePath] = struct{}{} } c.reloadIfNeeded(config, configFileName, configFilePath, logger) }, @@ -524,8 +526,7 @@ func (c *configFileRegistryBuilder) getConfigFileNameForFile(fileName string, pa } configName := c.computeConfigFileName(fileName, false, logger) - - if _, ok := c.fs.overlays[path]; ok { + if c.fs.isOpenFile(path) { c.configFileNames.Add(path, &configFileNames{ nearestConfigFileName: configName, }) @@ -533,6 +534,24 @@ func (c *configFileRegistryBuilder) getConfigFileNameForFile(fileName string, pa return configName } +func (c *configFileRegistryBuilder) forEachConfigFileNameFor(fileName string, path tspath.Path, cb func(configFileName string)) { + if isDynamicFileName(fileName) { + return + } + + if entry, ok := c.configFileNames.Get(path); ok { + configFileName := entry.Value().nearestConfigFileName + for configFileName != "" { + cb(configFileName) + if ancestorConfigName, found := entry.Value().ancestors[configFileName]; found { + configFileName = ancestorConfigName + } else { + return + } + } + } +} + func (c *configFileRegistryBuilder) getAncestorConfigFileName(fileName string, path tspath.Path, configFileName string, logger *logging.LogTree) string { if isDynamicFileName(fileName) { return "" @@ -542,6 +561,7 @@ func (c *configFileRegistryBuilder) getAncestorConfigFileName(fileName string, p if !ok { return "" } + if ancestorConfigName, found := entry.Value().ancestors[configFileName]; found { return ancestorConfigName } @@ -549,7 +569,7 @@ func (c *configFileRegistryBuilder) getAncestorConfigFileName(fileName string, p // Look for config in parent folders of config file result := c.computeConfigFileName(configFileName, true, logger) - if _, ok := c.fs.overlays[path]; ok { + if c.fs.isOpenFile(path) { entry.Change(func(value *configFileNames) { if value.ancestors == nil { value.ancestors = make(map[string]string) diff --git a/pkg/project/project.go b/pkg/project/project.go index 66f04ebd7..e78637145 100644 --- a/pkg/project/project.go +++ b/pkg/project/project.go @@ -68,6 +68,9 @@ type Project struct { ProgramUpdateKind ProgramUpdateKind // The ID of the snapshot that created the program stored in this project. ProgramLastUpdate uint64 + // Set of projects that this project could be referencing. + // Only set before actually loading config file to get actual project references + potentialProjectReferences *collections.Set[tspath.Path] programFilesWatch *WatchedFiles[PatternsAndIgnored] failedLookupsWatch *WatchedFiles[map[tspath.Path]string] @@ -192,10 +195,18 @@ func (p *Project) ConfigFilePath() tspath.Path { return p.configFilePath } +func (p *Project) Id() tspath.Path { + return p.configFilePath +} + func (p *Project) GetProgram() *compiler.Program { return p.Program } +func (p *Project) HasFile(fileName string) bool { + return p.containsFile(p.toPath(fileName)) +} + func (p *Project) containsFile(path tspath.Path) bool { return p.Program != nil && p.Program.GetSourceFileByPath(path) != nil } @@ -220,6 +231,7 @@ func (p *Project) Clone() *Project { Program: p.Program, ProgramUpdateKind: ProgramUpdateKindNone, ProgramLastUpdate: p.ProgramLastUpdate, + potentialProjectReferences: p.potentialProjectReferences, programFilesWatch: p.programFilesWatch, failedLookupsWatch: p.failedLookupsWatch, @@ -267,6 +279,32 @@ func (p *Project) getCommandLineWithTypingsFiles() *tsoptions.ParsedCommandLine return p.commandLineWithTypingsFiles } +func (p *Project) setPotentialProjectReference(configFilePath tspath.Path) { + if p.potentialProjectReferences == nil { + p.potentialProjectReferences = &collections.Set[tspath.Path]{} + } else { + p.potentialProjectReferences = p.potentialProjectReferences.Clone() + } + p.potentialProjectReferences.Add(configFilePath) +} + +func (p *Project) hasPotentialProjectReference(references map[tspath.Path]struct{}) bool { + if p.CommandLine != nil { + for _, path := range p.CommandLine.ResolvedProjectReferencePaths() { + if _, has := references[p.toPath(path)]; has { + return true + } + } + } else if p.potentialProjectReferences != nil { + for path := range p.potentialProjectReferences.Keys() { + if _, has := references[path]; has { + return true + } + } + } + return false +} + type CreateProgramResult struct { Program *compiler.Program UpdateKind ProgramUpdateKind diff --git a/pkg/project/projectcollection.go b/pkg/project/projectcollection.go index cbed77648..793990325 100644 --- a/pkg/project/projectcollection.go +++ b/pkg/project/projectcollection.go @@ -29,6 +29,8 @@ type ProjectCollection struct { apiOpenedProjects map[tspath.Path]struct{} } +func (c *ProjectCollection) ConfigFileRegistry() *ConfigFileRegistry { return c.configFileRegistry } + func (c *ProjectCollection) ConfiguredProject(path tspath.Path) *Project { return c.configuredProjects[path] } @@ -91,6 +93,19 @@ func (c *ProjectCollection) InferredProject() *Project { return c.inferredProject } +func (c *ProjectCollection) GetProjectsContainingFile(path tspath.Path) []*Project { + var projects []*Project + for _, project := range c.ConfiguredProjects() { + if project.containsFile(path) { + projects = append(projects, project) + } + } + if c.inferredProject != nil && c.inferredProject.containsFile(path) { + projects = append(projects, c.inferredProject) + } + return projects +} + // !!! result could be cached func (c *ProjectCollection) GetDefaultProject(fileName string, path tspath.Path) *Project { if result, ok := c.fileDefaultProjects[path]; ok { diff --git a/pkg/project/projectcollectionbuilder.go b/pkg/project/projectcollectionbuilder.go index 09a15887c..9c61895cd 100644 --- a/pkg/project/projectcollectionbuilder.go +++ b/pkg/project/projectcollectionbuilder.go @@ -38,9 +38,10 @@ type ProjectCollectionBuilder struct { newSnapshotID uint64 programStructureChanged bool - fileDefaultProjects map[tspath.Path]tspath.Path - configuredProjects *dirty.SyncMap[tspath.Path, *Project] - inferredProject *dirty.Box[*Project] + + fileDefaultProjects map[tspath.Path]tspath.Path + configuredProjects *dirty.SyncMap[tspath.Path, *Project] + inferredProject *dirty.Box[*Project] apiOpenedProjects map[tspath.Path]struct{} } @@ -243,17 +244,67 @@ func (b *ProjectCollectionBuilder) DidChangeFiles(summary FileChangeSummary, log fileName := summary.Opened.FileName() path := b.toPath(fileName) var toRemoveProjects collections.Set[tspath.Path] - openFileResult := b.ensureConfiguredProjectAndAncestorsForOpenFile(fileName, path, logger) + openFileResult := b.ensureConfiguredProjectAndAncestorsForFile(fileName, path, logger) b.configuredProjects.Range(func(entry *dirty.SyncMapEntry[tspath.Path, *Project]) bool { - toRemoveProjects.Add(entry.Value().configFilePath) - b.updateProgram(entry, logger) + toRemoveProjects.Add(entry.Key()) return true }) + var isReferencedBy func(project *Project, refPath tspath.Path, seenProjects *collections.Set[*Project]) bool + isReferencedBy = func(project *Project, refPath tspath.Path, seenProjects *collections.Set[*Project]) bool { + if !seenProjects.AddIfAbsent(project) { + return false + } + + if project.potentialProjectReferences != nil { + for potentialRef := range project.potentialProjectReferences.Keys() { + if potentialRef == refPath { + return true + } + } + for potentialRef := range project.potentialProjectReferences.Keys() { + if refProject, foundRef := b.configuredProjects.Load(potentialRef); foundRef && isReferencedBy(refProject.Value(), refPath, seenProjects) { + return true + } + } + } else if program := project.GetProgram(); program != nil && !program.RangeResolvedProjectReference(func(referencePath tspath.Path, _ *tsoptions.ParsedCommandLine, _ *tsoptions.ParsedCommandLine, _ int) bool { + return referencePath != refPath + }) { + return true + } + return false + } + + retainProjectAndReferences := func(project *Project) { + // Retain project + toRemoveProjects.Delete(project.configFilePath) + if program := project.GetProgram(); program != nil { + program.RangeResolvedProjectReference(func(referencePath tspath.Path, _ *tsoptions.ParsedCommandLine, _ *tsoptions.ParsedCommandLine, _ int) bool { + if _, ok := b.configuredProjects.Load(referencePath); ok { + toRemoveProjects.Delete(referencePath) + } + return true + }) + } + } + + retainDefaultConfiguredProject := func(openFile string, openFilePath tspath.Path, project *Project) { + // Retain project and its references + retainProjectAndReferences(project) + + // Retain all the ancestor projects + b.configFileRegistryBuilder.forEachConfigFileNameFor(openFile, openFilePath, func(configFileName string) { + if ancestor := b.findOrCreateProject(configFileName, b.toPath(configFileName), projectLoadKindFind, logger); ancestor != nil { + retainProjectAndReferences(ancestor.Value()) + } + }) + } var inferredProjectFiles []string for _, overlay := range b.fs.overlays { - if p := b.findDefaultConfiguredProject(overlay.FileName(), b.toPath(overlay.FileName())); p != nil { - toRemoveProjects.Delete(p.Value().configFilePath) + openFile := overlay.FileName() + openFilePath := b.toPath(openFile) + if p := b.findDefaultConfiguredProject(openFile, openFilePath); p != nil { + retainDefaultConfiguredProject(openFile, openFilePath, p.Value()) } else { inferredProjectFiles = append(inferredProjectFiles, overlay.FileName()) } @@ -290,51 +341,156 @@ func logChangeFileResult(result changeFileResult, logger *logging.LogTree) { func (b *ProjectCollectionBuilder) DidRequestFile(uri lsproto.DocumentUri, logger *logging.LogTree) { startTime := time.Now() fileName := uri.FileName() - hasChanges := b.programStructureChanged - - // See if we can find a default project without updating a bunch of stuff. path := b.toPath(fileName) - if result := b.findDefaultProject(fileName, path); result != nil { - hasChanges = b.updateProgram(result, logger) || hasChanges - if result.Value() != nil { - return + if b.fs.isOpenFile(path) { + hasChanges := b.programStructureChanged + + // See if we can find a default project without updating a bunch of stuff. + if result := b.findDefaultProject(fileName, path); result != nil { + hasChanges = b.updateProgram(result, logger) || hasChanges + if result.Value() != nil { + return + } } - } - // Make sure all projects we know about are up to date... - b.configuredProjects.Range(func(entry *dirty.SyncMapEntry[tspath.Path, *Project]) bool { - hasChanges = b.updateProgram(entry, logger) || hasChanges - return true - }) - if hasChanges { - // If the structure of other projects changed, we might need to move files - // in/out of the inferred project. - var inferredProjectFiles []string - for path, overlay := range b.fs.overlays { - if b.findDefaultConfiguredProject(overlay.FileName(), path) == nil { - inferredProjectFiles = append(inferredProjectFiles, overlay.FileName()) + // Make sure all projects we know about are up to date... + b.configuredProjects.Range(func(entry *dirty.SyncMapEntry[tspath.Path, *Project]) bool { + hasChanges = b.updateProgram(entry, logger) || hasChanges + return true + }) + if hasChanges { + // If the structure of other projects changed, we might need to move files + // in/out of the inferred project. + var inferredProjectFiles []string + for path, overlay := range b.fs.overlays { + if b.findDefaultConfiguredProject(overlay.FileName(), path) == nil { + inferredProjectFiles = append(inferredProjectFiles, overlay.FileName()) + } + } + if len(inferredProjectFiles) > 0 { + b.updateInferredProjectRoots(inferredProjectFiles, logger) } } - if len(inferredProjectFiles) > 0 { - b.updateInferredProjectRoots(inferredProjectFiles, logger) + + if b.inferredProject.Value() != nil { + b.updateProgram(b.inferredProject, logger) } + + // At this point we should be able to find the default project for the file without + // creating anything else. Initially, I verified that and panicked if nothing was found, + // but that panic was getting triggered by fourslash infrastructure when it told us to + // open a package.json file. This is something the VS Code client would never do, but + // it seems possible that another client would. There's no point in panicking; we don't + // really even have an error condition until it tries to ask us language questions about + // a non-TS-handleable file. + } else { + b.ensureConfiguredProjectAndAncestorsForFile(fileName, path, logger) } - if b.inferredProject.Value() != nil { - b.updateProgram(b.inferredProject, logger) + if logger != nil { + elapsed := time.Since(startTime) + logger.Log(fmt.Sprintf("Completed file request for %s in %v", fileName, elapsed)) } +} - // At this point we should be able to find the default project for the file without - // creating anything else. Initially, I verified that and panicked if nothing was found, - // but that panic was getting triggered by fourslash infrastructure when it told us to - // open a package.json file. This is something the VS Code client would never do, but - // it seems possible that another client would. There's no point in panicking; we don't - // really even have an error condition until it tries to ask us language questions about - // a non-TS-handleable file. +func (b *ProjectCollectionBuilder) DidRequestProject(projectId tspath.Path, logger *logging.LogTree) { + startTime := time.Now() + if projectId == inferredProjectName { + // Update inferred project + if b.inferredProject.Value() != nil { + b.updateProgram(b.inferredProject, logger) + } + } else { + if entry, ok := b.configuredProjects.Load(projectId); ok { + b.updateProgram(entry, logger) + } + } if logger != nil { elapsed := time.Since(startTime) - logger.Log(fmt.Sprintf("Completed file request for %s in %v", fileName, elapsed)) + logger.Log(fmt.Sprintf("Completed project update request for %s in %v", projectId, elapsed)) + } +} + +func (b *ProjectCollectionBuilder) DidRequestProjectTrees(projectsReferenced map[tspath.Path]struct{}, logger *logging.LogTree) { + startTime := time.Now() + + var currentProjects []tspath.Path + b.configuredProjects.Range(func(sme *dirty.SyncMapEntry[tspath.Path, *Project]) bool { + currentProjects = append(currentProjects, sme.Key()) + return true + }) + + var seenProjects collections.SyncSet[tspath.Path] + wg := core.NewWorkGroup(false) + for _, projectId := range currentProjects { + wg.Queue(func() { + if entry, ok := b.configuredProjects.Load(projectId); ok { + // If this project has potential project reference for any of the project we are loading ancestor tree for + // load this project first + if project := entry.Value(); project != nil && (projectsReferenced == nil || project.hasPotentialProjectReference(projectsReferenced)) { + b.updateProgram(entry, logger) + } + b.ensureProjectTree(wg, entry, projectsReferenced, &seenProjects, logger) + } + }) + } + wg.RunAndWait() + + if logger != nil { + elapsed := time.Since(startTime) + logger.Log(fmt.Sprintf("Completed project tree request for %v in %v", maps.Keys(projectsReferenced), elapsed)) + } +} + +func (b *ProjectCollectionBuilder) ensureProjectTree( + wg core.WorkGroup, + entry *dirty.SyncMapEntry[tspath.Path, *Project], + projectsReferenced map[tspath.Path]struct{}, + seenProjects *collections.SyncSet[tspath.Path], + logger *logging.LogTree, +) { + if !seenProjects.AddIfAbsent(entry.Key()) { + return + } + + project := entry.Value() + if project == nil { + return + } + + program := project.GetProgram() + if program == nil { + return + } + + // If this project disables child load ignore it + if program.CommandLine().CompilerOptions().DisableReferencedProjectLoad.IsTrue() { + return + } + + children := program.GetResolvedProjectReferences() + if children == nil { + return + } + for _, childConfig := range children { + wg.Queue(func() { + if projectsReferenced != nil && program.RangeResolvedProjectReferenceInChildConfig( + childConfig, + func(referencePath tspath.Path, config *tsoptions.ParsedCommandLine, _ *tsoptions.ParsedCommandLine, _ int) bool { + _, isReferenced := projectsReferenced[referencePath] + return !isReferenced + }) { + return + } + + // Load this child project since this is referenced + childProjectEntry := b.findOrCreateProject(childConfig.ConfigName(), childConfig.ConfigFile.SourceFile.Path(), projectLoadKindCreate, logger) + b.updateProgram(childProjectEntry, logger) + + // Ensure children for this project + b.ensureProjectTree(wg, childProjectEntry, projectsReferenced, seenProjects, logger) + }) } } @@ -408,7 +564,7 @@ func (b *ProjectCollectionBuilder) markProjectsAffectedByConfigChanges( var hasChanges bool for path := range configChangeResult.affectedFiles { fileName := b.fs.overlays[path].FileName() - _ = b.ensureConfiguredProjectAndAncestorsForOpenFile(fileName, path, logger) + _ = b.ensureConfiguredProjectAndAncestorsForFile(fileName, path, logger) hasChanges = true } @@ -449,7 +605,7 @@ func (b *ProjectCollectionBuilder) findDefaultConfiguredProject(fileName string, }) if multipleCandidates { - if p := b.findOrCreateDefaultConfiguredProjectForOpenScriptInfo(fileName, path, projectLoadKindFind, nil).project; p != nil { + if p := b.findOrCreateDefaultConfiguredProjectForFile(fileName, path, projectLoadKindFind, nil).project; p != nil { return p } } @@ -457,28 +613,53 @@ func (b *ProjectCollectionBuilder) findDefaultConfiguredProject(fileName string, return configuredProjects[project] } -func (b *ProjectCollectionBuilder) ensureConfiguredProjectAndAncestorsForOpenFile(fileName string, path tspath.Path, logger *logging.LogTree) searchResult { - result := b.findOrCreateDefaultConfiguredProjectForOpenScriptInfo(fileName, path, projectLoadKindCreate, logger) - if result.project != nil { - // !!! sheetal todo this later - // // Create ancestor tree for findAllRefs (dont load them right away) - // forEachAncestorProjectLoad( - // info, - // tsconfigProject!, - // ancestor => { - // seenProjects.set(ancestor.project, kind); - // }, - // kind, - // `Creating project possibly referencing default composite project ${defaultProject.getProjectName()} of open file ${info.fileName}`, - // allowDeferredClosed, - // reloadedProjects, - // /*searchOnlyPotentialSolution*/ true, - // delayReloadedConfiguredProjects, - // ); +func (b *ProjectCollectionBuilder) ensureConfiguredProjectAndAncestorsForFile(fileName string, path tspath.Path, logger *logging.LogTree) searchResult { + result := b.findOrCreateDefaultConfiguredProjectForFile(fileName, path, projectLoadKindCreate, logger) + if result.project != nil && b.fs.isOpenFile(path) { + b.createAncestorTree(fileName, path, &result, logger) } return result } +func (b *ProjectCollectionBuilder) createAncestorTree(fileName string, path tspath.Path, openResult *searchResult, logger *logging.LogTree) { + project := openResult.project.Value() + for { + // Skip if project is not composite and we are only looking for solution + if project.CommandLine != nil && + (!project.CommandLine.CompilerOptions().Composite.IsTrue() || + project.CommandLine.CompilerOptions().DisableSolutionSearching.IsTrue()) { + return + } + + // Get config file name + ancestorConfigName := b.configFileRegistryBuilder.getAncestorConfigFileName(fileName, path, project.configFileName, logger) + if ancestorConfigName == "" { + return + } + + // find or delay load the project + ancestorPath := b.toPath(ancestorConfigName) + ancestor := b.findOrCreateProject(ancestorConfigName, ancestorPath, projectLoadKindCreate, logger) + if ancestor == nil { + return + } + + openResult.retain.Add(ancestorPath) + + // If this ancestor is new and was not updated because we are just creating it for future loading + // eg when invoking find all references or rename that could span multiple projects + // we would make the current project as its potential project reference + if ancestor.Value().CommandLine == nil && + (project.CommandLine == nil || project.CommandLine.CompilerOptions().Composite.IsTrue()) { + ancestor.Change(func(ancestorProject *Project) { + ancestorProject.setPotentialProjectReference(project.configFilePath) + }) + } + + project = ancestor.Value() + } +} + type searchNode struct { configFileName string loadKind projectLoadKind @@ -531,7 +712,7 @@ func (b *ProjectCollectionBuilder) findOrCreateDefaultConfiguredProjectWorker( }, func(node searchNode) (isResult bool, stop bool) { configFilePath := b.toPath(node.configFileName) - config := b.configFileRegistryBuilder.findOrAcquireConfigForOpenFile(node.configFileName, configFilePath, path, node.loadKind, node.logger.Fork("Acquiring config for open file")) + config := b.configFileRegistryBuilder.findOrAcquireConfigForFile(node.configFileName, configFilePath, path, node.loadKind, node.logger.Fork("Acquiring config for open file")) if config == nil { node.logger.Log("Config file for project does not already exist") return false, false @@ -653,7 +834,7 @@ func (b *ProjectCollectionBuilder) findOrCreateDefaultConfiguredProjectWorker( return searchResult{retain: retain} } -func (b *ProjectCollectionBuilder) findOrCreateDefaultConfiguredProjectForOpenScriptInfo( +func (b *ProjectCollectionBuilder) findOrCreateDefaultConfiguredProjectForFile( fileName string, path tspath.Path, loadKind projectLoadKind, @@ -784,6 +965,7 @@ func (b *ProjectCollectionBuilder) updateProgram(entry dirty.Value[*Project], lo entry.Change(func(p *Project) { p.CommandLine = commandLine p.commandLineWithTypingsFiles = nil + p.potentialProjectReferences = nil }) } } @@ -881,8 +1063,9 @@ func (b *ProjectCollectionBuilder) deleteConfiguredProject(project dirty.Value[* logger.Log("Deleting configured project: " + project.Value().configFileName) } if program := project.Value().Program; program != nil { - program.ForEachResolvedProjectReference(func(referencePath tspath.Path, config *tsoptions.ParsedCommandLine, _ *tsoptions.ParsedCommandLine, _ int) { + program.RangeResolvedProjectReference(func(referencePath tspath.Path, config *tsoptions.ParsedCommandLine, _ *tsoptions.ParsedCommandLine, _ int) bool { b.configFileRegistryBuilder.releaseConfigForProject(referencePath, projectPath) + return true }) } b.configFileRegistryBuilder.releaseConfigForProject(projectPath, projectPath) diff --git a/pkg/project/projectcollectionbuilder_test.go b/pkg/project/projectcollectionbuilder_test.go index b7d056fbb..259e338cb 100644 --- a/pkg/project/projectcollectionbuilder_test.go +++ b/pkg/project/projectcollectionbuilder_test.go @@ -320,9 +320,11 @@ func TestProjectCollectionBuilder(t *testing.T) { session.DidOpenFile(context.Background(), uri, 1, content, lsproto.LanguageKindTypeScript) snapshot, release := session.Snapshot() defer release() - assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 1) + assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 2) demoProject := snapshot.ProjectCollection.ConfiguredProject(tspath.Path("/home/src/projects/project/demos/tsconfig.json")) assert.Assert(t, demoProject != nil) + solutionProject := snapshot.ProjectCollection.ConfiguredProject(tspath.Path("/home/src/projects/project/tsconfig.json")) + assert.Assert(t, solutionProject != nil) // Verify the default project is the demos project (not the app project that excludes demos files) defaultProject := snapshot.GetDefaultProject(uri) diff --git a/pkg/project/projectreferencesprogram_test.go b/pkg/project/projectreferencesprogram_test.go index 263d0d1f9..b8fe02d8d 100644 --- a/pkg/project/projectreferencesprogram_test.go +++ b/pkg/project/projectreferencesprogram_test.go @@ -7,6 +7,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/bundled" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/ls/lsconv" "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" "github.com/buke/typescript-go-internal/pkg/project" "github.com/buke/typescript-go-internal/pkg/testutil/projecttestutil" @@ -85,7 +86,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -109,7 +110,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -133,7 +134,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -157,7 +158,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -181,7 +182,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -205,7 +206,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -229,7 +230,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() @@ -253,7 +254,7 @@ func TestProjectReferencesProgram(t *testing.T) { defer release() assert.Equal(t, len(snapshot.ProjectCollection.Projects()), 0) - uri := lsproto.DocumentUri("file://" + aTest) + uri := lsconv.FileNameToDocumentURI(aTest) session.DidOpenFile(context.Background(), uri, 1, files[aTest].(string), lsproto.LanguageKindTypeScript) snapshot, release = session.Snapshot() diff --git a/pkg/project/session.go b/pkg/project/session.go index c31c9a4b4..ca8bc0a70 100644 --- a/pkg/project/session.go +++ b/pkg/project/session.go @@ -13,6 +13,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/ls" "github.com/buke/typescript-go-internal/pkg/ls/lsconv" "github.com/buke/typescript-go-internal/pkg/ls/lsutil" @@ -32,7 +33,9 @@ const ( UpdateReasonDidChangeCompilerOptionsForInferredProjects UpdateReasonRequestedLanguageServicePendingChanges UpdateReasonRequestedLanguageServiceProjectNotLoaded + UpdateReasonRequestedLanguageServiceForFileNotOpen UpdateReasonRequestedLanguageServiceProjectDirty + UpdateReasonRequestedLoadProjectTree ) // SessionOptions are the immutable initialization options for a session. @@ -46,6 +49,7 @@ type SessionOptions struct { LoggingEnabled bool PushDiagnosticsEnabled bool DebounceDelay time.Duration + Locale locale.Locale } type SessionInit struct { @@ -228,9 +232,11 @@ func (s *Session) DidOpenFile(ctx context.Context, uri lsproto.DocumentUri, vers changes, overlays := s.flushChangesLocked(ctx) s.pendingFileChangesMu.Unlock() s.UpdateSnapshot(ctx, overlays, SnapshotChange{ - reason: UpdateReasonDidOpenFile, - fileChanges: changes, - requestedURIs: []lsproto.DocumentUri{uri}, + reason: UpdateReasonDidOpenFile, + fileChanges: changes, + ResourceRequest: ResourceRequest{ + Documents: []lsproto.DocumentUri{uri}, + }, }) } @@ -372,42 +378,133 @@ func (s *Session) Snapshot() (*Snapshot, func()) { } } -func (s *Session) GetLanguageService(ctx context.Context, uri lsproto.DocumentUri) (*ls.LanguageService, error) { +func (s *Session) getSnapshot( + ctx context.Context, + request ResourceRequest, +) *Snapshot { var snapshot *Snapshot fileChanges, overlays, ataChanges, newConfig := s.flushChanges(ctx) updateSnapshot := !fileChanges.IsEmpty() || len(ataChanges) > 0 || newConfig != nil if updateSnapshot { // If there are pending file changes, we need to update the snapshot. // Sending the requested URI ensures that the project for this URI is loaded. - snapshot = s.UpdateSnapshot(ctx, overlays, SnapshotChange{ - reason: UpdateReasonRequestedLanguageServicePendingChanges, - fileChanges: fileChanges, - ataChanges: ataChanges, - newConfig: newConfig, - requestedURIs: []lsproto.DocumentUri{uri}, + return s.UpdateSnapshot(ctx, overlays, SnapshotChange{ + reason: UpdateReasonRequestedLanguageServicePendingChanges, + fileChanges: fileChanges, + ataChanges: ataChanges, + newConfig: newConfig, + ResourceRequest: request, }) + } + + // If there are no pending file changes, we can try to use the current snapshot. + s.snapshotMu.RLock() + snapshot = s.snapshot + s.snapshotMu.RUnlock() + + var updateReason UpdateReason + if len(request.Projects) > 0 { + updateReason = UpdateReasonRequestedLanguageServiceProjectDirty + } else if request.ProjectTree != nil { + updateReason = UpdateReasonRequestedLoadProjectTree } else { - // If there are no pending file changes, we can try to use the current snapshot. - s.snapshotMu.RLock() - snapshot = s.snapshot - s.snapshotMu.RUnlock() + for _, document := range request.Documents { + if snapshot.fs.isOpenFile(document.FileName()) { + // The current snapshot does not have an up to date project for the URI, + // so we need to update the snapshot to ensure the project is loaded. + // !!! Allow multiple projects to update in parallel + project := snapshot.GetDefaultProject(document) + if project == nil { + updateReason = UpdateReasonRequestedLanguageServiceProjectNotLoaded + break + } else if project.dirty { + updateReason = UpdateReasonRequestedLanguageServiceProjectDirty + break + } + } else { + updateReason = UpdateReasonRequestedLanguageServiceForFileNotOpen + break + } + } } - project := snapshot.GetDefaultProject(uri) - if project == nil && !updateSnapshot || project != nil && project.dirty { - // The current snapshot does not have an up to date project for the URI, - // so we need to update the snapshot to ensure the project is loaded. - // !!! Allow multiple projects to update in parallel + if updateReason != UpdateReasonUnknown { snapshot = s.UpdateSnapshot(ctx, overlays, SnapshotChange{ - reason: core.IfElse(project == nil, UpdateReasonRequestedLanguageServiceProjectNotLoaded, UpdateReasonRequestedLanguageServiceProjectDirty), - requestedURIs: []lsproto.DocumentUri{uri}, + reason: updateReason, + ResourceRequest: request, }) - project = snapshot.GetDefaultProject(uri) } + return snapshot +} + +func (s *Session) getSnapshotAndDefaultProject(ctx context.Context, uri lsproto.DocumentUri) (*Snapshot, *Project, *ls.LanguageService, error) { + snapshot := s.getSnapshot( + ctx, + ResourceRequest{Documents: []lsproto.DocumentUri{uri}}, + ) + project := snapshot.GetDefaultProject(uri) + if project == nil { + return nil, nil, nil, fmt.Errorf("no project found for URI %s", uri) + } + return snapshot, project, ls.NewLanguageService(project.GetProgram(), snapshot), nil +} + +func (s *Session) GetLanguageService(ctx context.Context, uri lsproto.DocumentUri) (*ls.LanguageService, error) { + _, _, languageService, err := s.getSnapshotAndDefaultProject(ctx, uri) + if err != nil { + return nil, err + } + return languageService, nil +} + +func (s *Session) GetLanguageServiceAndProjectsForFile(ctx context.Context, uri lsproto.DocumentUri) (*Project, *ls.LanguageService, []*Project, error) { + snapshot, project, defaultLs, err := s.getSnapshotAndDefaultProject(ctx, uri) + if err != nil { + return nil, nil, nil, err + } + // !!! TODO: sheetal: Get other projects that contain the file with symlink + allProjects := snapshot.GetProjectsContainingFile(uri) + return project, defaultLs, allProjects, nil +} + +func (s *Session) GetProjectsForFile(ctx context.Context, uri lsproto.DocumentUri) ([]*Project, error) { + snapshot := s.getSnapshot( + ctx, + ResourceRequest{Documents: []lsproto.DocumentUri{uri}}, + ) + + // !!! TODO: sheetal: Get other projects that contain the file with symlink + allProjects := snapshot.GetProjectsContainingFile(uri) + return allProjects, nil +} + +func (s *Session) GetLanguageServiceForProjectWithFile(ctx context.Context, project *Project, uri lsproto.DocumentUri) *ls.LanguageService { + snapshot := s.getSnapshot( + ctx, + ResourceRequest{Projects: []tspath.Path{project.Id()}}, + ) + // Ensure we have updated project + project = snapshot.ProjectCollection.GetProjectByPath(project.Id()) if project == nil { - return nil, fmt.Errorf("no project found for URI %s", uri) + return nil } - return ls.NewLanguageService(project.GetProgram(), snapshot), nil + // if program doesnt contain this file any more ignore it + if !project.HasFile(uri.FileName()) { + return nil + } + return ls.NewLanguageService(project.GetProgram(), snapshot) +} + +func (s *Session) GetSnapshotLoadingProjectTree( + ctx context.Context, + // If null, all project trees need to be loaded, otherwise only those that are referenced + requestedProjectTrees map[tspath.Path]struct{}, +) *Snapshot { + snapshot := s.getSnapshot( + ctx, + ResourceRequest{ProjectTree: &ProjectTreeRequest{requestedProjectTrees}}, + ) + return snapshot } func (s *Session) UpdateSnapshot(ctx context.Context, overlays map[tspath.Path]*Overlay, change SnapshotChange) *Snapshot { diff --git a/pkg/project/snapshot.go b/pkg/project/snapshot.go index f08dc1960..0d6fe6a70 100644 --- a/pkg/project/snapshot.go +++ b/pkg/project/snapshot.go @@ -3,6 +3,8 @@ package project import ( "context" "fmt" + "maps" + "slices" "sync/atomic" "time" @@ -76,6 +78,13 @@ func (s *Snapshot) GetDefaultProject(uri lsproto.DocumentUri) *Project { return s.ProjectCollection.GetDefaultProject(fileName, path) } +func (s *Snapshot) GetProjectsContainingFile(uri lsproto.DocumentUri) []*Project { + fileName := uri.FileName() + path := s.toPath(fileName) + // TODO!! sheetal may be change this to handle symlinks!! + return s.ProjectCollection.GetProjectsContainingFile(path) +} + func (s *Snapshot) GetFile(fileName string) FileHandle { return s.fs.GetFile(fileName) } @@ -128,13 +137,30 @@ type APISnapshotRequest struct { UpdateProjects *collections.Set[tspath.Path] } +type ProjectTreeRequest struct { + // If null, all project trees need to be loaded, otherwise only those that are referenced + referencedProjects map[tspath.Path]struct{} +} + +type ResourceRequest struct { + // Documents are URIs that were requested by the client. + // The new snapshot should ensure projects for these URIs have loaded programs. + // If the requested Documents are not open, ensure that their default project is created + Documents []lsproto.DocumentUri + // Update requested Projects. + // this is used when we want to get LS and from all the Projects the file can be part of + Projects []tspath.Path + // Update and ensure project trees that reference the projects + // This is used to compute the solution and project tree so that + // we can find references across all the projects in the solution irrespective of which project is open + ProjectTree *ProjectTreeRequest +} + type SnapshotChange struct { + ResourceRequest reason UpdateReason // fileChanges are the changes that have occurred since the last snapshot. fileChanges FileChangeSummary - // requestedURIs are URIs that were requested by the client. - // The new snapshot should ensure projects for these URIs have loaded programs. - requestedURIs []lsproto.DocumentUri // compilerOptionsForInferredProjects is the compiler options to use for inferred projects. // It should only be set the value in the next snapshot should be changed. If nil, the // value from the previous snapshot will be copied to the new snapshot. @@ -179,17 +205,34 @@ func (s *Snapshot) Clone(ctx context.Context, change SnapshotChange, overlays ma if session.options.LoggingEnabled { logger = logging.NewLogTree(fmt.Sprintf("Cloning snapshot %d", s.id)) + getDetails := func() string { + details := "" + if len(change.Documents) != 0 { + details += fmt.Sprintf(" Documents: %v", change.Documents) + } + if len(change.Projects) != 0 { + details += fmt.Sprintf(" Projects: %v", change.Projects) + } + if change.ProjectTree != nil { + details += fmt.Sprintf(" ProjectTree: %v", slices.Collect(maps.Keys(change.ProjectTree.referencedProjects))) + } + return details + } switch change.reason { case UpdateReasonDidOpenFile: logger.Logf("Reason: DidOpenFile - %s", change.fileChanges.Opened) case UpdateReasonDidChangeCompilerOptionsForInferredProjects: logger.Logf("Reason: DidChangeCompilerOptionsForInferredProjects") case UpdateReasonRequestedLanguageServicePendingChanges: - logger.Logf("Reason: RequestedLanguageService (pending file changes) - %v", change.requestedURIs) + logger.Logf("Reason: RequestedLanguageService (pending file changes) - %v", getDetails()) case UpdateReasonRequestedLanguageServiceProjectNotLoaded: - logger.Logf("Reason: RequestedLanguageService (project not loaded) - %v", change.requestedURIs) + logger.Logf("Reason: RequestedLanguageService (project not loaded) - %v", getDetails()) + case UpdateReasonRequestedLanguageServiceForFileNotOpen: + logger.Logf("Reason: RequestedLanguageService (file not open) - %v", getDetails()) case UpdateReasonRequestedLanguageServiceProjectDirty: - logger.Logf("Reason: RequestedLanguageService (project dirty) - %v", change.requestedURIs) + logger.Logf("Reason: RequestedLanguageService (project dirty) - %v", getDetails()) + case UpdateReasonRequestedLoadProjectTree: + logger.Logf("Reason: RequestedLoadProjectTree - %v", getDetails()) } } @@ -244,10 +287,18 @@ func (s *Snapshot) Clone(ctx context.Context, change SnapshotChange, overlays ma projectCollectionBuilder.DidChangeFiles(change.fileChanges, logger.Fork("DidChangeFiles")) } - for _, uri := range change.requestedURIs { + for _, uri := range change.Documents { projectCollectionBuilder.DidRequestFile(uri, logger.Fork("DidRequestFile")) } + for _, projectId := range change.Projects { + projectCollectionBuilder.DidRequestProject(projectId, logger.Fork("DidRequestProject")) + } + + if change.ProjectTree != nil { + projectCollectionBuilder.DidRequestProjectTrees(change.ProjectTree.referencedProjects, logger.Fork("DidRequestProjectTrees")) + } + projectCollection, configFileRegistry := projectCollectionBuilder.Finalize(logger) // Clean cached disk files not touched by any open project. It's not important that we do this on @@ -266,7 +317,7 @@ func (s *Snapshot) Clone(ctx context.Context, change SnapshotChange, overlays ma removedFiles := 0 fs.diskFiles.Range(func(entry *dirty.SyncMapEntry[tspath.Path, *diskFile]) bool { for _, project := range projectCollection.Projects() { - if project.host.seenFiles.Has(entry.Key()) { + if project.host != nil && project.host.seenFiles.Has(entry.Key()) { return true } } diff --git a/pkg/project/snapshotfs.go b/pkg/project/snapshotfs.go index 70bdc9016..816ac88a6 100644 --- a/pkg/project/snapshotfs.go +++ b/pkg/project/snapshotfs.go @@ -54,6 +54,12 @@ func (s *SnapshotFS) GetFile(fileName string) FileHandle { return entry() } +func (s *SnapshotFS) isOpenFile(fileName string) bool { + path := s.toPath(fileName) + _, ok := s.overlays[path] + return ok +} + type snapshotFSBuilder struct { fs vfs.FS overlays map[tspath.Path]*Overlay @@ -92,6 +98,11 @@ func (s *snapshotFSBuilder) Finalize() (*SnapshotFS, bool) { }, changed } +func (s *snapshotFSBuilder) isOpenFile(path tspath.Path) bool { + _, ok := s.overlays[path] + return ok +} + func (s *snapshotFSBuilder) GetFile(fileName string) FileHandle { path := s.toPath(fileName) return s.GetFileByPath(fileName, path) diff --git a/pkg/project/untitled_test.go b/pkg/project/untitled_test.go index a6667c3ab..e282c50e5 100644 --- a/pkg/project/untitled_test.go +++ b/pkg/project/untitled_test.go @@ -71,7 +71,9 @@ x++;` Context: &lsproto.ReferenceContext{IncludeDeclaration: true}, } - resp, err := languageService.ProvideReferences(ctx, refParams) + originalNode, symbolAndEntries, ok := languageService.ProvideSymbolsAndEntries(ctx, refParams.TextDocumentURI(), refParams.Position, false) + assert.Assert(t, ok) + resp, err := languageService.ProvideReferencesFromSymbolAndEntries(ctx, refParams, originalNode, symbolAndEntries) assert.NilError(t, err) refs := *resp.Locations @@ -144,7 +146,9 @@ x++;` Context: &lsproto.ReferenceContext{IncludeDeclaration: true}, } - resp, err := languageService.ProvideReferences(ctx, refParams) + originalNode, symbolAndEntries, ok := languageService.ProvideSymbolsAndEntries(ctx, refParams.TextDocumentURI(), refParams.Position, false) + assert.Assert(t, ok) + resp, err := languageService.ProvideReferencesFromSymbolAndEntries(ctx, refParams, originalNode, symbolAndEntries) assert.NilError(t, err) refs := *resp.Locations diff --git a/pkg/sourcemap/util.go b/pkg/sourcemap/util.go index cd87929bf..93f9e18cb 100644 --- a/pkg/sourcemap/util.go +++ b/pkg/sourcemap/util.go @@ -9,18 +9,20 @@ import ( // Tries to find the sourceMappingURL comment at the end of a file. func TryGetSourceMappingURL(lineInfo *ECMALineInfo) string { - for index := lineInfo.LineCount() - 1; index >= 0; index-- { - line := lineInfo.LineText(index) - line = strings.TrimLeftFunc(line, unicode.IsSpace) - line = strings.TrimRightFunc(line, stringutil.IsLineBreak) - if len(line) == 0 { - continue - } - if len(line) < 4 || !strings.HasPrefix(line, "//") || line[2] != '#' && line[2] != '@' || line[3] != ' ' { - break - } - if url, ok := strings.CutPrefix(line[4:], "sourceMappingURL="); ok { - return strings.TrimRightFunc(url, unicode.IsSpace) + if lineInfo != nil { + for index := lineInfo.LineCount() - 1; index >= 0; index-- { + line := lineInfo.LineText(index) + line = strings.TrimLeftFunc(line, unicode.IsSpace) + line = strings.TrimRightFunc(line, stringutil.IsLineBreak) + if len(line) == 0 { + continue + } + if len(line) < 4 || !strings.HasPrefix(line, "//") || line[2] != '#' && line[2] != '@' || line[3] != ' ' { + break + } + if url, ok := strings.CutPrefix(line[4:], "sourceMappingURL="); ok { + return strings.TrimRightFunc(url, unicode.IsSpace) + } } } return "" diff --git a/pkg/stringutil/format.go b/pkg/stringutil/format.go deleted file mode 100644 index 3c52e36d4..000000000 --- a/pkg/stringutil/format.go +++ /dev/null @@ -1,19 +0,0 @@ -package stringutil - -import ( - "fmt" - "regexp" - "strconv" -) - -var placeholderRegexp = regexp.MustCompile(`{(\d+)}`) - -func Format(text string, args []any) string { - return placeholderRegexp.ReplaceAllStringFunc(text, func(match string) string { - index, err := strconv.ParseInt(match[1:len(match)-1], 10, 0) - if err != nil || int(index) >= len(args) { - panic("Invalid formatting placeholder") - } - return fmt.Sprintf("%v", args[int(index)]) - }) -} diff --git a/pkg/testutil/fsbaselineutil/differ.go b/pkg/testutil/fsbaselineutil/differ.go new file mode 100644 index 000000000..423a14ed1 --- /dev/null +++ b/pkg/testutil/fsbaselineutil/differ.go @@ -0,0 +1,122 @@ +package fsbaselineutil + +import ( + "fmt" + "io" + "io/fs" + "maps" + "slices" + "time" + + "github.com/buke/typescript-go-internal/pkg/collections" + "github.com/buke/typescript-go-internal/pkg/vfs/iovfs" + "github.com/buke/typescript-go-internal/pkg/vfs/vfstest" +) + +type DiffEntry struct { + Content string + MTime time.Time + IsWritten bool + SymlinkTarget string +} + +type Snapshot struct { + Snap map[string]*DiffEntry + DefaultLibs *collections.SyncSet[string] +} + +type FSDiffer struct { + FS iovfs.FsWithSys + DefaultLibs func() *collections.SyncSet[string] + WrittenFiles *collections.SyncSet[string] + + serializedDiff *Snapshot +} + +func (d *FSDiffer) MapFs() *vfstest.MapFS { + return d.FS.FSys().(*vfstest.MapFS) +} + +func (d *FSDiffer) SerializedDiff() *Snapshot { + return d.serializedDiff +} + +func (d *FSDiffer) BaselineFSwithDiff(baseline io.Writer) { + // todo: baselines the entire fs, possibly doesn't correctly diff all cases of emitted files, since emit isn't fully implemented and doesn't always emit the same way as strada + snap := map[string]*DiffEntry{} + + diffs := map[string]string{} + + for path, file := range d.MapFs().Entries() { + if file.Mode&fs.ModeSymlink != 0 { + target, ok := d.MapFs().GetTargetOfSymlink(path) + if !ok { + panic("Failed to resolve symlink target: " + path) + } + newEntry := &DiffEntry{SymlinkTarget: target} + snap[path] = newEntry + d.addFsEntryDiff(diffs, newEntry, path) + continue + } else if file.Mode.IsRegular() { + newEntry := &DiffEntry{Content: string(file.Data), MTime: file.ModTime, IsWritten: d.WrittenFiles.Has(path)} + snap[path] = newEntry + d.addFsEntryDiff(diffs, newEntry, path) + } + } + if d.serializedDiff != nil { + for path := range d.serializedDiff.Snap { + if fileInfo := d.MapFs().GetFileInfo(path); fileInfo == nil { + // report deleted + d.addFsEntryDiff(diffs, nil, path) + } + } + } + var defaultLibs collections.SyncSet[string] + if d.DefaultLibs != nil && d.DefaultLibs() != nil { + d.DefaultLibs().Range(func(libPath string) bool { + defaultLibs.Add(libPath) + return true + }) + } + d.serializedDiff = &Snapshot{ + Snap: snap, + DefaultLibs: &defaultLibs, + } + diffKeys := slices.Collect(maps.Keys(diffs)) + slices.Sort(diffKeys) + for _, path := range diffKeys { + fmt.Fprint(baseline, "//// ["+path+"] ", diffs[path], "\n") + } + fmt.Fprintln(baseline) + *d.WrittenFiles = collections.SyncSet[string]{} // Reset written files after baseline +} + +func (d *FSDiffer) addFsEntryDiff(diffs map[string]string, newDirContent *DiffEntry, path string) { + var oldDirContent *DiffEntry + var defaultLibs *collections.SyncSet[string] + if d.serializedDiff != nil { + oldDirContent = d.serializedDiff.Snap[path] + defaultLibs = d.serializedDiff.DefaultLibs + } + // todo handle more cases of fs changes + if oldDirContent == nil { + if d.DefaultLibs == nil || d.DefaultLibs() == nil || !d.DefaultLibs().Has(path) { + if newDirContent.SymlinkTarget != "" { + diffs[path] = "-> " + newDirContent.SymlinkTarget + " *new*" + } else { + diffs[path] = "*new* \n" + newDirContent.Content + } + } + } else if newDirContent == nil { + diffs[path] = "*deleted*" + } else if newDirContent.Content != oldDirContent.Content { + diffs[path] = "*modified* \n" + newDirContent.Content + } else if newDirContent.IsWritten { + diffs[path] = "*rewrite with same content*" + } else if newDirContent.MTime != oldDirContent.MTime { + diffs[path] = "*mTime changed*" + } else if defaultLibs != nil && defaultLibs.Has(path) && d.DefaultLibs != nil && d.DefaultLibs() != nil && !d.DefaultLibs().Has(path) { + // Lib file that was read + diffs[path] = "*Lib*\n" + newDirContent.Content + } +} diff --git a/pkg/testutil/harnessutil/harnessutil.go b/pkg/testutil/harnessutil/harnessutil.go index bb8805aa2..c16c488b4 100644 --- a/pkg/testutil/harnessutil/harnessutil.go +++ b/pkg/testutil/harnessutil/harnessutil.go @@ -21,7 +21,9 @@ import ( "github.com/buke/typescript-go-internal/pkg/collections" "github.com/buke/typescript-go-internal/pkg/compiler" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/execute/incremental" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/outputpaths" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/repo" @@ -531,8 +533,8 @@ func NewTracerForBaselining(opts tspath.ComparePathsOptions, builder *strings.Bu } } -func (t *TracerForBaselining) Trace(msg string) { - t.TraceWithWriter(t.builder, msg, true) +func (t *TracerForBaselining) Trace(msg *diagnostics.Message, args ...any) { + t.TraceWithWriter(t.builder, msg.Localize(locale.Default, args...), true) } func (t *TracerForBaselining) TraceWithWriter(w io.Writer, msg string, usePackageJsonCache bool) { diff --git a/pkg/testutil/projecttestutil/projecttestutil.go b/pkg/testutil/projecttestutil/projecttestutil.go index 60ceec268..b731b97a9 100644 --- a/pkg/testutil/projecttestutil/projecttestutil.go +++ b/pkg/testutil/projecttestutil/projecttestutil.go @@ -15,6 +15,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/project/logging" "github.com/buke/typescript-go-internal/pkg/testutil/baseline" "github.com/buke/typescript-go-internal/pkg/vfs" + "github.com/buke/typescript-go-internal/pkg/vfs/iovfs" "github.com/buke/typescript-go-internal/pkg/vfs/vfstest" ) @@ -34,11 +35,16 @@ type TypingsInstallerOptions struct { } type SessionUtils struct { - fs vfs.FS - client *ClientMock - npmExecutor *NpmExecutorMock - tiOptions *TypingsInstallerOptions - logger logging.LogCollector + fsFromFileMap iovfs.FsWithSys + fs vfs.FS + client *ClientMock + npmExecutor *NpmExecutorMock + tiOptions *TypingsInstallerOptions + logger logging.LogCollector +} + +func (h *SessionUtils) FsFromFileMap() iovfs.FsWithSys { + return h.fsFromFileMap } func (h *SessionUtils) Client() *ClientMock { @@ -192,15 +198,28 @@ func SetupWithTypingsInstaller(files map[string]any, tiOptions *TypingsInstaller } func SetupWithOptionsAndTypingsInstaller(files map[string]any, options *project.SessionOptions, tiOptions *TypingsInstallerOptions) (*project.Session, *SessionUtils) { - fs := bundled.WrapFS(vfstest.FromMap(files, false /*useCaseSensitiveFileNames*/)) + init, sessionUtils := GetSessionInitOptions(files, options, tiOptions) + session := project.NewSession(init) + + return session, sessionUtils +} + +func WithRequestID(ctx context.Context) context.Context { + return core.WithRequestID(ctx, "0") +} + +func GetSessionInitOptions(files map[string]any, options *project.SessionOptions, tiOptions *TypingsInstallerOptions) (*project.SessionInit, *SessionUtils) { + fsFromFileMap := vfstest.FromMap(files, false /*useCaseSensitiveFileNames*/) + fs := bundled.WrapFS(fsFromFileMap) clientMock := &ClientMock{} npmExecutorMock := &NpmExecutorMock{} sessionUtils := &SessionUtils{ - fs: fs, - client: clientMock, - npmExecutor: npmExecutorMock, - tiOptions: tiOptions, - logger: logging.NewTestLogger(), + fsFromFileMap: fsFromFileMap.(iovfs.FsWithSys), + fs: fs, + client: clientMock, + npmExecutor: npmExecutorMock, + tiOptions: tiOptions, + logger: logging.NewTestLogger(), } // Configure the npm executor mock to handle typings installation @@ -219,17 +238,11 @@ func SetupWithOptionsAndTypingsInstaller(files map[string]any, options *project. } } - session := project.NewSession(&project.SessionInit{ + return &project.SessionInit{ Options: options, FS: fs, Client: clientMock, NpmExecutor: npmExecutorMock, Logger: sessionUtils.logger, - }) - - return session, sessionUtils -} - -func WithRequestID(ctx context.Context) context.Context { - return core.WithRequestID(ctx, "0") + }, sessionUtils } diff --git a/pkg/testutil/stringtestutil/stringtestutil.go b/pkg/testutil/stringtestutil/stringtestutil.go index 3796c0bda..a10b68009 100644 --- a/pkg/testutil/stringtestutil/stringtestutil.go +++ b/pkg/testutil/stringtestutil/stringtestutil.go @@ -29,7 +29,15 @@ func Dedent(text string) string { } } lines = lines[startLine : lastLine+1] - indentation := stringutil.GuessIndentation(lines) + mappedLines := make([]string, len(lines)) + for i, line := range lines { + if trimmed := strings.TrimSpace(line); trimmed == "" { + mappedLines[i] = "" + } else { + mappedLines[i] = line + } + } + indentation := stringutil.GuessIndentation(mappedLines) if indentation > 0 { for i := range lines { if len(lines[i]) > indentation { diff --git a/pkg/testutil/tsbaseline/error_baseline.go b/pkg/testutil/tsbaseline/error_baseline.go index 74c385ca0..6810a333a 100644 --- a/pkg/testutil/tsbaseline/error_baseline.go +++ b/pkg/testutil/tsbaseline/error_baseline.go @@ -12,6 +12,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnosticwriter" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/testutil/baseline" "github.com/buke/typescript-go-internal/pkg/testutil/harnessutil" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -91,7 +92,7 @@ func iterateErrorBaseline[T diagnosticwriter.Diagnostic](t *testing.T, inputFile var result []string outputErrorText := func(diag diagnosticwriter.Diagnostic) { - message := diagnosticwriter.FlattenDiagnosticMessage(diag, harnessNewLine) + message := diagnosticwriter.FlattenDiagnosticMessage(diag, harnessNewLine, locale.Default) var errLines []string for line := range strings.SplitSeq(removeTestPathPrefixes(message, false), "\n") { @@ -112,7 +113,7 @@ func iterateErrorBaseline[T diagnosticwriter.Diagnostic](t *testing.T, inputFile if len(location) > 0 && isDefaultLibraryFile(info.File().FileName()) { location = diagnosticsLocationPattern.ReplaceAllString(location, "$1:--:--") } - errLines = append(errLines, fmt.Sprintf("!!! related TS%d%s: %s", info.Code(), location, diagnosticwriter.FlattenDiagnosticMessage(info, harnessNewLine))) + errLines = append(errLines, fmt.Sprintf("!!! related TS%d%s: %s", info.Code(), location, diagnosticwriter.FlattenDiagnosticMessage(info, harnessNewLine, locale.Default))) } for _, e := range errLines { diff --git a/pkg/tsoptions/commandlineoption.go b/pkg/tsoptions/commandlineoption.go index 218a6fb69..a5bc067ac 100644 --- a/pkg/tsoptions/commandlineoption.go +++ b/pkg/tsoptions/commandlineoption.go @@ -35,8 +35,8 @@ type CommandLineOption struct { // used in output in serializing and generate tsconfig Category *diagnostics.Message - // a flag indicating whether `validateJsonOptionValue` should perform extra checks - extraValidation bool + // What kind of extra validation `validateJsonOptionValue` should do + extraValidation extraValidation // true or undefined // used for configDirTemplateSubstitutionOptions @@ -65,6 +65,14 @@ type CommandLineOption struct { ElementOptions CommandLineOptionNameMap } +type extraValidation string + +const ( + extraValidationNone extraValidation = "" + extraValidationSpec extraValidation = "spec" + extraValidationLocale extraValidation = "locale" +) + func (o *CommandLineOption) DeprecatedKeys() *collections.Set[string] { if o.Kind != CommandLineOptionTypeEnum { return nil @@ -149,13 +157,13 @@ var commandLineOptionElements = map[string]*CommandLineOption{ Name: "excludeDirectory", Kind: CommandLineOptionTypeString, IsFilePath: true, - extraValidation: true, + extraValidation: extraValidationSpec, }, "excludeFiles": { Name: "excludeFile", Kind: CommandLineOptionTypeString, IsFilePath: true, - extraValidation: true, + extraValidation: extraValidationSpec, }, // Test infra options "libFiles": { diff --git a/pkg/tsoptions/declscompiler.go b/pkg/tsoptions/declscompiler.go index b782dcf79..755a0cb89 100644 --- a/pkg/tsoptions/declscompiler.go +++ b/pkg/tsoptions/declscompiler.go @@ -211,6 +211,7 @@ var commonOptionsWithBuild = []*CommandLineOption{ IsCommandLineOnly: true, Description: diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, DefaultValueDescription: diagnostics.Platform_specific, + extraValidation: extraValidationLocale, }, { diff --git a/pkg/tsoptions/parsedbuildcommandline.go b/pkg/tsoptions/parsedbuildcommandline.go index b4d507862..e440f425f 100644 --- a/pkg/tsoptions/parsedbuildcommandline.go +++ b/pkg/tsoptions/parsedbuildcommandline.go @@ -5,6 +5,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/tspath" ) @@ -19,6 +20,9 @@ type ParsedBuildCommandLine struct { resolvedProjectPaths []string resolvedProjectPathsOnce sync.Once + + locale locale.Locale + localeOnce sync.Once } func (p *ParsedBuildCommandLine) ResolvedProjectPaths() []string { @@ -31,3 +35,10 @@ func (p *ParsedBuildCommandLine) ResolvedProjectPaths() []string { }) return p.resolvedProjectPaths } + +func (p *ParsedBuildCommandLine) Locale() locale.Locale { + p.localeOnce.Do(func() { + p.locale, _ = locale.Parse(p.CompilerOptions.Locale) + }) + return p.locale +} diff --git a/pkg/tsoptions/parsedcommandline.go b/pkg/tsoptions/parsedcommandline.go index 61bccb39d..84af535a8 100644 --- a/pkg/tsoptions/parsedcommandline.go +++ b/pkg/tsoptions/parsedcommandline.go @@ -10,6 +10,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/ast" "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/glob" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/module" "github.com/buke/typescript-go-internal/pkg/outputpaths" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -49,6 +50,9 @@ type ParsedCommandLine struct { literalFileNamesLen int fileNamesByPath map[tspath.Path]string // maps file names to their paths, used for quick lookups fileNamesByPathOnce sync.Once + + locale locale.Locale + localeOnce sync.Once } func NewParsedCommandLine( @@ -379,3 +383,10 @@ func (p *ParsedCommandLine) ReloadFileNamesOfParsedCommandLine(fs vfs.FS) *Parse } return &parsedCommandLine } + +func (p *ParsedCommandLine) Locale() locale.Locale { + p.localeOnce.Do(func() { + p.locale, _ = locale.Parse(p.CompilerOptions().Locale) + }) + return p.locale +} diff --git a/pkg/tsoptions/tsconfigparsing.go b/pkg/tsoptions/tsconfigparsing.go index aacfb4213..8ed432735 100644 --- a/pkg/tsoptions/tsconfigparsing.go +++ b/pkg/tsoptions/tsconfigparsing.go @@ -14,6 +14,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/debug" "github.com/buke/typescript-go-internal/pkg/diagnostics" "github.com/buke/typescript-go-internal/pkg/jsnum" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/module" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/tspath" @@ -359,13 +360,22 @@ func validateJsonOptionValue( if val == nil { return nil, nil } - errors := []*ast.Diagnostic{} - if opt.extraValidation { - diag := specToDiagnostic(val.(string), false) - if diag != nil { + + var errors []*ast.Diagnostic + + switch opt.extraValidation { + case extraValidationSpec: + if diag := specToDiagnostic(val.(string), false); diag != nil { errors = append(errors, CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, diag)) - return nil, errors } + case extraValidationLocale: + if _, ok := locale.Parse(val.(string)); !ok { + errors = append(errors, CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, diagnostics.Locale_must_be_an_IETF_BCP_47_language_tag_Examples_Colon_0_1, "en", "ja-jp")) + } + } + + if len(errors) > 0 { + return nil, errors } return val, nil } diff --git a/pkg/tsoptions/tsconfigparsing_test.go b/pkg/tsoptions/tsconfigparsing_test.go index 4dc40557a..6f5003351 100644 --- a/pkg/tsoptions/tsconfigparsing_test.go +++ b/pkg/tsoptions/tsconfigparsing_test.go @@ -14,6 +14,7 @@ import ( "github.com/buke/typescript-go-internal/pkg/core" "github.com/buke/typescript-go-internal/pkg/diagnosticwriter" "github.com/buke/typescript-go-internal/pkg/jsonutil" + "github.com/buke/typescript-go-internal/pkg/locale" "github.com/buke/typescript-go-internal/pkg/parser" "github.com/buke/typescript-go-internal/pkg/repo" "github.com/buke/typescript-go-internal/pkg/testutil/baseline" @@ -1025,7 +1026,7 @@ func TestParseSrcCompiler(t *testing.T) { if len(parsed.Diagnostics()) > 0 { for _, error := range parsed.Diagnostics() { - t.Log(error.Message()) + t.Log(error.Localize(locale.Default)) } t.FailNow() } @@ -1047,7 +1048,7 @@ func TestParseSrcCompiler(t *testing.T) { if len(parseConfigFileContent.Errors) > 0 { for _, error := range parseConfigFileContent.Errors { - t.Log(error.Message()) + t.Log(error.Localize(locale.Default)) } t.FailNow() } diff --git a/testdata/baselines/reference/fourslash/findAllReferences/autoImportProvider_referencesCrash.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/autoImportProvider_referencesCrash.baseline.jsonc index a1f16decc..4d12d4f3f 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/autoImportProvider_referencesCrash.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/autoImportProvider_referencesCrash.baseline.jsonc @@ -1,8 +1,6 @@ // === findAllReferences === -// === /home/src/workspaces/project/a/index.d.ts === -// declare class [|A|] { -// } -// //# sourceMappingURL=index.d.ts.map +// === /home/src/workspaces/project/a/index.ts === +// class A {}[||] // === /home/src/workspaces/project/b/b.ts === // /// diff --git a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc index 63169a81f..e6b3049cf 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc @@ -6,6 +6,10 @@ // === findAllReferences === +// === /node_modules/@types/three/index.d.ts === +// export * from "[|./three-core|]"; +// export as namespace THREE; + // === /typings/global.d.ts === // import * as _THREE from '/*FIND ALL REFS*/[|three|]'; // declare global { diff --git a/testdata/baselines/reference/fourslash/findAllReferences/isDefinitionAcrossModuleProjects.baseline.jsonc b/testdata/baselines/reference/fourslash/findAllReferences/isDefinitionAcrossModuleProjects.baseline.jsonc index 4c80f3759..00448c0d6 100644 --- a/testdata/baselines/reference/fourslash/findAllReferences/isDefinitionAcrossModuleProjects.baseline.jsonc +++ b/testdata/baselines/reference/fourslash/findAllReferences/isDefinitionAcrossModuleProjects.baseline.jsonc @@ -43,6 +43,27 @@ // FC() { }, // }; +// === /home/src/workspaces/project/a2/index.ts === +// import { NS } from "../b"; +// import { [|I|] } from "../c"; +// +// declare module "../b" { +// export namespace NS { +// export function FA(); +// } +// } +// +// declare module "../c" { +// export interface [|I|] { +// FA(); +// } +// } +// +// const ia: [|I|] = { +// FA: NS.FA, +// FC() { }, +// }; + // === /home/src/workspaces/project/c/index.ts === // export namespace NS { // export function FC() {} @@ -97,6 +118,27 @@ // === findAllReferences === +// === /home/src/workspaces/project/a/index.ts === +// import { NS } from "../b"; +// import { [|I|] } from "../c"; +// +// declare module "../b" { +// export namespace NS { +// export function FA(); +// } +// } +// +// declare module "../c" { +// export interface [|I|] { +// FA(); +// } +// } +// +// const ia: [|I|] = { +// FA: NS.FA, +// FC() { }, +// }; + // === /home/src/workspaces/project/a2/index.ts === // import { NS } from "../b"; // import { [|I|] } from "../c"; @@ -199,6 +241,48 @@ // === findAllReferences === +// === /home/src/workspaces/project/a/index.ts === +// import { NS } from "../b"; +// import { [|I|] } from "../c"; +// +// declare module "../b" { +// export namespace NS { +// export function FA(); +// } +// } +// +// declare module "../c" { +// export interface [|I|] { +// FA(); +// } +// } +// +// const ia: [|I|] = { +// FA: NS.FA, +// FC() { }, +// }; + +// === /home/src/workspaces/project/a2/index.ts === +// import { NS } from "../b"; +// import { [|I|] } from "../c"; +// +// declare module "../b" { +// export namespace NS { +// export function FA(); +// } +// } +// +// declare module "../c" { +// export interface [|I|] { +// FA(); +// } +// } +// +// const ia: [|I|] = { +// FA: NS.FA, +// FC() { }, +// }; + // === /home/src/workspaces/project/c/index.ts === // export namespace NS { // export function FC() {} @@ -213,6 +297,22 @@ // === findAllReferences === +// === /home/src/workspaces/project/a/index.ts === +// --- (line: 14) skipped --- +// +// const ia: I = { +// FA: NS.FA, +// [|FC|]() { }, +// }; + +// === /home/src/workspaces/project/a2/index.ts === +// --- (line: 14) skipped --- +// +// const ia: I = { +// FA: NS.FA, +// [|FC|]() { }, +// }; + // === /home/src/workspaces/project/c/index.ts === // export namespace NS { // export function FC() {} diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline new file mode 100644 index 000000000..3403e09e0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefs.baseline @@ -0,0 +1,170 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + }, + "position": { + "line": 2, + "character": 29 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/dev/null/inferred] + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /a/tsconfig.json + + + + +// === findAllReferences === +// === /a/a.ts === +// export function [|fnA|]() {} +// export interface IfaceA {} +// export const instanceA: IfaceA = {}; + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a./*FIND ALL REFS*/[|fnA|](); b.fnB(); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/a/tsconfig.json] *deleted* + /a/a.ts + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *deleted* + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline new file mode 100644 index 000000000..86588d554 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsDefinitionInMappedFile.baseline @@ -0,0 +1,109 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function f() {} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "../bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/b.ts] *new* +import { f } from "../bin/a"; +f(); +//// [/b/tsconfig.json] *new* +{ + "references": [ + { "path": "../a" } + ] +} +//// [/bin/a.d.ts] *new* +export declare function f(): void; +//# sourceMappingURL=a.d.ts.map +//// [/bin/a.d.ts.map] *new* +{ + "version":3, + "file":"a.d.ts", + "sourceRoot":"", + "sources":["a.ts"], + "names":[], + "mappings":"AAAA,wBAAgB,CAAC,SAAK" +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///b/b.ts", + "languageId": "typescript", + "version": 0, + "text": "import { f } from \"../bin/a\";\nf();" + } + } +} + +Projects:: + [/b/tsconfig.json] *new* + /a/a.ts + /b/b.ts +Open Files:: + [/b/b.ts] *new* + /b/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + [/b/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts +Config File Names:: + [/b/b.ts] *new* + NearestConfigFileName: /b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///b/b.ts" + }, + "position": { + "line": 1, + "character": 0 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/b/tsconfig.json] + /a/a.ts + /b/b.ts +Config:: + [/a/tsconfig.json] *modified* + RetainingProjects: *modified* + /a/tsconfig.json *new* + /b/tsconfig.json + [/b/tsconfig.json] + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts + + + + +// === findAllReferences === +// === /a/a.ts === +// export function [|f|]() {} + +// === /b/b.ts === +// import { [|f|] } from "../bin/a"; +// /*FIND ALL REFS*/[|f|](); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline new file mode 100644 index 000000000..e11f907ae --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsStartingAtDefinition.baseline @@ -0,0 +1,208 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///a/a.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};" + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/dev/null/inferred] + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/a/a.ts] *new* + /a/tsconfig.json (default) + [/user/user.ts] + /dev/null/inferred (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /a/tsconfig.json + RetainingOpenFiles: + /a/a.ts +Config File Names:: + [/a/a.ts] *new* + NearestConfigFileName: /a/tsconfig.json + Ancestors: + /a/tsconfig.json + [/user/user.ts] + NearestConfigFileName: + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///a/a.ts" + }, + "position": { + "line": 0, + "character": 16 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /a/a.ts === +// export function /*FIND ALL REFS*/[|fnA|]() {} +// export interface IfaceA {} +// export const instanceA: IfaceA = {}; + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a.[|fnA|](); b.fnB(); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/a/a.ts] + /a/tsconfig.json (default) + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/a/tsconfig.json] + /a/a.ts + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/a/a.ts] + /a/tsconfig.json (default) + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/a/tsconfig.json] + RetainingProjects: + /a/tsconfig.json + RetainingOpenFiles: + /a/a.ts + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/a/a.ts] + NearestConfigFileName: /a/tsconfig.json + Ancestors: + /a/tsconfig.json + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline new file mode 100644 index 000000000..c07f94032 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsFindAllRefsTargetDoesNotExist.baseline @@ -0,0 +1,154 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + }, + "position": { + "line": 2, + "character": 38 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /b/bin/b.d.ts === +// export declare function [|fnB|](): void; +// //# sourceMappingURL=b.d.ts.map + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a.fnA(); b./*FIND ALL REFS*/[|fnB|](); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline new file mode 100644 index 000000000..19bddaea8 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProject.baseline @@ -0,0 +1,107 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.d.ts] *new* +export declare class A { +} +//# sourceMappingURL=a.d.ts.map +//// [/a/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["./a.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;CAAI" +} +//// [/a/a.ts] *new* +export class A { } +//// [/a/tsconfig.json] *new* +{} +//// [/b/b.ts] *new* +import {A} from "../a/a"; +new A(); +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "references": [ + { "path": "../a" } + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///b/b.ts", + "languageId": "typescript", + "version": 0, + "text": "import {A} from \"../a/a\";\nnew A();" + } + } +} + +Projects:: + [/b/tsconfig.json] *new* + /a/a.ts + /b/b.ts +Open Files:: + [/b/b.ts] *new* + /b/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + [/b/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts +Config File Names:: + [/b/b.ts] *new* + NearestConfigFileName: /b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///b/b.ts" + }, + "position": { + "line": 1, + "character": 4 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/b/tsconfig.json] + /a/a.ts + /b/b.ts +Config:: + [/a/tsconfig.json] *modified* + RetainingProjects: *modified* + /a/tsconfig.json *new* + /b/tsconfig.json + [/b/tsconfig.json] + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts + + + + +// === findAllReferences === +// === /a/a.ts === +// export class [|A|] { } + +// === /b/b.ts === +// import {[|A|]} from "../a/a"; +// new /*FIND ALL REFS*/[|A|](); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline new file mode 100644 index 000000000..fa57e3f9a --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsOpeningOriginalLocationProjectDisableSourceOfProjectReferenceRedirect.baseline @@ -0,0 +1,107 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.d.ts] *new* +export declare class A { +} +//# sourceMappingURL=a.d.ts.map +//// [/a/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["./a.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;CAAI" +} +//// [/a/a.ts] *new* +export class A { } +//// [/a/tsconfig.json] *new* +{} +//// [/b/b.ts] *new* +import {A} from "../a/a"; +new A(); +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": true + }, + "references": [ + { "path": "../a" } + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///b/b.ts", + "languageId": "typescript", + "version": 0, + "text": "import {A} from \"../a/a\";\nnew A();" + } + } +} + +Projects:: + [/b/tsconfig.json] *new* + /a/a.d.ts + /b/b.ts +Open Files:: + [/b/b.ts] *new* + /b/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + [/b/tsconfig.json] *new* + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts +Config File Names:: + [/b/b.ts] *new* + NearestConfigFileName: /b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///b/b.ts" + }, + "position": { + "line": 1, + "character": 4 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/b/tsconfig.json] + /a/a.d.ts + /b/b.ts +Config:: + [/a/tsconfig.json] *modified* + RetainingProjects: *modified* + /a/tsconfig.json *new* + /b/tsconfig.json + [/b/tsconfig.json] + RetainingProjects: + /b/tsconfig.json + RetainingOpenFiles: + /b/b.ts + + + + +// === findAllReferences === +// === /a/a.ts === +// export class [|A|] { } + +// === /b/b.ts === +// import {[|A|]} from "../a/a"; +// new /*FIND ALL REFS*/[|A|](); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRename.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRename.baseline new file mode 100644 index 000000000..229282bed --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRename.baseline @@ -0,0 +1,168 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + }, + "position": { + "line": 2, + "character": 29 + }, + "newName": "?" + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/dev/null/inferred] + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /a/tsconfig.json + + + + +// === findRenameLocations === +// === /a/a.ts === +// export function [|fnARENAME|]() {} +// export interface IfaceA {} +// export const instanceA: IfaceA = {}; + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a./*RENAME*/[|fnARENAME|](); b.fnB(); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/a/tsconfig.json] *deleted* + /a/a.ts + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *deleted* + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameStartingAtDefinition.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameStartingAtDefinition.baseline new file mode 100644 index 000000000..eae0a698b --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameStartingAtDefinition.baseline @@ -0,0 +1,206 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///a/a.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};" + } + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/dev/null/inferred] + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/a/a.ts] *new* + /a/tsconfig.json (default) + [/user/user.ts] + /dev/null/inferred (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /a/tsconfig.json + RetainingOpenFiles: + /a/a.ts +Config File Names:: + [/a/a.ts] *new* + NearestConfigFileName: /a/tsconfig.json + Ancestors: + /a/tsconfig.json + [/user/user.ts] + NearestConfigFileName: + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///a/a.ts" + }, + "position": { + "line": 0, + "character": 16 + }, + "newName": "?" + } +} + + + + +// === findRenameLocations === +// === /a/a.ts === +// export function /*RENAME*/[|fnARENAME|]() {} +// export interface IfaceA {} +// export const instanceA: IfaceA = {}; + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a.[|fnARENAME|](); b.fnB(); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/a/a.ts] + /a/tsconfig.json (default) + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/a/tsconfig.json] + /a/a.ts + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/a/a.ts] + /a/tsconfig.json (default) + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/a/tsconfig.json] + RetainingProjects: + /a/tsconfig.json + RetainingOpenFiles: + /a/a.ts + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/a/a.ts] + NearestConfigFileName: /a/tsconfig.json + Ancestors: + /a/tsconfig.json + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameTargetDoesNotExist.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameTargetDoesNotExist.baseline new file mode 100644 index 000000000..4346f9eaf --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameTargetDoesNotExist.baseline @@ -0,0 +1,152 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/user.ts] *new* +import * as a from "../a/bin/a"; +import * as b from "../b/bin/b"; +export function fnUser() { a.fnA(); b.fnB(); a.instanceA; } + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/bin/a\";\nimport * as b from \"../b/bin/b\";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /dev/null/inferred (default) +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + }, + "position": { + "line": 2, + "character": 38 + }, + "newName": "?" + } +} + + + + +// === findRenameLocations === +// === /b/bin/b.d.ts === +// export declare function [|fnBRENAME|](): void; +// //# sourceMappingURL=b.d.ts.map + +// === /user/user.ts === +// import * as a from "../a/bin/a"; +// import * as b from "../b/bin/b"; +// export function fnUser() { a.fnA(); b./*RENAME*/[|fnBRENAME|](); a.instanceA; } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /a/bin/a.d.ts + /b/bin/b.d.ts + /user/user.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirect.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirect.baseline new file mode 100644 index 000000000..d810eb9bd --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirect.baseline @@ -0,0 +1,446 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": true + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": true + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/random/tsconfig.json] *new* + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/random/tsconfig.json] *new* + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/random/random.ts] *new* + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + [/random/tsconfig.json] + /random/random.ts +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] *new* + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] *closed* + [/random/random.ts] + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *deleted* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *deleted* + [/myproject/main/tsconfig.json] *deleted* + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *deleted* + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEdit.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEdit.baseline new file mode 100644 index 000000000..2d9b7d45c --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEdit.baseline @@ -0,0 +1,929 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": true + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": true + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 1 + }, + "end": { + "line": 0, + "character": 1 + } + }, + "text": "u" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 2 + }, + "end": { + "line": 0, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 3 + }, + "end": { + "line": 0, + "character": 3 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 4 + }, + "end": { + "line": 0, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 5 + }, + "end": { + "line": 0, + "character": 5 + } + }, + "text": "i" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 6 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 7 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 8 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 9 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 10 + }, + "end": { + "line": 0, + "character": 10 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 11 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 12 + }, + "end": { + "line": 0, + "character": 12 + } + }, + "text": "B" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 16 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 13 + }, + "end": { + "line": 0, + "character": 13 + } + }, + "text": "a" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 17 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 14 + } + }, + "text": "r" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 18 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 15 + }, + "end": { + "line": 0, + "character": 15 + } + }, + "text": "(" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 19 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 16 + }, + "end": { + "line": 0, + "character": 16 + } + }, + "text": ")" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 20 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 17 + }, + "end": { + "line": 0, + "character": 17 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 21 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 18 + } + }, + "text": "{" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 22 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 19 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 23 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 20 + }, + "end": { + "line": 0, + "character": 20 + } + }, + "text": "}" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 24 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 21 + } + }, + "text": "\n" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 3, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// function fooBar() { } +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// fn3, +// [|fn4RENAME|], +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// fn3(); +// [|fn4RENAME|](); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEditEnd.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEditEnd.baseline new file mode 100644 index 000000000..4a3267804 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithDisableSourceOfProjectReferenceRedirectEditEnd.baseline @@ -0,0 +1,703 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": true + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": true + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 1 + }, + "end": { + "line": 5, + "character": 1 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 2 + }, + "end": { + "line": 5, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 3 + }, + "end": { + "line": 5, + "character": 3 + } + }, + "text": "s" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 4 + }, + "end": { + "line": 5, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 5 + }, + "end": { + "line": 5, + "character": 5 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "text": "x" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 7 + }, + "end": { + "line": 5, + "character": 7 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 8 + }, + "end": { + "line": 5, + "character": 8 + } + }, + "text": "=" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 9 + }, + "end": { + "line": 5, + "character": 9 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 10 + }, + "end": { + "line": 5, + "character": 10 + } + }, + "text": "1" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 11 + }, + "end": { + "line": 5, + "character": 11 + } + }, + "text": "0" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 12 + }, + "end": { + "line": 5, + "character": 12 + } + }, + "text": ";" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// const x = 10; + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferences.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferences.baseline new file mode 100644 index 000000000..a49ff4483 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferences.baseline @@ -0,0 +1,300 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/random/tsconfig.json] *new* + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/random/tsconfig.json] *new* + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/random/random.ts] *new* + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/dependency/FnS.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/main/tsconfig.json *new* + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + /myproject/main/tsconfig.json + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + /myproject/main/tsconfig.json + [/random/random.ts] *new* + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] *closed* + [/random/random.ts] + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *deleted* + [/myproject/main/tsconfig.json] *deleted* + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *deleted* + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEdit.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEdit.baseline new file mode 100644 index 000000000..9e647c2c2 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEdit.baseline @@ -0,0 +1,779 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/dependency/FnS.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/main/tsconfig.json *new* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 1 + }, + "end": { + "line": 0, + "character": 1 + } + }, + "text": "u" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 2 + }, + "end": { + "line": 0, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 3 + }, + "end": { + "line": 0, + "character": 3 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 4 + }, + "end": { + "line": 0, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 5 + }, + "end": { + "line": 0, + "character": 5 + } + }, + "text": "i" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 6 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 7 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 8 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 9 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 10 + }, + "end": { + "line": 0, + "character": 10 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 11 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 12 + }, + "end": { + "line": 0, + "character": 12 + } + }, + "text": "B" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 16 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 13 + }, + "end": { + "line": 0, + "character": 13 + } + }, + "text": "a" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 17 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 14 + } + }, + "text": "r" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 18 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 15 + }, + "end": { + "line": 0, + "character": 15 + } + }, + "text": "(" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 19 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 16 + }, + "end": { + "line": 0, + "character": 16 + } + }, + "text": ")" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 20 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 17 + }, + "end": { + "line": 0, + "character": 17 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 21 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 18 + } + }, + "text": "{" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 22 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 19 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 23 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 20 + }, + "end": { + "line": 0, + "character": 20 + } + }, + "text": "}" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 24 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 21 + } + }, + "text": "\n" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 3, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + /myproject/main/main.ts + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// function fooBar() { } +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEditEnd.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEditEnd.baseline new file mode 100644 index 000000000..13e6ff173 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithProjectReferencesEditEnd.baseline @@ -0,0 +1,553 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + "references": [{ "path": "../dependency" }] +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/dependency/FnS.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/main/tsconfig.json *new* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/main/tsconfig.json *new* + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 1 + }, + "end": { + "line": 5, + "character": 1 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 2 + }, + "end": { + "line": 5, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 3 + }, + "end": { + "line": 5, + "character": 3 + } + }, + "text": "s" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 4 + }, + "end": { + "line": 5, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 5 + }, + "end": { + "line": 5, + "character": 5 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "text": "x" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 7 + }, + "end": { + "line": 5, + "character": 7 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 8 + }, + "end": { + "line": 5, + "character": 8 + } + }, + "text": "=" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 9 + }, + "end": { + "line": 5, + "character": 9 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 10 + }, + "end": { + "line": 5, + "character": 10 + } + }, + "text": "1" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 11 + }, + "end": { + "line": 5, + "character": 11 + } + }, + "text": "0" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 12 + }, + "end": { + "line": 5, + "character": 12 + } + }, + "text": ";" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + /myproject/main/main.ts + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// const x = 10; + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMaps.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMaps.baseline new file mode 100644 index 000000000..55325881c --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMaps.baseline @@ -0,0 +1,423 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/random/tsconfig.json] *new* + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/random/tsconfig.json] *new* + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/random/random.ts] *new* + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *modified* + [/random/tsconfig.json] + /random/random.ts +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] *new* + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] *closed* + [/random/random.ts] + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *deleted* + [/myproject/main/tsconfig.json] *deleted* + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *deleted* + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEdit.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEdit.baseline new file mode 100644 index 000000000..964d19c2e --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEdit.baseline @@ -0,0 +1,891 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *modified* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 1 + }, + "end": { + "line": 0, + "character": 1 + } + }, + "text": "u" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 2 + }, + "end": { + "line": 0, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 3 + }, + "end": { + "line": 0, + "character": 3 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 4 + }, + "end": { + "line": 0, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 5 + }, + "end": { + "line": 0, + "character": 5 + } + }, + "text": "i" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 6 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 7 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 8 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 9 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 10 + }, + "end": { + "line": 0, + "character": 10 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 11 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 12 + }, + "end": { + "line": 0, + "character": 12 + } + }, + "text": "B" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 16 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 13 + }, + "end": { + "line": 0, + "character": 13 + } + }, + "text": "a" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 17 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 14 + } + }, + "text": "r" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 18 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 15 + }, + "end": { + "line": 0, + "character": 15 + } + }, + "text": "(" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 19 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 16 + }, + "end": { + "line": 0, + "character": 16 + } + }, + "text": ")" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 20 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 17 + }, + "end": { + "line": 0, + "character": 17 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 21 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 18 + } + }, + "text": "{" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 22 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 19 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 23 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 20 + }, + "end": { + "line": 0, + "character": 20 + } + }, + "text": "}" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 24 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 21 + } + }, + "text": "\n" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 3, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// function fooBar() { } +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEditEnd.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEditEnd.baseline new file mode 100644 index 000000000..98b9e58e7 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsEditEnd.baseline @@ -0,0 +1,665 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + "files": [], + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *modified* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 1 + }, + "end": { + "line": 5, + "character": 1 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 2 + }, + "end": { + "line": 5, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 3 + }, + "end": { + "line": 5, + "character": 3 + } + }, + "text": "s" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 4 + }, + "end": { + "line": 5, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 5 + }, + "end": { + "line": 5, + "character": 5 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "text": "x" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 7 + }, + "end": { + "line": 5, + "character": 7 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 8 + }, + "end": { + "line": 5, + "character": 8 + } + }, + "text": "=" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 9 + }, + "end": { + "line": 5, + "character": 9 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 10 + }, + "end": { + "line": 5, + "character": 10 + } + }, + "text": "1" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 11 + }, + "end": { + "line": 5, + "character": 11 + } + }, + "text": "0" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 12 + }, + "end": { + "line": 5, + "character": 12 + } + }, + "text": ";" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/tsconfig.json] + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// const x = 10; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolution.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolution.baseline new file mode 100644 index 000000000..d40fc5b87 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolution.baseline @@ -0,0 +1,457 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/random/tsconfig.json] *new* + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/random/tsconfig.json] *new* + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/random/random.ts] *new* + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *new* + /myproject/main/main.ts *new* + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/tsconfig.json *new* + [/random/random.ts] + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + /myproject/tsconfig.json + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] + /myproject/dependency/tsconfig.json (default) + /myproject/tsconfig.json + [/random/random.ts] *new* + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + } + } +} + +Open Files:: + [/myproject/dependency/FnS.ts] *closed* + [/random/random.ts] + /random/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///random/random.ts" + } + } +} + +Open Files:: + [/random/random.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///random/random.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *deleted* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *deleted* + /myproject/dependency/FnS.ts + /myproject/main/main.ts + [/random/tsconfig.json] + /random/random.ts +Open Files:: + [/random/random.ts] *new* + /random/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *deleted* + [/myproject/main/tsconfig.json] *deleted* + [/myproject/tsconfig.json] *deleted* + [/random/tsconfig.json] + RetainingProjects: + /random/tsconfig.json + RetainingOpenFiles: + /random/random.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *deleted* + [/random/random.ts] + NearestConfigFileName: /random/tsconfig.json diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEdit.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEdit.baseline new file mode 100644 index 000000000..852510094 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEdit.baseline @@ -0,0 +1,936 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *new* + /myproject/main/main.ts *new* +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/tsconfig.json *new* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 1 + }, + "end": { + "line": 0, + "character": 1 + } + }, + "text": "u" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 2 + }, + "end": { + "line": 0, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 3 + }, + "end": { + "line": 0, + "character": 3 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 4 + }, + "end": { + "line": 0, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 5 + }, + "end": { + "line": 0, + "character": 5 + } + }, + "text": "i" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 6 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 7 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 8 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 9 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "text": "f" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 10 + }, + "end": { + "line": 0, + "character": 10 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 11 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 12 + }, + "end": { + "line": 0, + "character": 12 + } + }, + "text": "B" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 16 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 13 + }, + "end": { + "line": 0, + "character": 13 + } + }, + "text": "a" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 17 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 14 + }, + "end": { + "line": 0, + "character": 14 + } + }, + "text": "r" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 18 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 15 + }, + "end": { + "line": 0, + "character": 15 + } + }, + "text": "(" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 19 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 16 + }, + "end": { + "line": 0, + "character": 16 + } + }, + "text": ")" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 20 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 17 + }, + "end": { + "line": 0, + "character": 17 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 21 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 18 + } + }, + "text": "{" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 22 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 19 + }, + "end": { + "line": 0, + "character": 19 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 23 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 20 + }, + "end": { + "line": 0, + "character": 20 + } + }, + "text": "}" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 24 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 21 + } + }, + "text": "\n" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 3, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + /myproject/main/main.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// function fooBar() { } +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEditEnd.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEditEnd.baseline new file mode 100644 index 000000000..f923c0fdb --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsRenameWithSourceMapsNotSolutionEditEnd.baseline @@ -0,0 +1,710 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/decls/FnS.d.ts] *new* +export declare function fn1(): void; +export declare function fn2(): void; +export declare function fn3(): void; +export declare function fn4(): void; +export declare function fn5(): void; +//# sourceMappingURL=FnS.d.ts.map +//// [/myproject/decls/FnS.d.ts.map] *new* +{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["../dependency/FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"} +//// [/myproject/dependency/FnS.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn1 = fn1; +exports.fn2 = fn2; +exports.fn3 = fn3; +exports.fn4 = fn4; +exports.fn5 = fn5; +function fn1() { } +function fn2() { } +function fn3() { } +function fn4() { } +function fn5() { } + +//// [/myproject/dependency/FnS.ts] *new* +export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } + +//// [/myproject/dependency/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "declarationDir": "../decls" + } +} +//// [/myproject/dependency/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./FnS.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n","signature":"bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declarationDir":"../decls","declarationMap":true},"latestChangedDtsFile":"../decls/FnS.d.ts"} +//// [/myproject/dependency/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./FnS.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./FnS.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./FnS.ts", + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dabc23167a661a3e71744cf63ff5adcc-export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n", + "signature": "bf56b5172c2fd500384b437b7700d594-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declarationDir": "../decls", + "declarationMap": true + }, + "latestChangedDtsFile": "../decls/FnS.d.ts", + "size": 1423 +} +//// [/myproject/main/main.d.ts] *new* +export {}; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/main/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":""} +//// [/myproject/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const FnS_1 = require("../decls/FnS"); +(0, FnS_1.fn1)(); +(0, FnS_1.fn2)(); +(0, FnS_1.fn3)(); +(0, FnS_1.fn4)(); +(0, FnS_1.fn5)(); + +//// [/myproject/main/main.ts] *new* +import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from "../decls/FnS"; + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "disableSourceOfProjectReferenceRedirect": false + }, + +} +//// [/myproject/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../decls/FnS.d.ts","./main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map",{"version":"72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/myproject/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../decls/FnS.d.ts", + "./main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../decls/FnS.d.ts", + "version": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "signature": "ccbe7f3de9ff1ded77b994bef4cf9dce-export declare function fn1(): void;\nexport declare function fn2(): void;\nexport declare function fn3(): void;\nexport declare function fn4(): void;\nexport declare function fn5(): void;\n//# sourceMappingURL=FnS.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "72620bcff3a257f2c990b3f030e1b8e3-import {\n\tfn1,\n\tfn2,\n\tfn3,\n\tfn4,\n\tfn5\n} from \"../decls/FnS\";\n\nfn1();\nfn2();\nfn3();\nfn4();\nfn5();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../decls/FnS.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true + }, + "referencedMap": { + "./main.ts": [ + "../decls/FnS.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1515 +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableSourceOfProjectReferenceRedirect": false + }, + + "references": [ + { "path": "dependency" }, + { "path": "main" } + ] +} +//// [/random/random.ts] *new* +export const a = 10; +//// [/random/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "languageId": "typescript", + "version": 0, + "text": "export function fn1() { }\nexport function fn2() { }\nexport function fn3() { }\nexport function fn4() { }\nexport function fn5() { }\n" + } + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *new* + /myproject/dependency/FnS.ts + [/myproject/tsconfig.json] *new* +Open Files:: + [/myproject/dependency/FnS.ts] *new* + /myproject/dependency/tsconfig.json (default) +Config:: + [/myproject/dependency/tsconfig.json] *new* + RetainingProjects: + /myproject/dependency/tsconfig.json + RetainingOpenFiles: + /myproject/dependency/FnS.ts +Config File Names:: + [/myproject/dependency/FnS.ts] *new* + NearestConfigFileName: /myproject/dependency/tsconfig.json + Ancestors: + /myproject/dependency/tsconfig.json /myproject/tsconfig.json + /myproject/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *new* + /myproject/main/main.ts *new* +Open Files:: + [/myproject/dependency/FnS.ts] *modified* + /myproject/dependency/tsconfig.json (default) + /myproject/tsconfig.json *new* +Config:: + [/myproject/dependency/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/dependency/tsconfig.json + /myproject/tsconfig.json *new* + RetainingOpenFiles: + /myproject/dependency/FnS.ts + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 0 + }, + "end": { + "line": 5, + "character": 0 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 1 + }, + "end": { + "line": 5, + "character": 1 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 2 + }, + "end": { + "line": 5, + "character": 2 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 3 + }, + "end": { + "line": 5, + "character": 3 + } + }, + "text": "s" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 4 + }, + "end": { + "line": 5, + "character": 4 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 5 + }, + "end": { + "line": 5, + "character": 5 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 6 + }, + "end": { + "line": 5, + "character": 6 + } + }, + "text": "x" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 7 + }, + "end": { + "line": 5, + "character": 7 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 8 + }, + "end": { + "line": 5, + "character": 8 + } + }, + "text": "=" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 9 + }, + "end": { + "line": 5, + "character": 9 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 13 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 10 + }, + "end": { + "line": 5, + "character": 10 + } + }, + "text": "1" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 14 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 11 + }, + "end": { + "line": 5, + "character": 11 + } + }, + "text": "0" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts", + "version": 15 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 5, + "character": 12 + }, + "end": { + "line": 5, + "character": 12 + } + }, + "text": ";" + } + ] + } +} + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///myproject/dependency/FnS.ts" + }, + "position": { + "line": 2, + "character": 16 + }, + "newName": "?" + } +} + +Projects:: + [/myproject/dependency/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + [/myproject/main/tsconfig.json] + /myproject/decls/FnS.d.ts + /myproject/main/main.ts + [/myproject/tsconfig.json] *modified* + /myproject/dependency/FnS.ts *modified* + /myproject/main/main.ts + + + + +// === findRenameLocations === +// === /myproject/dependency/FnS.ts === +// export function fn1() { } +// export function fn2() { } +// export function /*RENAME*/[|fn3RENAME|]() { } +// export function fn4() { } +// export function fn5() { } +// const x = 10; + +// === /myproject/main/main.ts === +// import { +// fn1, +// fn2, +// [|fn3RENAME|], +// fn4, +// fn5 +// } from "../decls/FnS"; +// +// fn1(); +// fn2(); +// [|fn3RENAME|](); +// fn4(); +// fn5(); \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline new file mode 100644 index 000000000..27108ed47 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline @@ -0,0 +1,216 @@ +UseCaseSensitiveFileNames: true +//// [/a/a.ts] *new* +export function fnA() {} +export interface IfaceA {} +export const instanceA: IfaceA = {}; +//// [/a/bin/a.d.ts] *new* +export declare function fnA(): void; +export interface IfaceA { +} +export declare const instanceA: IfaceA; +//# sourceMappingURL=a.d.ts.map +//// [/a/bin/a.d.ts.map] *new* +{ + "version": 3, + "file": "a.d.ts", + "sourceRoot": "", + "sources": ["../a.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" +} +//// [/a/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/b/b.ts] *new* +export function fnB() {} +//// [/b/bin/b.d.ts] *new* +export declare function fnB(): void; +//# sourceMappingURL=b.d.ts.map +//// [/b/bin/b.d.ts.map] *new* +{ + "version": 3, + "file": "b.d.ts", + "sourceRoot": "", + "sources": ["../b.ts"], + "names": [], + "mappings": "AAAA,wBAAgB,GAAG,SAAK" +} +//// [/b/c.ts] *new* +export function fnC() {} +//// [/b/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "bin", + "declarationMap": true, + "composite": true + } +} +//// [/dummy/dummy.ts] *new* +export const a = 10; +//// [/dummy/tsconfig.json] *new* +{} +//// [/user/tsconfig.json] *new* +{ + "references": [ + { "path": "../a" }, + { "path": "../b" } + ] +} +//// [/user/user.ts] *new* +import * as a from "../a/a"; +import * as b from "../b/b"; +export function fnUser() { + a.fnA(); + b.fnB(); + a.instanceA; +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///user/user.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as a from \"../a/a\";\nimport * as b from \"../b/b\";\nexport function fnUser() {\n\ta.fnA();\n\tb.fnB();\n\ta.instanceA;\n}" + } + } +} + +Projects:: + [/user/tsconfig.json] *new* + /a/a.ts + /b/b.ts + /user/user.ts +Open Files:: + [/user/user.ts] *new* + /user/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *new* + RetainingProjects: + /user/tsconfig.json + [/b/tsconfig.json] *new* + RetainingProjects: + /user/tsconfig.json + [/user/tsconfig.json] *new* + RetainingProjects: + /user/tsconfig.json + RetainingOpenFiles: + /user/user.ts +Config File Names:: + [/user/user.ts] *new* + NearestConfigFileName: /user/tsconfig.json + +{ + "method": "workspace/symbol", + "params": { + "query": "fn" + } +} + +Projects:: + [/a/tsconfig.json] *new* + /a/a.ts + [/b/tsconfig.json] *new* + /b/b.ts + /b/c.ts + [/user/tsconfig.json] + /a/a.ts + /b/b.ts + /user/user.ts +Config:: + [/a/tsconfig.json] *modified* + RetainingProjects: *modified* + /a/tsconfig.json *new* + /user/tsconfig.json + [/b/tsconfig.json] *modified* + RetainingProjects: *modified* + /b/tsconfig.json *new* + /user/tsconfig.json + [/user/tsconfig.json] + RetainingProjects: + /user/tsconfig.json + RetainingOpenFiles: + /user/user.ts + + + + +// === workspaceSymbol === +// === /a/a.ts === +// [|{| name: fnA, kind: Function |}export function fnA() {}|] +// export interface IfaceA {} +// export const instanceA: IfaceA = {}; + +// === /b/b.ts === +// [|{| name: fnB, kind: Function |}export function fnB() {}|] + +// === /b/c.ts === +// [|{| name: fnC, kind: Function |}export function fnC() {}|] + +// === /user/user.ts === +// import * as a from "../a/a"; +// import * as b from "../b/b"; +// [|{| name: fnUser, kind: Function |}export function fnUser() { +// a.fnA(); +// b.fnB(); +// a.instanceA; +// }|] +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///user/user.ts" + } + } +} + +Open Files:: + [/user/user.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "export const a = 10;" + } + } +} + +Projects:: + [/a/tsconfig.json] *deleted* + /a/a.ts + [/b/tsconfig.json] *deleted* + /b/b.ts + /b/c.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts + [/user/tsconfig.json] *deleted* + /a/a.ts + /b/b.ts + /user/user.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/a/tsconfig.json] *deleted* + [/b/tsconfig.json] *deleted* + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/user/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/user/user.ts] *deleted* diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline new file mode 100644 index 000000000..ec8c01300 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoading.baseline @@ -0,0 +1,179 @@ +UseCaseSensitiveFileNames: true +//// [/solution/compiler/program.ts] *new* +namespace ts { + export const program: Program = { + getSourceFiles: () => [getSourceFile()] + }; + function getSourceFile() { return "something"; } +} +//// [/solution/compiler/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "disableSolutionSearching": false, + }, + "files": ["./types.ts", "./program.ts"] +} +//// [/solution/compiler/types.ts] *new* +namespace ts { + export interface Program { + getSourceFiles(): string[]; + } +} +//// [/solution/services/services.ts] *new* +/// +/// +namespace ts { + const result = program.getSourceFiles(); +} +//// [/solution/services/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "files": ["./services.ts"], + "references": [ + { "path": "../compiler" }, + ], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "include": [], + "references": [ + { "path": "./compiler" }, + { "path": "./services" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts", + "languageId": "typescript", + "version": 0, + "text": "namespace ts {\n\texport const program: Program = {\n\t\tgetSourceFiles: () => [getSourceFile()]\n\t};\n\tfunction getSourceFile() { return \"something\"; }\n}" + } + } +} + +Projects:: + [/solution/compiler/tsconfig.json] *new* + /solution/compiler/types.ts + /solution/compiler/program.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/compiler/program.ts] *new* + /solution/compiler/tsconfig.json (default) +Config:: + [/solution/compiler/tsconfig.json] *new* + RetainingProjects: + /solution/compiler/tsconfig.json + RetainingOpenFiles: + /solution/compiler/program.ts +Config File Names:: + [/solution/compiler/program.ts] *new* + NearestConfigFileName: /solution/compiler/tsconfig.json + Ancestors: + /solution/compiler/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts" + }, + "position": { + "line": 2, + "character": 25 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /solution/compiler/program.ts === +// namespace ts { +// export const program: Program = { +// getSourceFiles: () => [/*FIND ALL REFS*/[|getSourceFile|]()] +// }; +// function [|getSourceFile|]() { return "something"; } +// } +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts" + }, + "position": { + "line": 2, + "character": 2 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/compiler/tsconfig.json] + /solution/compiler/types.ts + /solution/compiler/program.ts + [/solution/services/tsconfig.json] *new* + /solution/compiler/types.ts + /solution/compiler/program.ts + /solution/services/services.ts + [/solution/tsconfig.json] *modified* +Open Files:: + [/solution/compiler/program.ts] *modified* + /solution/compiler/tsconfig.json (default) + /solution/services/tsconfig.json *new* +Config:: + [/solution/compiler/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/compiler/tsconfig.json + /solution/services/tsconfig.json *new* + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/compiler/program.ts + [/solution/services/tsconfig.json] *new* + RetainingProjects: + /solution/services/tsconfig.json + /solution/tsconfig.json + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/compiler/program.ts === +// namespace ts { +// export const program: Program = { +// /*FIND ALL REFS*/[|getSourceFiles|]: () => [getSourceFile()] +// }; +// function getSourceFile() { return "something"; } +// } + +// === /solution/compiler/types.ts === +// namespace ts { +// export interface Program { +// [|getSourceFiles|](): string[]; +// } +// } + +// === /solution/services/services.ts === +// /// +// /// +// namespace ts { +// const result = program.[|getSourceFiles|](); +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline new file mode 100644 index 000000000..e544f1b7e --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsAncestorSiblingProjectsLoadingDisableSolutionSearching.baseline @@ -0,0 +1,139 @@ +UseCaseSensitiveFileNames: true +//// [/solution/compiler/program.ts] *new* +namespace ts { + export const program: Program = { + getSourceFiles: () => [getSourceFile()] + }; + function getSourceFile() { return "something"; } +} +//// [/solution/compiler/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "disableSolutionSearching": true, + }, + "files": ["./types.ts", "./program.ts"] +} +//// [/solution/compiler/types.ts] *new* +namespace ts { + export interface Program { + getSourceFiles(): string[]; + } +} +//// [/solution/services/services.ts] *new* +/// +/// +namespace ts { + const result = program.getSourceFiles(); +} +//// [/solution/services/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "files": ["./services.ts"], + "references": [ + { "path": "../compiler" }, + ], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "include": [], + "references": [ + { "path": "./compiler" }, + { "path": "./services" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts", + "languageId": "typescript", + "version": 0, + "text": "namespace ts {\n\texport const program: Program = {\n\t\tgetSourceFiles: () => [getSourceFile()]\n\t};\n\tfunction getSourceFile() { return \"something\"; }\n}" + } + } +} + +Projects:: + [/solution/compiler/tsconfig.json] *new* + /solution/compiler/types.ts + /solution/compiler/program.ts +Open Files:: + [/solution/compiler/program.ts] *new* + /solution/compiler/tsconfig.json (default) +Config:: + [/solution/compiler/tsconfig.json] *new* + RetainingProjects: + /solution/compiler/tsconfig.json + RetainingOpenFiles: + /solution/compiler/program.ts +Config File Names:: + [/solution/compiler/program.ts] *new* + NearestConfigFileName: /solution/compiler/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts" + }, + "position": { + "line": 2, + "character": 25 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /solution/compiler/program.ts === +// namespace ts { +// export const program: Program = { +// getSourceFiles: () => [/*FIND ALL REFS*/[|getSourceFile|]()] +// }; +// function [|getSourceFile|]() { return "something"; } +// } +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/compiler/program.ts" + }, + "position": { + "line": 2, + "character": 2 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /solution/compiler/program.ts === +// namespace ts { +// export const program: Program = { +// /*FIND ALL REFS*/[|getSourceFiles|]: () => [getSourceFile()] +// }; +// function getSourceFile() { return "something"; } +// } + +// === /solution/compiler/types.ts === +// namespace ts { +// export interface Program { +// [|getSourceFiles|](): string[]; +// } +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..d65075638 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -0,0 +1,130 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..26e0d6071 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -0,0 +1,142 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..26e216f15 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -0,0 +1,130 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..34ead087e --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -0,0 +1,142 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..744a08f01 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -0,0 +1,130 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..a84a5fd03 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -0,0 +1,142 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..b9b50f45d --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -0,0 +1,130 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..8f986664f --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -0,0 +1,142 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/b/helper.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \".\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Open Files:: + [/myproject/a/index.ts] + /myproject/a/tsconfig.json (default) + [/myproject/b/helper.ts] *new* + /myproject/b/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + RetainingOpenFiles: + /myproject/b/helper.ts +Config File Names:: + [/myproject/a/index.ts] + NearestConfigFileName: /myproject/a/tsconfig.json + [/myproject/b/helper.ts] *new* + NearestConfigFileName: /myproject/b/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..23659d8d8 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -0,0 +1,88 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..46b5b8d57 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -0,0 +1,118 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..bf66bd9fe --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -0,0 +1,88 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..b7fcab837 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsDisabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -0,0 +1,118 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": true, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..e75c517c0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsMissing.baseline @@ -0,0 +1,88 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..d98007bb4 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreDisabledDeclMapIsPresent.baseline @@ -0,0 +1,118 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": true, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline new file mode 100644 index 000000000..fd2ef7802 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsMissing.baseline @@ -0,0 +1,88 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/lib/index.d.ts === +// export declare class [|B|] { +// M(): void; +// } +// //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline new file mode 100644 index 000000000..455c0744b --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDeclarationInOtherProjectProjIsNotLoadedRefdProjLoadingIsEnabledProjRefRedirectsAreEnabledDeclMapIsPresent.baseline @@ -0,0 +1,118 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/a/index.ts] *new* +import { B } from "../b/lib"; +const b: B = new B(); +//// [/myproject/a/tsconfig.json] *new* +{ + "disableReferencedProjectLoad": false, + "disableSourceOfProjectReferenceRedirect": false, + "composite": true +} +//// [/myproject/b/helper.ts] *new* +import { B } from "."; +const b: B = new B(); +//// [/myproject/b/index.ts] *new* +export class B { + M() {} +} +//// [/myproject/b/lib/index.d.ts] *new* +export declare class B { + M(): void; +} +//# sourceMappingURL=index.d.ts.map +//// [/myproject/b/lib/index.d.ts.map] *new* +{ + "version": 3, + "file": "index.d.ts", + "sourceRoot": "", + "sources": ["../index.ts"], + "names": [], + "mappings": "AAAA,qBAAa,CAAC;IACV,CAAC;CACJ" +} +//// [/myproject/b/tsconfig.json] *new* +{ + "declarationMap": true, + "outDir": "lib", + "composite": true, +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { B } from \"../b/lib\";\nconst b: B = new B();" + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] *new* + /myproject/b/lib/index.d.ts + /myproject/a/index.ts +Open Files:: + [/myproject/a/index.ts] *new* + /myproject/a/tsconfig.json (default) +Config:: + [/myproject/a/tsconfig.json] *new* + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts +Config File Names:: + [/myproject/a/index.ts] *new* + NearestConfigFileName: /myproject/a/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/a/index.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/a/tsconfig.json] + /myproject/b/lib/index.d.ts + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + /myproject/b/index.ts + /myproject/b/helper.ts + /myproject/b/lib/index.d.ts +Config:: + [/myproject/a/tsconfig.json] + RetainingProjects: + /myproject/a/tsconfig.json + RetainingOpenFiles: + /myproject/a/index.ts + [/myproject/b/tsconfig.json] *new* + RetainingProjects: + /myproject/b/tsconfig.json + + + + +// === findAllReferences === +// === /myproject/a/index.ts === +// import { [|B|] } from "../b/lib"; +// const b: /*FIND ALL REFS*/[|B|] = new [|B|](); + +// === /myproject/b/helper.ts === +// import { [|B|] } from "."; +// const b: [|B|] = new [|B|](); + +// === /myproject/b/index.ts === +// export class [|B|] { +// M() {} +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline new file mode 100644 index 000000000..109e42807 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsDoesNotTryToSearchProjectAfterItsUpdateDoesNotIncludeTheFile.baseline @@ -0,0 +1,452 @@ +UseCaseSensitiveFileNames: true +//// [/packages/babel-loader/src/index.ts] *new* +import type { Foo } from "../../core/src/index.js"; +//// [/packages/babel-loader/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "composite": true, + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"], + "references": [{"path": "../core"}] +} +//// [/packages/core/src/index.ts] *new* +import { Bar } from "./loading-indicator.js"; +export type Foo = {}; +const bar: Bar = { + prop: 0 +} +//// [/packages/core/src/loading-indicator.ts] *new* +export interface Bar { + prop: number; +} +const bar: Bar = { + prop: 1 +} +//// [/packages/core/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "composite": true, + "rootDir": "./src", + "outDir": "./dist", + }, + "include": ["./src"] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import type { Foo } from \"../../core/src/index.js\";" + } + } +} + +Projects:: + [/packages/babel-loader/tsconfig.json] *new* + /packages/core/src/loading-indicator.ts + /packages/core/src/index.ts + /packages/babel-loader/src/index.ts +Open Files:: + [/packages/babel-loader/src/index.ts] *new* + /packages/babel-loader/tsconfig.json (default) +Config:: + [/packages/babel-loader/tsconfig.json] *new* + RetainingProjects: + /packages/babel-loader/tsconfig.json + RetainingOpenFiles: + /packages/babel-loader/src/index.ts + [/packages/core/tsconfig.json] *new* + RetainingProjects: + /packages/babel-loader/tsconfig.json +Config File Names:: + [/packages/babel-loader/src/index.ts] *new* + NearestConfigFileName: /packages/babel-loader/tsconfig.json + Ancestors: + /packages/babel-loader/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///packages/core/src/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { Bar } from \"./loading-indicator.js\";\nexport type Foo = {};\nconst bar: Bar = {\n\tprop: 0\n}" + } + } +} + +Projects:: + [/packages/babel-loader/tsconfig.json] + /packages/core/src/loading-indicator.ts + /packages/core/src/index.ts + /packages/babel-loader/src/index.ts + [/packages/core/tsconfig.json] *new* + /packages/core/src/loading-indicator.ts + /packages/core/src/index.ts +Open Files:: + [/packages/babel-loader/src/index.ts] + /packages/babel-loader/tsconfig.json (default) + [/packages/core/src/index.ts] *new* + /packages/babel-loader/tsconfig.json + /packages/core/tsconfig.json (default) +Config:: + [/packages/babel-loader/tsconfig.json] + RetainingProjects: + /packages/babel-loader/tsconfig.json + RetainingOpenFiles: + /packages/babel-loader/src/index.ts + [/packages/core/tsconfig.json] *modified* + RetainingProjects: *modified* + /packages/babel-loader/tsconfig.json + /packages/core/tsconfig.json *new* + RetainingOpenFiles: *modified* + /packages/core/src/index.ts *new* +Config File Names:: + [/packages/babel-loader/src/index.ts] + NearestConfigFileName: /packages/babel-loader/tsconfig.json + Ancestors: + /packages/babel-loader/tsconfig.json + [/packages/core/src/index.ts] *new* + NearestConfigFileName: /packages/core/tsconfig.json + Ancestors: + /packages/core/tsconfig.json + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 2 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 3 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 0 + }, + "end": { + "line": 0, + "character": 0 + } + }, + "text": "/" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 4 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 1 + }, + "end": { + "line": 0, + "character": 1 + } + }, + "text": "/" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 5 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 2 + }, + "end": { + "line": 0, + "character": 2 + } + }, + "text": " " + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 6 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 3 + }, + "end": { + "line": 0, + "character": 3 + } + }, + "text": "c" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 7 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 4 + }, + "end": { + "line": 0, + "character": 4 + } + }, + "text": "o" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 8 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 5 + }, + "end": { + "line": 0, + "character": 5 + } + }, + "text": "m" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 9 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 6 + }, + "end": { + "line": 0, + "character": 6 + } + }, + "text": "m" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 10 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 7 + } + }, + "text": "e" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 11 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 8 + } + }, + "text": "n" + } + ] + } +} + +{ + "method": "textDocument/didChange", + "params": { + "textDocument": { + "uri": "file:///packages/babel-loader/src/index.ts", + "version": 12 + }, + "contentChanges": [ + { + "range": { + "start": { + "line": 0, + "character": 9 + }, + "end": { + "line": 0, + "character": 9 + } + }, + "text": "t" + } + ] + } +} + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///packages/core/src/index.ts" + }, + "position": { + "line": 3, + "character": 1 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/packages/babel-loader/tsconfig.json] *modified* + /packages/babel-loader/src/index.ts *modified* + /packages/core/src/loading-indicator.ts *deleted* + /packages/core/src/index.ts *deleted* + [/packages/core/tsconfig.json] + /packages/core/src/loading-indicator.ts + /packages/core/src/index.ts +Open Files:: + [/packages/babel-loader/src/index.ts] + /packages/babel-loader/tsconfig.json (default) + [/packages/core/src/index.ts] *modified* + /packages/babel-loader/tsconfig.json *deleted* + /packages/core/tsconfig.json (default) + + + + +// === findAllReferences === +// === /packages/core/src/index.ts === +// import { Bar } from "./loading-indicator.js"; +// export type Foo = {}; +// const bar: Bar = { +// /*FIND ALL REFS*/[|prop|]: 0 +// } + +// === /packages/core/src/loading-indicator.ts === +// export interface Bar { +// [|prop|]: number; +// } +// const bar: Bar = { +// [|prop|]: 1 +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline new file mode 100644 index 000000000..176a89c9d --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsOpenFileInConfiguredProjectThatWillBeRemoved.baseline @@ -0,0 +1,122 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/playground/tests.ts] *new* +export function foo() {} +//// [/myproject/playground/tsconfig-json/src/src.ts] *new* +export function foobar() {} +//// [/myproject/playground/tsconfig-json/tests/spec.ts] *new* +export function bar() { } + +//// [/myproject/playground/tsconfig-json/tsconfig.json] *new* +{ + "include": ["./src"] +} +//// [/myproject/playground/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/playground/tests.ts", + "languageId": "typescript", + "version": 0, + "text": "export function foo() {}" + } + } +} + +Projects:: + [/myproject/playground/tsconfig.json] *new* + /myproject/playground/tests.ts + /myproject/playground/tsconfig-json/src/src.ts + /myproject/playground/tsconfig-json/tests/spec.ts +Open Files:: + [/myproject/playground/tests.ts] *new* + /myproject/playground/tsconfig.json (default) +Config:: + [/myproject/playground/tsconfig.json] *new* + RetainingProjects: + /myproject/playground/tsconfig.json + RetainingOpenFiles: + /myproject/playground/tests.ts +Config File Names:: + [/myproject/playground/tests.ts] *new* + NearestConfigFileName: /myproject/playground/tsconfig.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/playground/tests.ts" + } + } +} + +Open Files:: + [/myproject/playground/tests.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/playground/tsconfig-json/tests/spec.ts", + "languageId": "typescript", + "version": 0, + "text": "export function bar() { }\n" + } + } +} + +Projects:: + [/myproject/playground/tsconfig-json/tsconfig.json] *new* + /myproject/playground/tsconfig-json/src/src.ts + [/myproject/playground/tsconfig.json] + /myproject/playground/tests.ts + /myproject/playground/tsconfig-json/src/src.ts + /myproject/playground/tsconfig-json/tests/spec.ts +Open Files:: + [/myproject/playground/tsconfig-json/tests/spec.ts] *new* + /myproject/playground/tsconfig.json (default) +Config:: + [/myproject/playground/tsconfig-json/tsconfig.json] *new* + RetainingProjects: + /myproject/playground/tsconfig-json/tsconfig.json + RetainingOpenFiles: + /myproject/playground/tsconfig-json/tests/spec.ts + [/myproject/playground/tsconfig.json] *modified* + RetainingProjects: + /myproject/playground/tsconfig.json + RetainingOpenFiles: *modified* + /myproject/playground/tests.ts *deleted* + /myproject/playground/tsconfig-json/tests/spec.ts *new* +Config File Names:: + [/myproject/playground/tests.ts] *deleted* + [/myproject/playground/tsconfig-json/tests/spec.ts] *new* + NearestConfigFileName: /myproject/playground/tsconfig-json/tsconfig.json + Ancestors: + /myproject/playground/tsconfig-json/tsconfig.json /myproject/playground/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/playground/tsconfig-json/tests/spec.ts" + }, + "position": { + "line": 0, + "character": 16 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/playground/tsconfig-json/tests/spec.ts === +// export function /*FIND ALL REFS*/[|bar|]() { } +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline new file mode 100644 index 000000000..4707f0a90 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsOverlappingProjects.baseline @@ -0,0 +1,237 @@ +UseCaseSensitiveFileNames: true +//// [/solution/a/index.ts] *new* +export interface I { + M(): void; +} +//// [/solution/a/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "files": ["./index.ts"] +} +//// [/solution/b/index.ts] *new* +import { I } from "../a"; +export class B implements I { + M() {} +} +//// [/solution/b/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../a" }, + ], +} +//// [/solution/c/index.ts] *new* +import { I } from "../a"; +import { B } from "../b"; +export const C: I = new B(); +//// [/solution/c/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../b" }, + ], +} +//// [/solution/d/index.ts] *new* +import { I } from "../a"; +import { C } from "../c"; +export const D: I = C; + +//// [/solution/d/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "files": ["./index.ts"], + "references": [ + { "path": "../c" }, + ], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "include": [], + "references": [ + { "path": "./a" }, + { "path": "./b" }, + { "path": "./c" }, + { "path": "./d" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/b/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { I } from \"../a\";\nexport class B implements I {\n\tM() {}\n}" + } + } +} + +Projects:: + [/solution/b/tsconfig.json] *new* + /solution/a/index.ts + /solution/b/index.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/b/index.ts] *new* + /solution/b/tsconfig.json (default) +Config:: + [/solution/a/tsconfig.json] *new* + RetainingProjects: + /solution/b/tsconfig.json + [/solution/b/tsconfig.json] *new* + RetainingProjects: + /solution/b/tsconfig.json + RetainingOpenFiles: + /solution/b/index.ts +Config File Names:: + [/solution/b/index.ts] *new* + NearestConfigFileName: /solution/b/tsconfig.json + Ancestors: + /solution/b/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/b/index.ts" + }, + "position": { + "line": 1, + "character": 26 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/a/tsconfig.json] *new* + /solution/a/index.ts + [/solution/b/tsconfig.json] + /solution/a/index.ts + /solution/b/index.ts + [/solution/c/tsconfig.json] *new* + /solution/a/index.ts + /solution/b/index.ts + /solution/c/index.ts + [/solution/d/tsconfig.json] *new* + /solution/a/index.ts + /solution/b/index.ts + /solution/c/index.ts + /solution/d/index.ts + [/solution/tsconfig.json] *modified* +Open Files:: + [/solution/b/index.ts] *modified* + /solution/b/tsconfig.json (default) + /solution/c/tsconfig.json *new* + /solution/d/tsconfig.json *new* +Config:: + [/solution/a/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/a/tsconfig.json *new* + /solution/b/tsconfig.json + /solution/c/tsconfig.json *new* + /solution/d/tsconfig.json *new* + /solution/tsconfig.json *new* + [/solution/b/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/b/tsconfig.json + /solution/c/tsconfig.json *new* + /solution/d/tsconfig.json *new* + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/b/index.ts + [/solution/c/tsconfig.json] *new* + RetainingProjects: + /solution/c/tsconfig.json + /solution/d/tsconfig.json + /solution/tsconfig.json + [/solution/d/tsconfig.json] *new* + RetainingProjects: + /solution/d/tsconfig.json + /solution/tsconfig.json + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/a/index.ts === +// export interface [|I|] { +// M(): void; +// } + +// === /solution/b/index.ts === +// import { [|I|] } from "../a"; +// export class B implements /*FIND ALL REFS*/[|I|] { +// M() {} +// } + +// === /solution/c/index.ts === +// import { [|I|] } from "../a"; +// import { B } from "../b"; +// export const C: [|I|] = new B(); + +// === /solution/d/index.ts === +// import { [|I|] } from "../a"; +// import { C } from "../c"; +// export const D: [|I|] = C; +// +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/b/index.ts" + }, + "position": { + "line": 1, + "character": 26 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /solution/a/index.ts === +// export interface [|I|] { +// M(): void; +// } + +// === /solution/b/index.ts === +// import { [|I|] } from "../a"; +// export class B implements /*FIND ALL REFS*/[|I|] { +// M() {} +// } + +// === /solution/c/index.ts === +// import { [|I|] } from "../a"; +// import { B } from "../b"; +// export const C: [|I|] = new B(); + +// === /solution/d/index.ts === +// import { [|I|] } from "../a"; +// import { C } from "../c"; +// export const D: [|I|] = C; +// \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline new file mode 100644 index 000000000..aaf116174 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsProjectWithOwnFilesReferencingFileFromReferencedProject.baseline @@ -0,0 +1,514 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} + +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/own/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = bar; +const main_1 = require("../target/src/main"); +(0, main_1.foo)(); +function bar() { } + +//// [/myproject/own/main.ts] *new* +import { foo } from '../target/src/main'; +foo(); +export function bar() {} +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "files": ["./own/main.ts"], + "references": [{ "path": "./tsconfig-src.json" }] +} +//// [/myproject/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./own/main.ts"]} +//// [/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./own/main.ts" + ], + "original": "./own/main.ts" + } + ], + "size": 52 +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) + /myproject/tsconfig.json +Config:: + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) + /myproject/tsconfig.json +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + RetainingProjects: + /myproject/tsconfig-src.json + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] + RetainingProjects: + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) + /myproject/tsconfig.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) + /myproject/tsconfig.json +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}\n" + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + /myproject/own/main.ts +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + /myproject/tsconfig.json + [/myproject/tsconfig.json] *new* + RetainingProjects: + /myproject/tsconfig.json + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} +// + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline new file mode 100644 index 000000000..d98432e86 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProject.baseline @@ -0,0 +1,163 @@ +UseCaseSensitiveFileNames: true +//// [/src/common/input/keyboard.test.ts] *new* +import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function testEvaluateKeyboardEvent() { + return evaluateKeyboardEvent(); +} +//// [/src/common/input/keyboard.ts] *new* +function bar() { return "just a random function so .d.ts location doesnt match"; } +export function evaluateKeyboardEvent() { } +//// [/src/common/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../../out", + "disableSourceOfProjectReferenceRedirect": false, + "paths": { + "*": ["../*"], + }, + }, + "include": ["./\**/*"] +} +//// [/src/terminal.ts] *new* +import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function foo() { + return evaluateKeyboardEvent(); +} +//// [/src/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../out", + "disableSourceOfProjectReferenceRedirect": false, + "paths": { + "common/*": ["./common/*"], + }, + "tsBuildInfoFile": "../out/src.tsconfig.tsbuildinfo" + }, + "include": ["./\**/*"], + "references": [ + { "path": "./common" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///src/common/input/keyboard.ts", + "languageId": "typescript", + "version": 0, + "text": "function bar() { return \"just a random function so .d.ts location doesnt match\"; }\nexport function evaluateKeyboardEvent() { }" + } + } +} + +Projects:: + [/src/common/tsconfig.json] *new* + /src/common/input/keyboard.ts + /src/common/input/keyboard.test.ts + [/src/tsconfig.json] *new* +Open Files:: + [/src/common/input/keyboard.ts] *new* + /src/common/tsconfig.json (default) +Config:: + [/src/common/tsconfig.json] *new* + RetainingProjects: + /src/common/tsconfig.json + RetainingOpenFiles: + /src/common/input/keyboard.ts +Config File Names:: + [/src/common/input/keyboard.ts] *new* + NearestConfigFileName: /src/common/tsconfig.json + Ancestors: + /src/common/tsconfig.json /src/tsconfig.json + /src/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///src/terminal.ts", + "languageId": "typescript", + "version": 0, + "text": "import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction foo() {\n\treturn evaluateKeyboardEvent();\n}" + } + } +} + +Projects:: + [/src/common/tsconfig.json] + /src/common/input/keyboard.ts + /src/common/input/keyboard.test.ts + [/src/tsconfig.json] *modified* + /src/common/input/keyboard.ts *new* + /src/terminal.ts *new* + /src/common/input/keyboard.test.ts *new* +Open Files:: + [/src/common/input/keyboard.ts] *modified* + /src/common/tsconfig.json (default) + /src/tsconfig.json *new* + [/src/terminal.ts] *new* + /src/tsconfig.json (default) +Config:: + [/src/common/tsconfig.json] *modified* + RetainingProjects: *modified* + /src/common/tsconfig.json + /src/tsconfig.json *new* + RetainingOpenFiles: + /src/common/input/keyboard.ts + [/src/tsconfig.json] *new* + RetainingProjects: + /src/tsconfig.json + RetainingOpenFiles: + /src/terminal.ts +Config File Names:: + [/src/common/input/keyboard.ts] + NearestConfigFileName: /src/common/tsconfig.json + Ancestors: + /src/common/tsconfig.json /src/tsconfig.json + /src/tsconfig.json + [/src/terminal.ts] *new* + NearestConfigFileName: /src/tsconfig.json + Ancestors: + /src/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///src/common/input/keyboard.ts" + }, + "position": { + "line": 1, + "character": 16 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /src/common/input/keyboard.test.ts === +// import { [|evaluateKeyboardEvent|] } from 'common/input/keyboard'; +// function testEvaluateKeyboardEvent() { +// return [|evaluateKeyboardEvent|](); +// } + +// === /src/common/input/keyboard.ts === +// function bar() { return "just a random function so .d.ts location doesnt match"; } +// export function /*FIND ALL REFS*/[|evaluateKeyboardEvent|]() { } + +// === /src/terminal.ts === +// import { [|evaluateKeyboardEvent|] } from 'common/input/keyboard'; +// function foo() { +// return [|evaluateKeyboardEvent|](); +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline new file mode 100644 index 000000000..1c5b3a716 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsRootOfReferencedProjectDeclarationMaps.baseline @@ -0,0 +1,368 @@ +UseCaseSensitiveFileNames: true +//// [/out/input/keyboard.d.ts] *new* +export declare function evaluateKeyboardEvent(): void; +//# sourceMappingURL=keyboard.d.ts.map +//// [/out/input/keyboard.d.ts.map] *new* +{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/common/input/keyboard.ts"],"names":[],"mappings":"AACA,wBAAgB,qBAAqB,SAAM"} +//// [/out/input/keyboard.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.evaluateKeyboardEvent = evaluateKeyboardEvent; +function bar() { return "just a random function so .d.ts location doesnt match"; } +function evaluateKeyboardEvent() { } + +//// [/out/input/keyboard.test.d.ts] *new* +export {}; +//# sourceMappingURL=keyboard.test.d.ts.map +//// [/out/input/keyboard.test.d.ts.map] *new* +{"version":3,"file":"keyboard.test.d.ts","sourceRoot":"","sources":["../../src/common/input/keyboard.test.ts"],"names":[],"mappings":""} +//// [/out/input/keyboard.test.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const keyboard_1 = require("common/input/keyboard"); +function testEvaluateKeyboardEvent() { + return (0, keyboard_1.evaluateKeyboardEvent)(); +} + +//// [/out/src.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./input/keyboard.d.ts","../src/terminal.ts","./input/keyboard.test.d.ts","../src/common/input/keyboard.ts","../src/common/input/keyboard.test.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"362bf1943c7d2a927f25978d1f24d61f-export declare function evaluateKeyboardEvent(): void;\n//# sourceMappingURL=keyboard.d.ts.map",{"version":"ff8262b3768be0c0049523b4b8a7b4f7-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction foo() {\n\treturn evaluateKeyboardEvent();\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"aaff3960e003a07ef50db935cb91a696-export {};\n//# sourceMappingURL=keyboard.test.d.ts.map"],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./","tsBuildInfoFile":"./src.tsconfig.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./terminal.d.ts","resolvedRoot":[[2,5],[4,6]]} +//// [/out/src.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./input/keyboard.d.ts", + "../src/terminal.ts", + "./input/keyboard.test.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./input/keyboard.d.ts", + "../src/terminal.ts", + "./input/keyboard.test.d.ts", + "../src/common/input/keyboard.ts", + "../src/common/input/keyboard.test.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./input/keyboard.d.ts", + "version": "362bf1943c7d2a927f25978d1f24d61f-export declare function evaluateKeyboardEvent(): void;\n//# sourceMappingURL=keyboard.d.ts.map", + "signature": "362bf1943c7d2a927f25978d1f24d61f-export declare function evaluateKeyboardEvent(): void;\n//# sourceMappingURL=keyboard.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/terminal.ts", + "version": "ff8262b3768be0c0049523b4b8a7b4f7-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction foo() {\n\treturn evaluateKeyboardEvent();\n}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ff8262b3768be0c0049523b4b8a7b4f7-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction foo() {\n\treturn evaluateKeyboardEvent();\n}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./input/keyboard.test.d.ts", + "version": "aaff3960e003a07ef50db935cb91a696-export {};\n//# sourceMappingURL=keyboard.test.d.ts.map", + "signature": "aaff3960e003a07ef50db935cb91a696-export {};\n//# sourceMappingURL=keyboard.test.d.ts.map", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "./input/keyboard.d.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./", + "tsBuildInfoFile": "./src.tsconfig.tsbuildinfo" + }, + "referencedMap": { + "../src/terminal.ts": [ + "./input/keyboard.d.ts" + ] + }, + "latestChangedDtsFile": "./terminal.d.ts", + "resolvedRoot": [ + [ + "./input/keyboard.d.ts", + "../src/common/input/keyboard.ts" + ], + [ + "./input/keyboard.test.d.ts", + "../src/common/input/keyboard.test.ts" + ] + ], + "size": 1693 +} +//// [/out/terminal.d.ts] *new* +export {}; +//# sourceMappingURL=terminal.d.ts.map +//// [/out/terminal.d.ts.map] *new* +{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":""} +//// [/out/terminal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const keyboard_1 = require("common/input/keyboard"); +function foo() { + return (0, keyboard_1.evaluateKeyboardEvent)(); +} + +//// [/out/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/common/input/keyboard.ts","../src/common/input/keyboard.test.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e37abb18685aa8e2642ab0218eef699-function bar() { return \"just a random function so .d.ts location doesnt match\"; }\nexport function evaluateKeyboardEvent() { }","signature":"569df1f274cf52f322c6e7a2f4e891fe-export declare function evaluateKeyboardEvent(): void;\n","impliedNodeFormat":1},{"version":"e844013c2f8764710bfebda24351c0d3-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction testEvaluateKeyboardEvent() {\n\treturn evaluateKeyboardEvent();\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./input/keyboard.test.d.ts"} +//// [/out/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/common/input/keyboard.ts", + "../src/common/input/keyboard.test.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/common/input/keyboard.ts", + "../src/common/input/keyboard.test.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/common/input/keyboard.ts", + "version": "6e37abb18685aa8e2642ab0218eef699-function bar() { return \"just a random function so .d.ts location doesnt match\"; }\nexport function evaluateKeyboardEvent() { }", + "signature": "569df1f274cf52f322c6e7a2f4e891fe-export declare function evaluateKeyboardEvent(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6e37abb18685aa8e2642ab0218eef699-function bar() { return \"just a random function so .d.ts location doesnt match\"; }\nexport function evaluateKeyboardEvent() { }", + "signature": "569df1f274cf52f322c6e7a2f4e891fe-export declare function evaluateKeyboardEvent(): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/common/input/keyboard.test.ts", + "version": "e844013c2f8764710bfebda24351c0d3-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction testEvaluateKeyboardEvent() {\n\treturn evaluateKeyboardEvent();\n}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e844013c2f8764710bfebda24351c0d3-import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction testEvaluateKeyboardEvent() {\n\treturn evaluateKeyboardEvent();\n}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/common/input/keyboard.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/common/input/keyboard.test.ts": [ + "../src/common/input/keyboard.ts" + ] + }, + "latestChangedDtsFile": "./input/keyboard.test.d.ts", + "size": 1658 +} +//// [/src/common/input/keyboard.test.ts] *new* +import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function testEvaluateKeyboardEvent() { + return evaluateKeyboardEvent(); +} +//// [/src/common/input/keyboard.ts] *new* +function bar() { return "just a random function so .d.ts location doesnt match"; } +export function evaluateKeyboardEvent() { } +//// [/src/common/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../../out", + "disableSourceOfProjectReferenceRedirect": true, + "paths": { + "*": ["../*"], + }, + }, + "include": ["./\**/*"] +} +//// [/src/terminal.ts] *new* +import { evaluateKeyboardEvent } from 'common/input/keyboard'; +function foo() { + return evaluateKeyboardEvent(); +} +//// [/src/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declarationMap": true, + "outDir": "../out", + "disableSourceOfProjectReferenceRedirect": true, + "paths": { + "common/*": ["./common/*"], + }, + "tsBuildInfoFile": "../out/src.tsconfig.tsbuildinfo" + }, + "include": ["./\**/*"], + "references": [ + { "path": "./common" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///src/common/input/keyboard.ts", + "languageId": "typescript", + "version": 0, + "text": "function bar() { return \"just a random function so .d.ts location doesnt match\"; }\nexport function evaluateKeyboardEvent() { }" + } + } +} + +Projects:: + [/src/common/tsconfig.json] *new* + /src/common/input/keyboard.ts + /src/common/input/keyboard.test.ts + [/src/tsconfig.json] *new* +Open Files:: + [/src/common/input/keyboard.ts] *new* + /src/common/tsconfig.json (default) +Config:: + [/src/common/tsconfig.json] *new* + RetainingProjects: + /src/common/tsconfig.json + RetainingOpenFiles: + /src/common/input/keyboard.ts +Config File Names:: + [/src/common/input/keyboard.ts] *new* + NearestConfigFileName: /src/common/tsconfig.json + Ancestors: + /src/common/tsconfig.json /src/tsconfig.json + /src/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///src/terminal.ts", + "languageId": "typescript", + "version": 0, + "text": "import { evaluateKeyboardEvent } from 'common/input/keyboard';\nfunction foo() {\n\treturn evaluateKeyboardEvent();\n}" + } + } +} + +Projects:: + [/src/common/tsconfig.json] + /src/common/input/keyboard.ts + /src/common/input/keyboard.test.ts + [/src/tsconfig.json] *modified* + /out/input/keyboard.d.ts *new* + /src/terminal.ts *new* + /out/input/keyboard.test.d.ts *new* +Open Files:: + [/src/common/input/keyboard.ts] + /src/common/tsconfig.json (default) + [/src/terminal.ts] *new* + /src/tsconfig.json (default) +Config:: + [/src/common/tsconfig.json] *modified* + RetainingProjects: *modified* + /src/common/tsconfig.json + /src/tsconfig.json *new* + RetainingOpenFiles: + /src/common/input/keyboard.ts + [/src/tsconfig.json] *new* + RetainingProjects: + /src/tsconfig.json + RetainingOpenFiles: + /src/terminal.ts +Config File Names:: + [/src/common/input/keyboard.ts] + NearestConfigFileName: /src/common/tsconfig.json + Ancestors: + /src/common/tsconfig.json /src/tsconfig.json + /src/tsconfig.json + [/src/terminal.ts] *new* + NearestConfigFileName: /src/tsconfig.json + Ancestors: + /src/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///src/common/input/keyboard.ts" + }, + "position": { + "line": 1, + "character": 16 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /src/common/input/keyboard.test.ts === +// import { [|evaluateKeyboardEvent|] } from 'common/input/keyboard'; +// function testEvaluateKeyboardEvent() { +// return [|evaluateKeyboardEvent|](); +// } + +// === /src/common/input/keyboard.ts === +// function bar() { return "just a random function so .d.ts location doesnt match"; } +// export function /*FIND ALL REFS*/[|evaluateKeyboardEvent|]() { } + +// === /src/terminal.ts === +// import { [|evaluateKeyboardEvent|] } from 'common/input/keyboard'; +// function foo() { +// return [|evaluateKeyboardEvent|](); +// } \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline new file mode 100644 index 000000000..9c58b1571 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectDirectly.baseline @@ -0,0 +1,447 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} + +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "files": [], + "references": [{ "path": "./tsconfig-src.json" }] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}\n" + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + [/myproject/tsconfig.json] *new* + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} +// + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline new file mode 100644 index 000000000..5eaa2c755 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectly.baseline @@ -0,0 +1,623 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect1/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect2/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/indirect1/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect1/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/indirect2/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect2/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect1/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect1/main.d.ts"} +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect1/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect1/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect1/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect1/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect2/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect2/main.d.ts"} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect2/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect2/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect2/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect2/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-indirect1.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +//// [/myproject/tsconfig-indirect2.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} + +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}" + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *new* + [/myproject/tsconfig-indirect2.json] *new* + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + [/myproject/tsconfig.json] *new* + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline new file mode 100644 index 000000000..5a6e45d79 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoad.baseline @@ -0,0 +1,597 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect1/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect2/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/indirect1/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect1/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/indirect2/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect2/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect1/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect1/main.d.ts"} +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect1/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect1/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect1/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect1/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect2/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect2/main.d.ts"} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect2/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect2/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect2/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect2/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-indirect1.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +//// [/myproject/tsconfig-indirect2.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} + +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /dev/null/inferred (default) +Config:: + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dev/null/inferred] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /dev/null/inferred (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /dev/null/inferred (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts +Open Files:: + [/myproject/src/main.ts] *new* + /dev/null/inferred (default) +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *new* + [/myproject/tsconfig-indirect2.json] *new* + [/myproject/tsconfig.json] *new* + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline new file mode 100644 index 000000000..2f2df123c --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionReferencingDefaultProjectIndirectlyThroughDisableReferencedProjectLoadInOneButWithoutItInAnother.baseline @@ -0,0 +1,624 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect1/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect2/main.ts] *new* +export const indirect = 1; +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/indirect1/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect1/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/indirect2/main.d.ts] *new* +export declare const indirect = 1; + +//// [/myproject/target/indirect2/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirect = void 0; +exports.indirect = 1; + +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect1/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect1/main.d.ts"} +//// [/myproject/target/tsconfig-indirect1.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect1/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect1/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect1/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect1/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../indirect2/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"265b044bf7f805e401e883488ec6cb29-export const indirect = 1;","signature":"bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./indirect2/main.d.ts"} +//// [/myproject/target/tsconfig-indirect2.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../indirect2/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../indirect2/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../indirect2/main.ts", + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "265b044bf7f805e401e883488ec6cb29-export const indirect = 1;", + "signature": "bf177928c61dd707122e7eeb99aa0ef0-export declare const indirect = 1;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./indirect2/main.d.ts", + "size": 1140 +} +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-indirect1.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + "disableReferencedProjectLoad": true, + }, + "files": [ + "./indirect1/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} +//// [/myproject/tsconfig-indirect2.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target/", + }, + "files": [ + "./indirect2/main.ts" + ], + "references": [ + { + "path": "./tsconfig-src.json" + } + ] +} + +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./tsconfig-indirect1.json" }, + { "path": "./tsconfig-indirect2.json" }, + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /myproject/tsconfig-src.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dummy/tsconfig.json] + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /myproject/tsconfig-src.json (default) +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig-indirect1.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-indirect2.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + RetainingOpenFiles: + /myproject/src/main.ts + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig-src.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}" + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *deleted* + [/myproject/tsconfig-indirect2.json] *deleted* + [/myproject/tsconfig-src.json] *deleted* + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/indirect3/tsconfig.json] + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts + [/myproject/tsconfig-src.json] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig-indirect1.json] *new* + [/myproject/tsconfig-indirect2.json] *new* + [/myproject/tsconfig-src.json] *new* + RetainingProjects: + /myproject/tsconfig-src.json + [/myproject/tsconfig.json] *new* + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline new file mode 100644 index 000000000..42f55d967 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSolutionWithDisableReferencedProjectLoadReferencingDefaultProjectDirectly.baseline @@ -0,0 +1,422 @@ +UseCaseSensitiveFileNames: true +//// [/dummy/dummy.ts] *new* +const x = 1; +//// [/dummy/tsconfig.json] *new* +{ } +//// [/myproject/indirect3/main.ts] *new* +import { foo } from '../target/src/main'; +foo() +export function bar() {} + +//// [/myproject/indirect3/tsconfig.json] *new* +{ } +//// [/myproject/src/helpers/functions.ts] *new* +export function foo() { return 1; } +//// [/myproject/src/main.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//// [/myproject/target/src/helpers/functions.d.ts] *new* +export declare function foo(): number; +//# sourceMappingURL=functions.d.ts.map +//// [/myproject/target/src/helpers/functions.d.ts.map] *new* +{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/helpers/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,WAAgB"} +//// [/myproject/target/src/helpers/functions.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { return 1; } + +//// [/myproject/target/src/main.d.ts] *new* +import { foo } from './helpers/functions'; +export { foo }; +//# sourceMappingURL=main.d.ts.map +//// [/myproject/target/src/main.d.ts.map] *new* +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,CAAC"} +//// [/myproject/target/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +const functions_1 = require("./helpers/functions"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return functions_1.foo; } }); + +//// [/myproject/target/tsconfig-src.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/helpers/functions.ts","../src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }","signature":"029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n","impliedNodeFormat":1},{"version":"29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };","signature":"e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declarationMap":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/myproject/target/tsconfig-src.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/helpers/functions.ts", + "../src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/helpers/functions.ts", + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "bf6a9d57f087ab0066015134975ea2b2-export function foo() { return 1; }", + "signature": "029742dfbcde5b1dfd06f9129660afb3-export declare function foo(): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "29b72d75211ebc765497b1845400b55d-import { foo } from './helpers/functions';\nexport { foo };", + "signature": "e7ab16a2673b38216aba41fa1cf9516c-import { foo } from './helpers/functions';\nexport { foo };\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/helpers/functions.ts" + ] + ], + "options": { + "composite": true, + "declarationMap": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../src/helpers/functions.ts" + ] + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1479 +} +//// [/myproject/tsconfig-src.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "./target", + "declarationMap": true, + }, + "include": ["./src/\**/*"] +} +//// [/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "disableReferencedProjectLoad": true + }, + "files": [], + "references": [{ "path": "./tsconfig-src.json" }] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts +Open Files:: + [/myproject/src/main.ts] *new* + /dev/null/inferred (default) +Config:: + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dev/null/inferred] + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] *new* + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) + [/myproject/src/main.ts] + /dev/null/inferred (default) +Config:: + [/dummy/tsconfig.json] *new* + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig.json] + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *new* + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + [/myproject/src/main.ts] + /dev/null/inferred (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts", + "languageId": "typescript", + "version": 0, + "text": "const x = 1;" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] + /dummy/dummy.ts +Open Files:: + [/dummy/dummy.ts] *new* + /dummy/tsconfig.json (default) +Config:: + [/dummy/tsconfig.json] + RetainingProjects: + /dummy/tsconfig.json + RetainingOpenFiles: + /dummy/dummy.ts + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/dummy/dummy.ts] + NearestConfigFileName: /dummy/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///dummy/dummy.ts" + } + } +} + +Open Files:: + [/dummy/dummy.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from './helpers/functions';\nexport { foo };" + } + } +} + +Projects:: + [/dev/null/inferred] *new* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/dummy/tsconfig.json] *deleted* + /dummy/dummy.ts +Open Files:: + [/myproject/src/main.ts] *new* + /dev/null/inferred (default) +Config:: + [/dummy/tsconfig.json] *deleted* + [/myproject/tsconfig.json] *new* + RetainingOpenFiles: + /myproject/src/main.ts +Config File Names:: + [/dummy/dummy.ts] *deleted* + [/myproject/src/main.ts] *new* + NearestConfigFileName: /myproject/tsconfig.json + Ancestors: + /myproject/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + }, + "position": { + "line": 1, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + + + + +// === findAllReferences === +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { /*FIND ALL REFS*/foo }; +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///myproject/src/main.ts" + } + } +} + +Open Files:: + [/myproject/src/main.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts", + "languageId": "typescript", + "version": 0, + "text": "import { foo } from '../target/src/main';\nfoo()\nexport function bar() {}\n" + } + } +} + +Projects:: + [/dev/null/inferred] *deleted* + /myproject/src/helpers/functions.ts + /myproject/src/main.ts + [/myproject/indirect3/tsconfig.json] *new* + /myproject/target/src/helpers/functions.d.ts + /myproject/target/src/main.d.ts + /myproject/indirect3/main.ts +Open Files:: + [/myproject/indirect3/main.ts] *new* + /myproject/indirect3/tsconfig.json (default) +Config:: + [/myproject/indirect3/tsconfig.json] *new* + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig.json] *deleted* +Config File Names:: + [/myproject/indirect3/main.ts] *new* + NearestConfigFileName: /myproject/indirect3/tsconfig.json + [/myproject/src/main.ts] *deleted* + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/indirect3/main.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Config:: + [/myproject/indirect3/tsconfig.json] + RetainingProjects: + /myproject/indirect3/tsconfig.json + RetainingOpenFiles: + /myproject/indirect3/main.ts + [/myproject/tsconfig.json] *new* + + + + +// === findAllReferences === +// === /myproject/indirect3/main.ts === +// import { /*FIND ALL REFS*/[|foo|] } from '../target/src/main'; +// [|foo|]() +// export function bar() {} +// + +// === /myproject/src/helpers/functions.ts === +// export function [|foo|]() { return 1; } + +// === /myproject/src/main.ts === +// import { [|foo|] } from './helpers/functions'; +// export { foo }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline new file mode 100644 index 000000000..91a1f25a3 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralProperty.baseline @@ -0,0 +1,130 @@ +UseCaseSensitiveFileNames: true +//// [/solution/api/src/server.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.bar(); +//// [/solution/api/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/app/src/app.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.bar(); +//// [/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/shared/src/index.ts] *new* +const local = { bar: () => { } }; +export const foo = local; +//// [/solution/shared/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as shared from \"../../shared/dist\"\nshared.foo.bar();" + } + } +} + +Projects:: + [/solution/api/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/api/src/server.ts] *new* + /solution/api/tsconfig.json (default) +Config:: + [/solution/api/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json +Config File Names:: + [/solution/api/src/server.ts] *new* + NearestConfigFileName: /solution/api/tsconfig.json + Ancestors: + /solution/api/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts" + }, + "position": { + "line": 1, + "character": 11 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/api/tsconfig.json] + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + /solution/shared/src/index.ts + [/solution/tsconfig.json] +Config:: + [/solution/api/tsconfig.json] + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/shared/tsconfig.json *new* + + + + +// === findAllReferences === +// === /solution/api/src/server.ts === +// import * as shared from "../../shared/dist" +// shared.foo./*FIND ALL REFS*/[|bar|](); + +// === /solution/shared/src/index.ts === +// const local = { [|bar|]: () => { } }; +// export const foo = local; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline new file mode 100644 index 000000000..950d47029 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAsObjectLiteralPropertyTypes.baseline @@ -0,0 +1,145 @@ +UseCaseSensitiveFileNames: true +//// [/solution/api/src/server.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.bar(); +//// [/solution/api/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/app/src/app.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.bar(); +//// [/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/shared/src/index.ts] *new* +export const foo = { bar: () => { } }; +//// [/solution/shared/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as shared from \"../../shared/dist\"\nshared.foo.bar();" + } + } +} + +Projects:: + [/solution/api/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/api/src/server.ts] *new* + /solution/api/tsconfig.json (default) +Config:: + [/solution/api/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json +Config File Names:: + [/solution/api/src/server.ts] *new* + NearestConfigFileName: /solution/api/tsconfig.json + Ancestors: + /solution/api/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts" + }, + "position": { + "line": 1, + "character": 11 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/api/tsconfig.json] + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/app/src/app.ts + [/solution/shared/tsconfig.json] *new* + /solution/shared/src/index.ts + [/solution/tsconfig.json] *modified* +Config:: + [/solution/api/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + RetainingProjects: + /solution/app/tsconfig.json + /solution/tsconfig.json + [/solution/shared/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/app/tsconfig.json *new* + /solution/shared/tsconfig.json *new* + /solution/tsconfig.json *new* + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/api/src/server.ts === +// import * as shared from "../../shared/dist" +// shared.foo./*FIND ALL REFS*/[|bar|](); + +// === /solution/app/src/app.ts === +// import * as shared from "../../shared/dist" +// shared.foo.[|bar|](); + +// === /solution/shared/src/index.ts === +// export const foo = { [|bar|]: () => { } }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline new file mode 100644 index 000000000..79d114c2d --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessArrowFunctionAssignment.baseline @@ -0,0 +1,145 @@ +UseCaseSensitiveFileNames: true +//// [/solution/api/src/server.ts] *new* +import * as shared from "../../shared/dist" +shared.dog(); +//// [/solution/api/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/app/src/app.ts] *new* +import * as shared from "../../shared/dist" +shared.dog(); +//// [/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/shared/src/index.ts] *new* +export const dog = () => { }; +//// [/solution/shared/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as shared from \"../../shared/dist\"\nshared.dog();" + } + } +} + +Projects:: + [/solution/api/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/api/src/server.ts] *new* + /solution/api/tsconfig.json (default) +Config:: + [/solution/api/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json +Config File Names:: + [/solution/api/src/server.ts] *new* + NearestConfigFileName: /solution/api/tsconfig.json + Ancestors: + /solution/api/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts" + }, + "position": { + "line": 1, + "character": 7 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/api/tsconfig.json] + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/app/src/app.ts + [/solution/shared/tsconfig.json] *new* + /solution/shared/src/index.ts + [/solution/tsconfig.json] *modified* +Config:: + [/solution/api/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + RetainingProjects: + /solution/app/tsconfig.json + /solution/tsconfig.json + [/solution/shared/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/app/tsconfig.json *new* + /solution/shared/tsconfig.json *new* + /solution/tsconfig.json *new* + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/api/src/server.ts === +// import * as shared from "../../shared/dist" +// shared./*FIND ALL REFS*/[|dog|](); + +// === /solution/app/src/app.ts === +// import * as shared from "../../shared/dist" +// shared.[|dog|](); + +// === /solution/shared/src/index.ts === +// export const [|dog|] = () => { }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline new file mode 100644 index 000000000..ea029f119 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessMethodOfClassExpression.baseline @@ -0,0 +1,149 @@ +UseCaseSensitiveFileNames: true +//// [/solution/api/src/server.ts] *new* +import * as shared from "../../shared/dist" +const instance = new shared.foo(); +instance.fly(); +//// [/solution/api/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/app/src/app.ts] *new* +import * as shared from "../../shared/dist" +const instance = new shared.foo(); +instance.fly(); +//// [/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/shared/src/index.ts] *new* +export const foo = class { fly() {} }; +//// [/solution/shared/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as shared from \"../../shared/dist\"\nconst instance = new shared.foo();\ninstance.fly();" + } + } +} + +Projects:: + [/solution/api/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/api/src/server.ts] *new* + /solution/api/tsconfig.json (default) +Config:: + [/solution/api/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json +Config File Names:: + [/solution/api/src/server.ts] *new* + NearestConfigFileName: /solution/api/tsconfig.json + Ancestors: + /solution/api/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts" + }, + "position": { + "line": 2, + "character": 9 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/api/tsconfig.json] + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/app/src/app.ts + [/solution/shared/tsconfig.json] *new* + /solution/shared/src/index.ts + [/solution/tsconfig.json] *modified* +Config:: + [/solution/api/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + RetainingProjects: + /solution/app/tsconfig.json + /solution/tsconfig.json + [/solution/shared/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/app/tsconfig.json *new* + /solution/shared/tsconfig.json *new* + /solution/tsconfig.json *new* + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/api/src/server.ts === +// import * as shared from "../../shared/dist" +// const instance = new shared.foo(); +// instance./*FIND ALL REFS*/[|fly|](); + +// === /solution/app/src/app.ts === +// import * as shared from "../../shared/dist" +// const instance = new shared.foo(); +// instance.[|fly|](); + +// === /solution/shared/src/index.ts === +// export const foo = class { [|fly|]() {} }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline new file mode 100644 index 000000000..00d57bb41 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsSpecialHandlingOfLocalnessObjectLiteralProperty.baseline @@ -0,0 +1,145 @@ +UseCaseSensitiveFileNames: true +//// [/solution/api/src/server.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.baz; +//// [/solution/api/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/app/src/app.ts] *new* +import * as shared from "../../shared/dist" +shared.foo.baz; +//// [/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], + "references": [{ "path": "../shared" }], +} +//// [/solution/shared/src/index.ts] *new* +export const foo = { baz: "BAZ" }; +//// [/solution/shared/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"], +} +//// [/solution/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./api" }, + { "path": "./app" }, + ], +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts", + "languageId": "typescript", + "version": 0, + "text": "import * as shared from \"../../shared/dist\"\nshared.foo.baz;" + } + } +} + +Projects:: + [/solution/api/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/tsconfig.json] *new* +Open Files:: + [/solution/api/src/server.ts] *new* + /solution/api/tsconfig.json (default) +Config:: + [/solution/api/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/shared/tsconfig.json] *new* + RetainingProjects: + /solution/api/tsconfig.json +Config File Names:: + [/solution/api/src/server.ts] *new* + NearestConfigFileName: /solution/api/tsconfig.json + Ancestors: + /solution/api/tsconfig.json /solution/tsconfig.json + /solution/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///solution/api/src/server.ts" + }, + "position": { + "line": 1, + "character": 11 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/solution/api/tsconfig.json] + /solution/shared/src/index.ts + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + /solution/shared/src/index.ts + /solution/app/src/app.ts + [/solution/shared/tsconfig.json] *new* + /solution/shared/src/index.ts + [/solution/tsconfig.json] *modified* +Config:: + [/solution/api/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/tsconfig.json *new* + RetainingOpenFiles: + /solution/api/src/server.ts + [/solution/app/tsconfig.json] *new* + RetainingProjects: + /solution/app/tsconfig.json + /solution/tsconfig.json + [/solution/shared/tsconfig.json] *modified* + RetainingProjects: *modified* + /solution/api/tsconfig.json + /solution/app/tsconfig.json *new* + /solution/shared/tsconfig.json *new* + /solution/tsconfig.json *new* + [/solution/tsconfig.json] *new* + RetainingProjects: + /solution/tsconfig.json + + + + +// === findAllReferences === +// === /solution/api/src/server.ts === +// import * as shared from "../../shared/dist" +// shared.foo./*FIND ALL REFS*/[|baz|]; + +// === /solution/app/src/app.ts === +// import * as shared from "../../shared/dist" +// shared.foo.[|baz|]; + +// === /solution/shared/src/index.ts === +// export const foo = { [|baz|]: "BAZ" }; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline b/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline new file mode 100644 index 000000000..d1dde7193 --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/findAllRefsTwoProjectsOpenAndOneProjectReferences.baseline @@ -0,0 +1,369 @@ +UseCaseSensitiveFileNames: true +//// [/myproject/core/src/file1.ts] *new* +export const coreConst = 10; +//// [/myproject/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, +} +//// [/myproject/coreRef1/src/file1.ts] *new* +export const coreRef1Const = 10; +//// [/myproject/coreRef1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +//// [/myproject/coreRef2/src/file1.ts] *new* +export const coreRef2Const = 10; +//// [/myproject/coreRef2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +//// [/myproject/coreRef3/src/file1.ts] *new* +export const coreRef3Const = 10; +//// [/myproject/coreRef3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + ] +} +//// [/myproject/indirect/src/file1.ts] *new* +export const indirectConst = 10; +//// [/myproject/indirect/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../coreRef1" }, + ] +} +//// [/myproject/indirectDisabledChildLoad1/src/file1.ts] *new* +export const indirectDisabledChildLoad1Const = 10; +//// [/myproject/indirectDisabledChildLoad1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "disableReferencedProjectLoad": true, + }, + "references": [ + { "path": "../coreRef2" }, + ] +} +//// [/myproject/indirectDisabledChildLoad2/src/file1.ts] *new* +export const indirectDisabledChildLoad2Const = 10; +//// [/myproject/indirectDisabledChildLoad2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "disableReferencedProjectLoad": true, + }, + "references": [ + { "path": "../coreRef3" }, + ] +} +//// [/myproject/indirectNoCoreRef/src/file1.ts] *new* +export const indirectNoCoreRefConst = 10; +//// [/myproject/indirectNoCoreRef/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../noCoreRef2" }, + ] +} +//// [/myproject/main/src/file1.ts] *new* +export const mainConst = 10; +//// [/myproject/main/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../core" }, + { "path": "../indirect" }, + { "path": "../noCoreRef1" }, + { "path": "../indirectDisabledChildLoad1" }, + { "path": "../indirectDisabledChildLoad2" }, + { "path": "../refToCoreRef3" }, + { "path": "../indirectNoCoreRef" } + ] +} +//// [/myproject/noCoreRef1/src/file1.ts] *new* +export const noCoreRef1Const = 10; +//// [/myproject/noCoreRef1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, +} +//// [/myproject/noCoreRef2/src/file1.ts] *new* +export const noCoreRef2Const = 10; +//// [/myproject/noCoreRef2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, +} +//// [/myproject/refToCoreRef3/src/file1.ts] *new* +export const refToCoreRef3Const = 10; +//// [/myproject/refToCoreRef3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../coreRef3" }, + ] +} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/main/src/file1.ts", + "languageId": "typescript", + "version": 0, + "text": "export const mainConst = 10;" + } + } +} + +Projects:: + [/myproject/main/tsconfig.json] *new* + /myproject/main/src/file1.ts +Open Files:: + [/myproject/main/src/file1.ts] *new* + /myproject/main/tsconfig.json (default) +Config:: + [/myproject/core/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/coreRef1/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/coreRef2/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/coreRef3/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirect/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad1/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad2/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectNoCoreRef/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/main/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + RetainingOpenFiles: + /myproject/main/src/file1.ts + [/myproject/noCoreRef1/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/noCoreRef2/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/refToCoreRef3/tsconfig.json] *new* + RetainingProjects: + /myproject/main/tsconfig.json +Config File Names:: + [/myproject/main/src/file1.ts] *new* + NearestConfigFileName: /myproject/main/tsconfig.json + Ancestors: + /myproject/main/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///myproject/core/src/file1.ts", + "languageId": "typescript", + "version": 0, + "text": "export const coreConst = 10;" + } + } +} + +Projects:: + [/myproject/core/tsconfig.json] *new* + /myproject/core/src/file1.ts + [/myproject/main/tsconfig.json] + /myproject/main/src/file1.ts +Open Files:: + [/myproject/core/src/file1.ts] *new* + /myproject/core/tsconfig.json (default) + [/myproject/main/src/file1.ts] + /myproject/main/tsconfig.json (default) +Config:: + [/myproject/core/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/core/tsconfig.json *new* + /myproject/main/tsconfig.json + RetainingOpenFiles: *modified* + /myproject/core/src/file1.ts *new* + [/myproject/coreRef1/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/coreRef2/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/coreRef3/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirect/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad1/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad2/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/indirectNoCoreRef/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/main/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + RetainingOpenFiles: + /myproject/main/src/file1.ts + [/myproject/noCoreRef1/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/noCoreRef2/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/refToCoreRef3/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json +Config File Names:: + [/myproject/core/src/file1.ts] *new* + NearestConfigFileName: /myproject/core/tsconfig.json + Ancestors: + /myproject/core/tsconfig.json + [/myproject/main/src/file1.ts] + NearestConfigFileName: /myproject/main/tsconfig.json + Ancestors: + /myproject/main/tsconfig.json + +{ + "method": "textDocument/references", + "params": { + "textDocument": { + "uri": "file:///myproject/core/src/file1.ts" + }, + "position": { + "line": 0, + "character": 13 + }, + "context": { + "includeDeclaration": false + } + } +} + +Projects:: + [/myproject/core/tsconfig.json] + /myproject/core/src/file1.ts + [/myproject/coreRef1/tsconfig.json] *new* + /myproject/coreRef1/src/file1.ts + [/myproject/coreRef3/tsconfig.json] *new* + /myproject/coreRef3/src/file1.ts + [/myproject/indirect/tsconfig.json] *new* + /myproject/indirect/src/file1.ts + [/myproject/indirectDisabledChildLoad1/tsconfig.json] *new* + /myproject/indirectDisabledChildLoad1/src/file1.ts + [/myproject/indirectDisabledChildLoad2/tsconfig.json] *new* + /myproject/indirectDisabledChildLoad2/src/file1.ts + [/myproject/main/tsconfig.json] + /myproject/main/src/file1.ts + [/myproject/refToCoreRef3/tsconfig.json] *new* + /myproject/refToCoreRef3/src/file1.ts +Config:: + [/myproject/core/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/core/tsconfig.json + /myproject/coreRef1/tsconfig.json *new* + /myproject/coreRef3/tsconfig.json *new* + /myproject/indirect/tsconfig.json *new* + /myproject/indirectDisabledChildLoad1/tsconfig.json *new* + /myproject/indirectDisabledChildLoad2/tsconfig.json *new* + /myproject/main/tsconfig.json + /myproject/refToCoreRef3/tsconfig.json *new* + RetainingOpenFiles: + /myproject/core/src/file1.ts + [/myproject/coreRef1/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/coreRef1/tsconfig.json *new* + /myproject/indirect/tsconfig.json *new* + /myproject/main/tsconfig.json + [/myproject/coreRef2/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/indirectDisabledChildLoad1/tsconfig.json *new* + /myproject/main/tsconfig.json + [/myproject/coreRef3/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/coreRef3/tsconfig.json *new* + /myproject/indirectDisabledChildLoad2/tsconfig.json *new* + /myproject/main/tsconfig.json + /myproject/refToCoreRef3/tsconfig.json *new* + [/myproject/indirect/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/indirect/tsconfig.json *new* + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad1/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/indirectDisabledChildLoad1/tsconfig.json *new* + /myproject/main/tsconfig.json + [/myproject/indirectDisabledChildLoad2/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/indirectDisabledChildLoad2/tsconfig.json *new* + /myproject/main/tsconfig.json + [/myproject/indirectNoCoreRef/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/main/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + RetainingOpenFiles: + /myproject/main/src/file1.ts + [/myproject/noCoreRef1/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/noCoreRef2/tsconfig.json] + RetainingProjects: + /myproject/main/tsconfig.json + [/myproject/refToCoreRef3/tsconfig.json] *modified* + RetainingProjects: *modified* + /myproject/main/tsconfig.json + /myproject/refToCoreRef3/tsconfig.json *new* + + + + +// === findAllReferences === +// === /myproject/core/src/file1.ts === +// export const /*FIND ALL REFS*/[|coreConst|] = 10; \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/state/renameAncestorProjectRefMangement.baseline b/testdata/baselines/reference/fourslash/state/renameAncestorProjectRefMangement.baseline new file mode 100644 index 000000000..5fdfa774d --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/renameAncestorProjectRefMangement.baseline @@ -0,0 +1,254 @@ +UseCaseSensitiveFileNames: true +//// [/projects/container/compositeExec/index.ts] *new* +import { myConst } from "../lib"; +export function getMyConst() { + return myConst; +} +//// [/projects/container/compositeExec/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "files": ["./index.ts"], + "references": [ + { "path": "../lib" }, + ], +} +//// [/projects/container/exec/index.ts] *new* +import { myConst } from "../lib"; +export function getMyConst() { + return myConst; +} +//// [/projects/container/exec/tsconfig.json] *new* +{ + "files": ["./index.ts"], + "references": [ + { "path": "../lib" }, + ], +} +//// [/projects/container/lib/index.ts] *new* +export const myConst = 30; +//// [/projects/container/lib/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + references: [], + files: [ + "index.ts", + ], +} +//// [/projects/container/tsconfig.json] *new* +{ + "files": [], + "include": [], + "references": [ + { "path": "./exec" }, + { "path": "./compositeExec" }, + ], +} + +//// [/projects/temp/temp.ts] *new* +let x = 10 +//// [/projects/temp/tsconfig.json] *new* +{} + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/container/compositeExec/index.ts", + "languageId": "typescript", + "version": 0, + "text": "import { myConst } from \"../lib\";\nexport function getMyConst() {\n\treturn myConst;\n}" + } + } +} + +Projects:: + [/projects/container/compositeExec/tsconfig.json] *new* + /projects/container/lib/index.ts + /projects/container/compositeExec/index.ts + [/projects/container/tsconfig.json] *new* +Open Files:: + [/projects/container/compositeExec/index.ts] *new* + /projects/container/compositeExec/tsconfig.json (default) +Config:: + [/projects/container/compositeExec/tsconfig.json] *new* + RetainingProjects: + /projects/container/compositeExec/tsconfig.json + RetainingOpenFiles: + /projects/container/compositeExec/index.ts + [/projects/container/lib/tsconfig.json] *new* + RetainingProjects: + /projects/container/compositeExec/tsconfig.json +Config File Names:: + [/projects/container/compositeExec/index.ts] *new* + NearestConfigFileName: /projects/container/compositeExec/tsconfig.json + Ancestors: + /projects/container/compositeExec/tsconfig.json /projects/container/tsconfig.json + /projects/container/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/temp/temp.ts", + "languageId": "typescript", + "version": 0, + "text": "let x = 10" + } + } +} + +Projects:: + [/projects/container/compositeExec/tsconfig.json] + /projects/container/lib/index.ts + /projects/container/compositeExec/index.ts + [/projects/container/tsconfig.json] + [/projects/temp/tsconfig.json] *new* + /projects/temp/temp.ts +Open Files:: + [/projects/container/compositeExec/index.ts] + /projects/container/compositeExec/tsconfig.json (default) + [/projects/temp/temp.ts] *new* + /projects/temp/tsconfig.json (default) +Config:: + [/projects/container/compositeExec/tsconfig.json] + RetainingProjects: + /projects/container/compositeExec/tsconfig.json + RetainingOpenFiles: + /projects/container/compositeExec/index.ts + [/projects/container/lib/tsconfig.json] + RetainingProjects: + /projects/container/compositeExec/tsconfig.json + [/projects/temp/tsconfig.json] *new* + RetainingProjects: + /projects/temp/tsconfig.json + RetainingOpenFiles: + /projects/temp/temp.ts +Config File Names:: + [/projects/container/compositeExec/index.ts] + NearestConfigFileName: /projects/container/compositeExec/tsconfig.json + Ancestors: + /projects/container/compositeExec/tsconfig.json /projects/container/tsconfig.json + /projects/container/tsconfig.json + [/projects/temp/temp.ts] *new* + NearestConfigFileName: /projects/temp/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///projects/container/compositeExec/index.ts" + }, + "position": { + "line": 0, + "character": 9 + }, + "newName": "?" + } +} + + + + +// === findRenameLocations === +// === /projects/container/compositeExec/index.ts === +// import { /*START PREFIX*/myConst as /*RENAME*/[|myConstRENAME|] } from "../lib"; +// export function getMyConst() { +// return [|myConstRENAME|]; +// } +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///projects/temp/temp.ts" + } + } +} + +Open Files:: + [/projects/container/compositeExec/index.ts] + /projects/container/compositeExec/tsconfig.json (default) + [/projects/temp/temp.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/temp/temp.ts", + "languageId": "typescript", + "version": 0, + "text": "let x = 10" + } + } +} + +Open Files:: + [/projects/container/compositeExec/index.ts] + /projects/container/compositeExec/tsconfig.json (default) + [/projects/temp/temp.ts] *new* + /projects/temp/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///projects/container/compositeExec/index.ts" + } + } +} + +Open Files:: + [/projects/container/compositeExec/index.ts] *closed* + [/projects/temp/temp.ts] + /projects/temp/tsconfig.json (default) + +{ + "method": "textDocument/didClose", + "params": { + "textDocument": { + "uri": "file:///projects/temp/temp.ts" + } + } +} + +Open Files:: + [/projects/temp/temp.ts] *closed* + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/temp/temp.ts", + "languageId": "typescript", + "version": 0, + "text": "let x = 10" + } + } +} + +Projects:: + [/projects/container/compositeExec/tsconfig.json] *deleted* + /projects/container/lib/index.ts + /projects/container/compositeExec/index.ts + [/projects/container/tsconfig.json] *deleted* + [/projects/temp/tsconfig.json] + /projects/temp/temp.ts +Open Files:: + [/projects/temp/temp.ts] *new* + /projects/temp/tsconfig.json (default) +Config:: + [/projects/container/compositeExec/tsconfig.json] *deleted* + [/projects/container/lib/tsconfig.json] *deleted* + [/projects/temp/tsconfig.json] + RetainingProjects: + /projects/temp/tsconfig.json + RetainingOpenFiles: + /projects/temp/temp.ts +Config File Names:: + [/projects/container/compositeExec/index.ts] *deleted* + [/projects/temp/temp.ts] + NearestConfigFileName: /projects/temp/tsconfig.json diff --git a/testdata/baselines/reference/fourslash/state/renameInCommonFile.baseline b/testdata/baselines/reference/fourslash/state/renameInCommonFile.baseline new file mode 100644 index 000000000..01ee54f6f --- /dev/null +++ b/testdata/baselines/reference/fourslash/state/renameInCommonFile.baseline @@ -0,0 +1,197 @@ +UseCaseSensitiveFileNames: true +//// [/projects/a/a.ts] *new* +import {C} from "./c/fc"; +console.log(C) +//// [/projects/a/c] -> /projects/c *new* +//// [/projects/a/tsconfig.json] *new* +{} +//// [/projects/b/b.ts] *new* +import {C} from "../c/fc"; +console.log(C) +//// [/projects/b/c] -> /projects/c *new* +//// [/projects/b/tsconfig.json] *new* +{} +//// [/projects/c/fc.ts] *new* +export const C = 42; + + + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/a/a.ts", + "languageId": "typescript", + "version": 0, + "text": "import {C} from \"./c/fc\";\nconsole.log(C)" + } + } +} + +Projects:: + [/projects/a/tsconfig.json] *new* + /projects/a/c/fc.ts + /projects/a/a.ts +Open Files:: + [/projects/a/a.ts] *new* + /projects/a/tsconfig.json (default) +Config:: + [/projects/a/tsconfig.json] *new* + RetainingProjects: + /projects/a/tsconfig.json + RetainingOpenFiles: + /projects/a/a.ts +Config File Names:: + [/projects/a/a.ts] *new* + NearestConfigFileName: /projects/a/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/b/b.ts", + "languageId": "typescript", + "version": 0, + "text": "import {C} from \"../c/fc\";\nconsole.log(C)" + } + } +} + +Projects:: + [/projects/a/tsconfig.json] + /projects/a/c/fc.ts + /projects/a/a.ts + [/projects/b/tsconfig.json] *new* + /projects/c/fc.ts + /projects/b/b.ts + /projects/b/c/fc.ts +Open Files:: + [/projects/a/a.ts] + /projects/a/tsconfig.json (default) + [/projects/b/b.ts] *new* + /projects/b/tsconfig.json (default) +Config:: + [/projects/a/tsconfig.json] + RetainingProjects: + /projects/a/tsconfig.json + RetainingOpenFiles: + /projects/a/a.ts + [/projects/b/tsconfig.json] *new* + RetainingProjects: + /projects/b/tsconfig.json + RetainingOpenFiles: + /projects/b/b.ts +Config File Names:: + [/projects/a/a.ts] + NearestConfigFileName: /projects/a/tsconfig.json + [/projects/b/b.ts] *new* + NearestConfigFileName: /projects/b/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/a/c/fc.ts", + "languageId": "typescript", + "version": 0, + "text": "export const C = 42;\n" + } + } +} + +Open Files:: + [/projects/a/a.ts] + /projects/a/tsconfig.json (default) + [/projects/a/c/fc.ts] *new* + /projects/a/tsconfig.json (default) + [/projects/b/b.ts] + /projects/b/tsconfig.json (default) +Config:: + [/projects/a/tsconfig.json] *modified* + RetainingProjects: + /projects/a/tsconfig.json + RetainingOpenFiles: *modified* + /projects/a/a.ts + /projects/a/c/fc.ts *new* + [/projects/b/tsconfig.json] + RetainingProjects: + /projects/b/tsconfig.json + RetainingOpenFiles: + /projects/b/b.ts +Config File Names:: + [/projects/a/a.ts] + NearestConfigFileName: /projects/a/tsconfig.json + [/projects/a/c/fc.ts] *new* + NearestConfigFileName: /projects/a/tsconfig.json + [/projects/b/b.ts] + NearestConfigFileName: /projects/b/tsconfig.json + +{ + "method": "textDocument/didOpen", + "params": { + "textDocument": { + "uri": "file:///projects/b/c/fc.ts", + "languageId": "typescript", + "version": 0, + "text": "export const C = 42;\n" + } + } +} + +Open Files:: + [/projects/a/a.ts] + /projects/a/tsconfig.json (default) + [/projects/a/c/fc.ts] + /projects/a/tsconfig.json (default) + [/projects/b/b.ts] + /projects/b/tsconfig.json (default) + [/projects/b/c/fc.ts] *new* + /projects/b/tsconfig.json (default) +Config:: + [/projects/a/tsconfig.json] + RetainingProjects: + /projects/a/tsconfig.json + RetainingOpenFiles: + /projects/a/a.ts + /projects/a/c/fc.ts + [/projects/b/tsconfig.json] *modified* + RetainingProjects: + /projects/b/tsconfig.json + RetainingOpenFiles: *modified* + /projects/b/b.ts + /projects/b/c/fc.ts *new* +Config File Names:: + [/projects/a/a.ts] + NearestConfigFileName: /projects/a/tsconfig.json + [/projects/a/c/fc.ts] + NearestConfigFileName: /projects/a/tsconfig.json + [/projects/b/b.ts] + NearestConfigFileName: /projects/b/tsconfig.json + [/projects/b/c/fc.ts] *new* + NearestConfigFileName: /projects/b/tsconfig.json + +{ + "method": "textDocument/rename", + "params": { + "textDocument": { + "uri": "file:///projects/a/c/fc.ts" + }, + "position": { + "line": 0, + "character": 13 + }, + "newName": "?" + } +} + + + + +// === findRenameLocations === +// === /projects/a/a.ts === +// import {[|CRENAME|]} from "./c/fc"; +// console.log([|CRENAME|]) + +// === /projects/a/c/fc.ts === +// export const /*RENAME*/C = 42; +// \ No newline at end of file diff --git a/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js b/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js new file mode 100644 index 000000000..f85b09a8f --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js @@ -0,0 +1,9 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --build --help --locale whoops +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. + diff --git a/testdata/baselines/reference/tsbuild/commandLine/locale.js b/testdata/baselines/reference/tsbuild/commandLine/locale.js new file mode 100644 index 000000000..a870d55c0 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/locale.js @@ -0,0 +1,147 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --build --help --locale en +ExitStatus:: Success +Output:: +Version FakeTSVersion +tsc: The TypeScript Compiler - Version FakeTSVersion + +BUILD OPTIONS + +Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at https://aka.ms/tsc-composite-builds + +--help, -h +Print this message. + +--help, -? + + +--watch, -w +Watch input files. + +--preserveWatchOutput +Disable wiping the console in watch mode. +type: boolean +default: false + +--listFiles +Print all of the files read during the compilation. +type: boolean +default: false + +--explainFiles +Print files read during the compilation including why it was included. +type: boolean +default: false + +--listEmittedFiles +Print the names of emitted files after a compilation. +type: boolean +default: false + +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--traceResolution +Log paths used during the 'moduleResolution' process. +type: boolean +default: false + +--diagnostics +Output compiler performance information after building. +type: boolean +default: false + +--extendedDiagnostics +Output more detailed compiler performance information after building. +type: boolean +default: false + +--generateCpuProfile +Emit a v8 CPU profile of the compiler run for debugging. +type: string +default: profile.cpuprofile + +--generateTrace +Generates an event trace and a list of types. + +--incremental, -i +Save .tsbuildinfo files to allow for incremental compilation of projects. +type: boolean +default: `false`, unless `composite` is set + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--inlineSourceMap +Include sourcemap files inside the emitted JavaScript. +type: boolean +default: false + +--noCheck +Disable full type checking (only critical parse and emit errors will be reported). +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + +--assumeChangesOnlyAffectDirectDependencies +Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it. +type: boolean +default: false + +--locale +Set the language of the messaging from TypeScript. This does not affect emit. + +--quiet, -q +Do not print diagnostics. + +--singleThreaded +Run in single threaded mode. + +--pprofDir +Generate pprof CPU/memory profiles to the given directory. + +--checkers +Set the number of checkers per project. + +--verbose, -v +Enable verbose logging. + +--dry, -d +Show what would be built (or deleted, if specified with '--clean') + +--force, -f +Build all projects, including those that appear to be up to date. + +--clean +Delete the outputs of all projects. + +--stopBuildOnErrors +Skip building downstream projects on error in upstream project. + + diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js index a82f347c2..e4db762f7 100644 --- a/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js @@ -95,7 +95,7 @@ import ky from 'ky'; export const api = ky.extend({}); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":false,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"message":"Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named."}]]]} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":false,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"messageKey":"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","messageArgs":["api","KyInstance","\"/home/src/workspaces/project/node_modules/ky/distribution/index\""]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -138,11 +138,11 @@ export const api = ky.extend({}); { "fileName": "./index.ts", "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", - "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "signature": "80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n", "impliedNodeFormat": "ESNext", "original": { "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", - "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "signature": "80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n", "impliedNodeFormat": 99 } } @@ -173,12 +173,17 @@ export const api = ky.extend({}); "end": 37, "code": 4023, "category": 1, - "message": "Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named." + "messageKey": "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", + "messageArgs": [ + "api", + "KyInstance", + "\"/home/src/workspaces/project/node_modules/ky/distribution/index\"" + ] } ] ] ], - "size": 1983 + "size": 2025 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js index 57c66f13c..747675873 100644 --- a/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js +++ b/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -400,7 +400,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () "size": 2794 } //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":12,"end":13,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":12,"end":13,"code":6133,"category":1,"messageKey":"_0_is_declared_but_its_value_is_never_read_6133","messageArgs":["A"],"reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -526,14 +526,17 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () "end": 13, "code": 6133, "category": 1, - "message": "'A' is declared but its value is never read.", + "messageKey": "_0_is_declared_but_its_value_is_never_read_6133", + "messageArgs": [ + "A" + ], "reportsUnnecessary": true } ] ] ], "latestChangedDtsFile": "./utilities.d.ts", - "size": 3302 + "size": 3328 } //// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* export declare function makeRandomName(): string; diff --git a/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js b/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js index 2603d2cd2..bc6d9873a 100644 --- a/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js +++ b/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js @@ -325,7 +325,7 @@ Found 1 error in child/child.ts:1 //// [/home/src/workspaces/solution/child/child.js] *rewrite with same content* //// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./child.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}","signature":"3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[[2,[{"pos":23,"end":40,"code":2307,"category":1,"message":"Cannot find module '../child/child2' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./child.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./child.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}","signature":"3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[[2,[{"pos":23,"end":40,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["../child/child2"]}]]],"latestChangedDtsFile":"./child.d.ts"} //// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -378,13 +378,16 @@ Found 1 error in child/child.ts:1 "end": 40, "code": 2307, "category": 1, - "message": "Cannot find module '../child/child2' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "../child/child2" + ] } ] ] ], "latestChangedDtsFile": "./child.d.ts", - "size": 1344 + "size": 1369 } //// [/home/src/workspaces/solution/main/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index b58b23c46..efa4fc46f 100644 --- a/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -364,7 +364,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" //// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"message":"Expected 0 arguments, but got 1."}]]]} +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["0","1"]}]]]} //// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -493,12 +493,16 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" "end": 90, "code": 2554, "category": 1, - "message": "Expected 0 arguments, but got 1." + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "0", + "1" + ] } ] ] ], - "size": 3253 + "size": 3283 } tsconfig.json:: @@ -730,7 +734,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" //// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"message":"Expected 0 arguments, but got 1."}]]]} +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["0","1"]}]]]} //// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -859,12 +863,16 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" "end": 90, "code": 2554, "category": 1, - "message": "Expected 0 arguments, but got 1." + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "0", + "1" + ] } ] ] ], - "size": 3253 + "size": 3283 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js index bbd565a6c..839771740 100644 --- a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js +++ b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js @@ -217,7 +217,7 @@ function getVar() { } //// [/home/src/workspaces/lib/sub-project-2/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../solution/sub-project-2/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n readonly species: symbol;\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n","225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n",{"version":"db2a90e082fd17d65127bda69975a727-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}","signature":"f2cd6630b2dfa04d1fc92179f15d1647-declare const variable: {\n key: Nominal;\n};\n/**\n * @return {keyof typeof variable}\n */\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[[4,[{"pos":9,"end":18,"code":18042,"category":1,"message":"'MyNominal' is a type and cannot be imported in JavaScript files. Use 'import(\"../sub-project/index\").MyNominal' in a JSDoc type annotation."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../solution/sub-project-2/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n readonly species: symbol;\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n","225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n",{"version":"db2a90e082fd17d65127bda69975a727-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}","signature":"f2cd6630b2dfa04d1fc92179f15d1647-declare const variable: {\n key: Nominal;\n};\n/**\n * @return {keyof typeof variable}\n */\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[[4,[{"pos":9,"end":18,"code":18042,"category":1,"messageKey":"_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042","messageArgs":["MyNominal","import(\"../sub-project/index\").MyNominal"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/home/src/workspaces/lib/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -306,13 +306,17 @@ function getVar() { "end": 18, "code": 18042, "category": 1, - "message": "'MyNominal' is a type and cannot be imported in JavaScript files. Use 'import(\"../sub-project/index\").MyNominal' in a JSDoc type annotation." + "messageKey": "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", + "messageArgs": [ + "MyNominal", + "import(\"../sub-project/index\").MyNominal" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2322 + "size": 2350 } //// [/home/src/workspaces/lib/sub-project/index.d.ts] *new* import { Nominal } from '../common/nominal'; @@ -330,7 +334,7 @@ const nominal_1 = require("../common/nominal"); */ //// [/home/src/workspaces/lib/sub-project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../common/nominal.d.ts","../../solution/sub-project/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n readonly species: symbol;\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n",{"version":"00b7836eaf1e026f7764b7be6efcc8f5-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */","signature":"225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":16,"code":2305,"category":1,"message":"Module '\"../../lib/common/nominal\"' has no exported member 'Nominal'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../common/nominal.d.ts","../../solution/sub-project/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n readonly species: symbol;\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n",{"version":"00b7836eaf1e026f7764b7be6efcc8f5-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */","signature":"225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":16,"code":2305,"category":1,"messageKey":"Module_0_has_no_exported_member_1_2305","messageArgs":["\"../../lib/common/nominal\"","Nominal"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/home/src/workspaces/lib/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -406,13 +410,17 @@ const nominal_1 = require("../common/nominal"); "end": 16, "code": 2305, "category": 1, - "message": "Module '\"../../lib/common/nominal\"' has no exported member 'Nominal'." + "messageKey": "Module_0_has_no_exported_member_1_2305", + "messageArgs": [ + "\"../../lib/common/nominal\"", + "Nominal" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1877 + "size": 1904 } common/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js index 92ec8ba77..e40d22606 100644 --- a/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js @@ -84,7 +84,7 @@ exports.b = void 0; exports.b = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -122,11 +122,11 @@ exports.b = 10; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -159,21 +159,27 @@ exports.b = 10; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1810 + "size": 1878 } tsconfig.json:: @@ -487,7 +493,7 @@ const a = class { exports.a = a; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -525,11 +531,11 @@ exports.a = a; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -560,21 +566,27 @@ exports.a = a; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1806 + "size": 1874 } tsconfig.json:: @@ -640,7 +652,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -677,11 +689,11 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -709,21 +721,27 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1753 + "size": 1821 } tsconfig.json:: @@ -944,7 +962,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1026,12 +1044,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -1084,7 +1106,7 @@ const a = class { exports.a = a; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1124,11 +1146,11 @@ exports.a = a; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -1168,7 +1190,11 @@ exports.a = a; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -1182,21 +1208,27 @@ exports.a = a; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 2114 + "size": 2209 } tsconfig.json:: @@ -1230,7 +1262,7 @@ exports.a = void 0; exports.a = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1314,12 +1346,16 @@ exports.a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1350,7 +1386,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1432,12 +1468,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js index 3b59a18d1..38b75cfd0 100644 --- a/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js @@ -504,7 +504,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -573,12 +573,16 @@ Found 1 error in a.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1398 + "size": 1425 } tsconfig.json:: @@ -794,7 +798,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -876,12 +880,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -910,7 +918,7 @@ export declare const a: number; //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -994,12 +1002,16 @@ export declare const a: number; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1615 + "size": 1642 } tsconfig.json:: @@ -1028,7 +1040,7 @@ export declare const a = "hello"; //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1112,12 +1124,16 @@ export declare const a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1148,7 +1164,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1230,12 +1246,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js index de8cd5cf3..f3379da2d 100644 --- a/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js @@ -841,7 +841,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -923,12 +923,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -968,7 +972,7 @@ exports.a = void 0; exports.a = "hello; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1053,12 +1057,16 @@ exports.a = "hello; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1622 + "size": 1649 } tsconfig.json:: @@ -1090,7 +1098,7 @@ exports.a = void 0; exports.a = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1174,12 +1182,16 @@ exports.a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1210,7 +1222,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1292,12 +1304,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js b/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js index 597222516..0873954d6 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js @@ -349,7 +349,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -481,7 +481,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -489,7 +494,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -503,7 +511,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -511,7 +524,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -571,7 +587,7 @@ Errors Files ] } ], - "size": 3190 + "size": 3298 } tsconfig.json:: @@ -865,7 +881,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1007,7 +1023,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -1015,7 +1036,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -1029,7 +1053,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -1037,7 +1066,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -1045,7 +1077,7 @@ exports.classC = classC; ] ], "latestChangedDtsFile": "./src/class.d.ts", - "size": 3093 + "size": 3201 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js index 868e102ca..7389de473 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js @@ -348,7 +348,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -480,7 +480,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -488,7 +493,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -502,7 +510,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -510,7 +523,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -543,7 +559,7 @@ Errors Files ] ] ], - "size": 2906 + "size": 3014 } tsconfig.json:: @@ -843,7 +859,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -985,7 +1001,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -993,7 +1014,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -1007,7 +1031,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -1015,14 +1044,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 3053 + "size": 3161 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js index e36127a4d..3ac81a8f9 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js @@ -290,7 +290,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -423,7 +423,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -431,7 +436,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -445,7 +453,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -453,7 +466,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -482,7 +498,7 @@ Errors Files 5 ] ], - "size": 2807 + "size": 2915 } tsconfig.json:: @@ -753,7 +769,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -876,7 +892,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -884,7 +905,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -898,7 +922,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -906,14 +935,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 2582 + "size": 2690 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js index 62a76b588..43d33d460 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js @@ -542,7 +542,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -684,7 +684,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -692,7 +697,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -706,7 +714,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -714,7 +727,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -722,7 +738,7 @@ exports.classC = classC; ] ], "latestChangedDtsFile": "./src/class.d.ts", - "size": 3093 + "size": 3201 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js index d3688f6b7..4f4866ead 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -518,7 +518,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -660,7 +660,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -668,7 +673,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -682,7 +690,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -690,14 +703,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 3053 + "size": 3161 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js index 66ce7033a..c27e81298 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js @@ -433,7 +433,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -566,7 +566,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -574,7 +579,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -588,7 +596,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -596,14 +609,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 2770 + "size": 2878 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js index 2604cb333..2e1ada17c 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -154,7 +154,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -213,14 +213,20 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -245,7 +251,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1368 + "size": 1420 } tsconfig.json:: @@ -278,7 +284,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -338,14 +344,20 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -370,7 +382,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1390 + "size": 1442 } tsconfig.json:: @@ -441,7 +453,7 @@ exports.b = void 0; exports.b = 10; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -478,11 +490,11 @@ exports.b = 10; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -510,21 +522,27 @@ exports.b = 10; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1753 + "size": 1821 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js index 78b36fcdf..e1d529603 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -141,7 +141,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -195,14 +195,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -219,7 +225,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1341 + "size": 1393 } tsconfig.json:: @@ -252,7 +258,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,49]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,49]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -307,14 +313,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -331,7 +343,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1363 + "size": 1415 } tsconfig.json:: @@ -389,7 +401,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -421,12 +433,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -444,21 +456,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1578 + "size": 1646 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index dbbed5159..e053d214f 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -209,7 +209,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -284,14 +284,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -305,14 +311,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -326,14 +338,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -374,7 +392,7 @@ Errors Files ] ] ], - "size": 2084 + "size": 2240 } tsconfig.json:: @@ -430,7 +448,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -506,14 +524,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -527,14 +551,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -548,14 +578,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -596,7 +632,7 @@ Errors Files ] ] ], - "size": 2106 + "size": 2262 } tsconfig.json:: @@ -722,7 +758,7 @@ const d = class { exports.d = d; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -763,11 +799,11 @@ exports.d = d; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -785,22 +821,22 @@ exports.d = d; { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -817,14 +853,20 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -838,14 +880,20 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -859,21 +907,27 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } ] ] ], - "size": 3087 + "size": 3291 } tsconfig.json:: @@ -900,7 +954,7 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -963,22 +1017,22 @@ Output:: { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -992,14 +1046,20 @@ Output:: "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -1013,14 +1073,20 @@ Output:: "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1034,7 +1100,7 @@ Output:: 2 ] ], - "size": 2663 + "size": 2799 } tsconfig.json:: @@ -1082,7 +1148,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1145,22 +1211,22 @@ Errors Files { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1177,14 +1243,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -1198,14 +1270,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1246,7 +1324,7 @@ Errors Files ] ] ], - "size": 2720 + "size": 2856 } tsconfig.json:: @@ -1292,7 +1370,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1355,22 +1433,22 @@ Errors Files { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1388,14 +1466,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -1409,14 +1493,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1457,7 +1547,7 @@ Errors Files ] ] ], - "size": 2742 + "size": 2878 } tsconfig.json:: @@ -1492,7 +1582,7 @@ Output:: Found 1 error in d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1566,11 +1656,11 @@ Found 1 error in d.ts:1 { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1588,14 +1678,20 @@ Found 1 error in d.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1636,7 +1732,7 @@ Found 1 error in d.ts:1 ] ] ], - "size": 2318 + "size": 2386 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js index 917f58c5d..178551a90 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js @@ -36,7 +36,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -95,14 +95,20 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -127,7 +133,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1368 + "size": 1420 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -442,7 +448,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -479,12 +485,12 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -513,14 +519,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -537,7 +549,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1795 + "size": 1863 } tsconfig.json:: @@ -585,7 +597,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -622,12 +634,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -656,21 +668,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1759 + "size": 1827 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js index 660a979a4..184e94598 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js @@ -34,7 +34,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -88,14 +88,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -112,7 +118,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1341 + "size": 1393 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -383,7 +389,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -415,12 +421,12 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -438,14 +444,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -462,7 +474,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1614 + "size": 1682 } tsconfig.json:: @@ -510,7 +522,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -542,12 +554,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -565,21 +577,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1578 + "size": 1646 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js index 89554d564..363e51a46 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -354,7 +354,7 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -391,12 +391,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -418,7 +418,7 @@ Output:: 2 ] ], - "size": 1393 + "size": 1409 } tsconfig.json:: @@ -447,7 +447,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -484,12 +484,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -504,7 +504,7 @@ const a = class { "options": { "declaration": false }, - "size": 1362 + "size": 1378 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js index 487581331..79155946d 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -310,7 +310,7 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -342,12 +342,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -363,7 +363,7 @@ Output:: 2 ] ], - "size": 1324 + "size": 1340 } tsconfig.json:: @@ -392,7 +392,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -424,12 +424,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -438,7 +438,7 @@ const a = class { "options": { "declaration": false }, - "size": 1293 + "size": 1309 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js index c23186cbd..f9b0c5705 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js @@ -32,7 +32,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2,3]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -91,7 +91,11 @@ Found 1 error in a.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -108,7 +112,7 @@ Found 1 error in a.ts:1 3 ] ], - "size": 1204 + "size": 1231 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -397,7 +401,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -463,7 +467,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -475,7 +483,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1327 + "size": 1354 } tsconfig.json:: @@ -510,7 +518,7 @@ Found 1 error in a.ts:1 const a = "hello"; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -576,12 +584,16 @@ const a = "hello"; "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1296 + "size": 1323 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js index c1fa7999c..18c846b72 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js @@ -30,7 +30,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -84,7 +84,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -96,7 +100,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1184 + "size": 1211 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -353,7 +357,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -408,7 +412,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -420,7 +428,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1258 + "size": 1285 } tsconfig.json:: @@ -453,7 +461,7 @@ Found 1 error in a.ts:1 //// [/home/src/projects/project/a.js] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -508,12 +516,16 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1227 + "size": 1254 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js index 8cd1b339a..7eb185e88 100644 --- a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -67,7 +67,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -146,14 +146,20 @@ declare const console: { log(msg: any): void; }; "end": 54, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 53, "end": 54, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -186,7 +192,7 @@ declare const console: { log(msg: any): void; }; ] ] ], - "size": 1628 + "size": 1680 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js index d8fdb8837..ce4e2c8bc 100644 --- a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js @@ -63,7 +63,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[2,3,4]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -142,7 +142,11 @@ declare const console: { log(msg: any): void; }; "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -164,7 +168,7 @@ declare const console: { log(msg: any): void; }; 4 ] ], - "size": 1445 + "size": 1472 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js index ffd63e121..bb065a46c 100644 --- a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js @@ -63,7 +63,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[2,3,4]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -142,7 +142,11 @@ declare const console: { log(msg: any): void; }; "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -164,7 +168,7 @@ declare const console: { log(msg: any): void; }; 4 ] ], - "size": 1446 + "size": 1473 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-23-projects-in-a-solution.js b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-23-projects-in-a-solution.js index 623ffc3bf..f5811f29a 100644 --- a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-23-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-23-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-3-projects-in-a-solution.js b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-3-projects-in-a-solution.js index 19eaec418..7750dc361 100644 --- a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-3-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-3-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-5-projects-in-a-solution.js b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-5-projects-in-a-solution.js index 7e4457567..50cbed8e6 100644 --- a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-5-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-5-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-8-projects-in-a-solution.js b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-8-projects-in-a-solution.js index baaf20c98..34b8d6cd5 100644 --- a/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-8-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuild/projectsBuilding/when-there-are-8-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js index ebb3b8f37..2de0d0724 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "files": [ "src/index.ts", "src/hello.json", ], - } + }, + "files": [ "src/index.ts", "src/hello.json", ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js index 6aeb39923..4d2ffe41e 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "files": [ "src/index.ts", "src/hello.json", ], - } + }, + "files": [ "src/index.ts", "src/hello.json", ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js index a066b6fa3..a5c35c529 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "files": [ "src/hello.json" ], "include": [ "src/**/*" ], - } + }, + "files": [ "src/hello.json" ], "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js index 75c1106d5..81fcda1a8 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "files": [ "src/hello.json" ], "include": [ "src/**/*" ], - } + }, + "files": [ "src/hello.json" ], "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js index b91f4bdf7..d7297ab4d 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./index.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*", "src/**/*.json" ], - } + }, + "include": [ "src/**/*", "src/**/*.json" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js index e809cb4e1..e880633a3 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -9,20 +9,20 @@ Input:: import hello from "./index.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*", "src/**/*.json" ], - } + }, + "include": [ "src/**/*", "src/**/*.json" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js index 1cec78094..08c030581 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*", "src/**/*.json" ], - } + }, + "include": [ "src/**/*", "src/**/*.json" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js index dc8239edd..9a8ea2bfa 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*", "src/**/*.json" ], - } + }, + "include": [ "src/**/*", "src/**/*.json" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js index 5bd9751d2..5e9ff9363 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js index a872caddc..bc173d2e2 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "../../hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js index 8a4dc3f77..2f77989c1 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js @@ -9,20 +9,20 @@ Input:: import hello from "../../hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js index 545fcf8cb..eeb98c56f 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, - "skipDefaultLibCheck": true, + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js index 29840e783..8b71bbde2 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, - "skipDefaultLibCheck": true, + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js index 75134d2b9..64344f15a 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, - }, - "include": [ "src/**/*" ], - } + }, + "include": [ "src/**/*" ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: DiagnosticsPresent_OutputsGenerated diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js index a6a4b93f4..2a94e0f67 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": false, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, - "skipDefaultLibCheck": true, + "skipDefaultLibCheck": true, - }, - "files": [ "src/index.ts", "src/hello.json", ], - } + }, + "files": [ "src/index.ts", "src/hello.json", ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js index 01b7cb87c..91bb4a9ae 100644 --- a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js @@ -9,20 +9,20 @@ Input:: import hello from "./hello.json" export default hello.hello //// [/home/src/workspaces/solution/project/tsconfig.json] *new* - { - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, - "skipDefaultLibCheck": true, + "skipDefaultLibCheck": true, - }, - "files": [ "src/index.ts", "src/hello.json", ], - } + }, + "files": [ "src/index.ts", "src/hello.json", ], +} tsgo --b project --v --explainFiles --listEmittedFiles ExitStatus:: Success diff --git a/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js b/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js index 0e42fc149..1cc04c948 100644 --- a/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js +++ b/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js @@ -273,7 +273,7 @@ exports.m = mod; //// [/user/username/projects/sample1/logic/index.js.map] *new* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;AAAA,CACtB;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"4da0a6ee7d4a662685afc8fe143c994d-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.muitply();\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":85,"end":92,"code":2339,"category":1,"message":"Property 'muitply' does not exist on type 'typeof import(\"/user/username/projects/sample1/core/index\")'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"4da0a6ee7d4a662685afc8fe143c994d-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.muitply();\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":85,"end":92,"code":2339,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_2339","messageArgs":["muitply","typeof import(\"/user/username/projects/sample1/core/index\")"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -355,13 +355,17 @@ exports.m = mod; "end": 92, "code": 2339, "category": 1, - "message": "Property 'muitply' does not exist on type 'typeof import(\"/user/username/projects/sample1/core/index\")'." + "messageKey": "Property_0_does_not_exist_on_type_1_2339", + "messageArgs": [ + "muitply", + "typeof import(\"/user/username/projects/sample1/core/index\")" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2070 + "size": 2097 } //// [/user/username/projects/sample1/tests/index.d.ts] *new* import * as mod from '../core/anotherModule'; diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js index 69a3eed6d..e706bf4b3 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -246,7 +246,7 @@ exports.m = mod; //// [/user/username/projects/sample1/logic/index.js.map] *new* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["../core/anotherModule"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -319,13 +319,16 @@ exports.m = mod; "end": 149, "code": 2307, "category": 1, - "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "../core/anotherModule" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1818 + "size": 1843 } //// [/user/username/projects/sample1/tests/index.d.ts] *new* export declare const m: any; @@ -375,7 +378,7 @@ const mod = __importStar(require("../core/anotherModule")); exports.m = mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["../core/anotherModule"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -456,13 +459,16 @@ exports.m = mod; "end": 167, "code": 2307, "category": 1, - "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "../core/anotherModule" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1913 + "size": 1938 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js index d546837a2..6ebfb68cc 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -246,7 +246,7 @@ exports.m = mod; //// [/user/username/projects/sample1/logic/index.js.map] *new* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["../core/anotherModule"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -319,13 +319,16 @@ exports.m = mod; "end": 149, "code": 2307, "category": 1, - "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "../core/anotherModule" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1818 + "size": 1843 } //// [/user/username/projects/sample1/tests/index.d.ts] *new* export declare const m: any; @@ -375,7 +378,7 @@ const mod = __importStar(require("../core/anotherModule")); exports.m = mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["../core/anotherModule"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -456,13 +459,16 @@ exports.m = mod; "end": 167, "code": 2307, "category": 1, - "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "../core/anotherModule" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1913 + "size": 1938 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 2a9339f27..d116b0e0b 100644 --- a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -144,7 +144,7 @@ function multiply(a, b) { return a * b; } multiply(); //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["2","0"],"relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"messageKey":"An_argument_for_0_was_not_provided_6210","messageArgs":["a"]}]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -230,14 +230,21 @@ multiply(); "end": 185, "code": 2554, "category": 1, - "message": "Expected 2 arguments, but got 0.", + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "2", + "0" + ], "relatedInformation": [ { "pos": 138, "end": 147, "code": 6210, "category": 3, - "message": "An argument for 'a' was not provided." + "messageKey": "An_argument_for_0_was_not_provided_6210", + "messageArgs": [ + "a" + ] } ] } @@ -245,7 +252,7 @@ multiply(); ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2078 + "size": 2133 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 065dec9b3..017400f33 100644 --- a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -145,7 +145,7 @@ function multiply(a, b) { return a * b; } multiply(); //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["2","0"],"relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"messageKey":"An_argument_for_0_was_not_provided_6210","messageArgs":["a"]}]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -231,14 +231,21 @@ multiply(); "end": 185, "code": 2554, "category": 1, - "message": "Expected 2 arguments, but got 0.", + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "2", + "0" + ], "relatedInformation": [ { "pos": 138, "end": 147, "code": 6210, "category": 3, - "message": "An argument for 'a' was not provided." + "messageKey": "An_argument_for_0_was_not_provided_6210", + "messageArgs": [ + "a" + ] } ] } @@ -246,7 +253,7 @@ multiply(); ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2078 + "size": 2133 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index 7045a5c3e..f89cd02b3 100644 --- a/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -185,7 +185,7 @@ a_1.X; "size": 1083 } //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.esnext.full.d.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d0c1e70086e2297c6733a209dc8aebd5-import {A} from 'a';\nexport const b = new A();","signature":"5c4caa93805477a2ce78ec8e61b569d7-export declare const b: any;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":199},"semanticDiagnosticsPerFile":[[2,[{"pos":16,"end":19,"code":2307,"category":1,"message":"Cannot find module 'a' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.esnext.full.d.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d0c1e70086e2297c6733a209dc8aebd5-import {A} from 'a';\nexport const b = new A();","signature":"5c4caa93805477a2ce78ec8e61b569d7-export declare const b: any;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":199},"semanticDiagnosticsPerFile":[[2,[{"pos":16,"end":19,"code":2307,"category":1,"messageKey":"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","messageArgs":["a"]}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -239,13 +239,16 @@ a_1.X; "end": 19, "code": 2307, "category": 1, - "message": "Cannot find module 'a' or its corresponding type declarations." + "messageKey": "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", + "messageArgs": [ + "a" + ] } ] ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1296 + "size": 1321 } //// [/user/username/projects/transitiveReferences/tsconfig.c.tsbuildinfo] *new* {"version":"FakeTSVersion","root":["./c.ts"]} diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js index 3fdefa6ac..6675258b4 100644 --- a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js @@ -397,7 +397,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () "size": 2794 } //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":12,"end":13,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":12,"end":13,"code":6133,"category":1,"messageKey":"_0_is_declared_but_its_value_is_never_read_6133","messageArgs":["A"],"reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -523,14 +523,17 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () "end": 13, "code": 6133, "category": 1, - "message": "'A' is declared but its value is never read.", + "messageKey": "_0_is_declared_but_its_value_is_never_read_6133", + "messageArgs": [ + "A" + ], "reportsUnnecessary": true } ] ] ], "latestChangedDtsFile": "./utilities.d.ts", - "size": 3302 + "size": 3328 } //// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* export declare function makeRandomName(): string; @@ -764,7 +767,7 @@ Output:: //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *mTime changed* //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c3e46c15bb789df9e21a5ca1964be7a1-\nimport * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c3e46c15bb789df9e21a5ca1964be7a1-\nimport * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":6133,"category":1,"messageKey":"_0_is_declared_but_its_value_is_never_read_6133","messageArgs":["A"],"reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -890,14 +893,17 @@ Output:: "end": 14, "code": 6133, "category": 1, - "message": "'A' is declared but its value is never read.", + "messageKey": "_0_is_declared_but_its_value_is_never_read_6133", + "messageArgs": [ + "A" + ], "reportsUnnecessary": true } ] ] ], "latestChangedDtsFile": "./utilities.d.ts", - "size": 3304 + "size": 3330 } //// [/user/username/projects/demo/lib/core/utilities.js] *rewrite with same content* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js index 2f795e410..6876112d8 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -37,7 +37,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -96,14 +96,20 @@ Output:: "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -128,7 +134,7 @@ Output:: ] ] ], - "size": 1368 + "size": 1420 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -431,7 +437,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -468,12 +474,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -502,14 +508,20 @@ Output:: "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -526,7 +538,7 @@ Output:: ] ] ], - "size": 1795 + "size": 1863 } tsconfig.json:: @@ -581,7 +593,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -618,12 +630,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -652,21 +664,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1759 + "size": 1827 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js index 516fd9568..a27cc11a2 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -35,7 +35,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -89,14 +89,20 @@ Output:: "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -113,7 +119,7 @@ Output:: ] ] ], - "size": 1341 + "size": 1393 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -372,7 +378,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -404,12 +410,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -427,14 +433,20 @@ Output:: "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -451,7 +463,7 @@ Output:: ] ] ], - "size": 1614 + "size": 1682 } tsconfig.json:: @@ -506,7 +518,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -538,12 +550,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -561,21 +573,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1578 + "size": 1646 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js index 89195e93a..7dba74d3b 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -366,7 +366,7 @@ Output:: [HH:MM:SS AM] Found 0 errors. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -403,12 +403,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -430,7 +430,7 @@ Output:: 2 ] ], - "size": 1393 + "size": 1409 } tsconfig.json:: @@ -469,7 +469,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -506,12 +506,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -526,7 +526,7 @@ const a = class { "options": { "declaration": false }, - "size": 1362 + "size": 1378 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js index 48624d3c0..328ce0ffa 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -322,7 +322,7 @@ Output:: [HH:MM:SS AM] Found 0 errors. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -354,12 +354,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -375,7 +375,7 @@ Output:: 2 ] ], - "size": 1324 + "size": 1340 } tsconfig.json:: @@ -414,7 +414,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -446,12 +446,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -460,7 +460,7 @@ const a = class { "options": { "declaration": false }, - "size": 1293 + "size": 1309 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js index 24ed89396..fd99d49c7 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js @@ -33,7 +33,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2,3]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -92,7 +92,11 @@ Output:: "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -109,7 +113,7 @@ Output:: 3 ] ], - "size": 1204 + "size": 1231 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -390,7 +394,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -456,7 +460,11 @@ Output:: "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -468,7 +476,7 @@ Output:: 2 ] ], - "size": 1327 + "size": 1354 } tsconfig.json:: @@ -510,7 +518,7 @@ Output:: const a = "hello"; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -576,12 +584,16 @@ const a = "hello"; "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1296 + "size": 1323 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js index 1fbba049e..acbe0c4e4 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js @@ -31,7 +31,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -85,7 +85,11 @@ Output:: "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -97,7 +101,7 @@ Output:: 2 ] ], - "size": 1184 + "size": 1211 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -346,7 +350,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -401,7 +405,11 @@ Output:: "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -413,7 +421,7 @@ Output:: 2 ] ], - "size": 1258 + "size": 1285 } tsconfig.json:: @@ -453,7 +461,7 @@ Output:: //// [/home/src/projects/project/a.js] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -508,12 +516,16 @@ Output:: "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1227 + "size": 1254 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js index 11b28b91d..c5281c07c 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -395,7 +395,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[3]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[3]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -489,7 +489,11 @@ Output:: "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -501,7 +505,7 @@ Output:: 3 ] ], - "size": 1755 + "size": 1782 } tsconfig.json:: @@ -706,7 +710,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[3,17]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[3,17]]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -756,11 +760,11 @@ Output:: { "fileName": "../src/main.ts", "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", - "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "signature": "562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", - "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "signature": "562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -800,14 +804,20 @@ Output:: "end": 54, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 53, "end": 54, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -824,7 +834,7 @@ Output:: ] ] ], - "size": 2150 + "size": 2218 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js index 2e165e22e..a038e5310 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js @@ -372,7 +372,7 @@ Output:: [HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[3]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[3]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -456,7 +456,11 @@ Output:: "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -468,7 +472,7 @@ Output:: 3 ] ], - "size": 1536 + "size": 1563 } tsconfig.json:: @@ -662,7 +666,7 @@ const a = class { exports.a = a; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -707,11 +711,11 @@ exports.a = a; { "fileName": "../src/main.ts", "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", - "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "signature": "562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", - "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "signature": "562dfe29cab6c7ded7ded341fc9c8131-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(53,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -737,7 +741,7 @@ exports.a = a; "../shared/types/db.ts" ] }, - "size": 1605 + "size": 1621 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js index 100bdbf0c..66b738a19 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js @@ -2,10 +2,10 @@ currentDirectory::/user/username/projects/solution useCaseSensitiveFileNames::true Input:: //// [/user/username/projects/solution/app/fileWithError.ts] *new* - export var myClassWithError = class { - tags() { } +export var myClassWithError = class { + tags() { } - }; +}; //// [/user/username/projects/solution/app/fileWithoutError.ts] *new* export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] *new* @@ -74,7 +74,7 @@ class myClass { exports.myClass = myClass; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -110,11 +110,11 @@ exports.myClass = myClass; }, { "fileName": "./fileWithError.ts", - "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "version": "037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};", "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", "impliedNodeFormat": "CommonJS", "original": { - "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "version": "037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};", "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", "impliedNodeFormat": 1 } @@ -135,7 +135,7 @@ exports.myClass = myClass; "composite": true }, "latestChangedDtsFile": "./fileWithoutError.d.ts", - "size": 1460 + "size": 1418 } app/tsconfig.json:: @@ -189,7 +189,7 @@ var myClassWithError = class { exports.myClassWithError = myClassWithError; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -226,11 +226,11 @@ exports.myClassWithError = myClassWithError; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -258,14 +258,20 @@ exports.myClassWithError = myClassWithError; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -283,7 +289,7 @@ exports.myClassWithError = myClassWithError; ] } ], - "size": 2104 + "size": 2172 } app/tsconfig.json:: @@ -325,7 +331,7 @@ class myClass2 { exports.myClass2 = myClass2; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -362,11 +368,11 @@ exports.myClass2 = myClass2; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -394,14 +400,20 @@ exports.myClass2 = myClass2; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -419,7 +431,7 @@ exports.myClass2 = myClass2; ] } ], - "size": 2109 + "size": 2177 } app/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js index a1c5d40a3..2225d72b3 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js @@ -2,10 +2,10 @@ currentDirectory::/user/username/projects/solution useCaseSensitiveFileNames::true Input:: //// [/user/username/projects/solution/app/fileWithError.ts] *new* - export var myClassWithError = class { - tags() { } +export var myClassWithError = class { + tags() { } - }; +}; //// [/user/username/projects/solution/app/fileWithoutError.ts] *new* export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] *new* @@ -74,7 +74,7 @@ class myClass { exports.myClass = myClass; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -110,11 +110,11 @@ exports.myClass = myClass; }, { "fileName": "./fileWithError.ts", - "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "version": "037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};", "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", "impliedNodeFormat": "CommonJS", "original": { - "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "version": "037c56906f2b733e17b4a0bfeb8ada65-export var myClassWithError = class {\n tags() { }\n\n};", "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", "impliedNodeFormat": 1 } @@ -135,7 +135,7 @@ exports.myClass = myClass; "composite": true }, "latestChangedDtsFile": "./fileWithoutError.d.ts", - "size": 1460 + "size": 1418 } app/tsconfig.json:: @@ -189,7 +189,7 @@ var myClassWithError = class { exports.myClassWithError = myClassWithError; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -226,11 +226,11 @@ exports.myClassWithError = myClassWithError; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -258,14 +258,20 @@ exports.myClassWithError = myClassWithError; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -283,7 +289,7 @@ exports.myClassWithError = myClassWithError; ] } ], - "size": 2104 + "size": 2172 } app/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js index 238dfdebf..6b2d679cf 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js @@ -85,7 +85,7 @@ class myClass { exports.myClass = myClass; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -122,11 +122,11 @@ exports.myClass = myClass; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -154,14 +154,20 @@ exports.myClass = myClass; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -179,7 +185,7 @@ exports.myClass = myClass; ] } ], - "size": 2107 + "size": 2175 } app/tsconfig.json:: @@ -224,7 +230,7 @@ class myClass2 { exports.myClass2 = myClass2; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -261,11 +267,11 @@ exports.myClass2 = myClass2; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -293,14 +299,20 @@ exports.myClass2 = myClass2; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -318,7 +330,7 @@ exports.myClass2 = myClass2; ] } ], - "size": 2109 + "size": 2177 } app/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js index 14e00b8d9..c62dcd47a 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js @@ -85,7 +85,7 @@ class myClass { exports.myClass = myClass; //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["myClassWithError"]}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -122,11 +122,11 @@ exports.myClass = myClass; { "fileName": "./fileWithError.ts", "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": "CommonJS", "original": { "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", - "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "signature": "0db97697d9203901ca9117430d4f5be9-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(11,16): error9027: Add_a_type_annotation_to_the_variable_0_9027\nmyClassWithError\n", "impliedNodeFormat": 1 } }, @@ -154,14 +154,20 @@ exports.myClass = myClass; "end": 27, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 11, "end": 27, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable myClassWithError." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "myClassWithError" + ] } ] } @@ -179,7 +185,7 @@ exports.myClass = myClass; ] } ], - "size": 2107 + "size": 2175 } app/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-23-projects-in-a-solution.js b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-23-projects-in-a-solution.js index 439e6d0f1..f15526f64 100644 --- a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-23-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-23-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-3-projects-in-a-solution.js b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-3-projects-in-a-solution.js index e5ed697ea..1f77cdb78 100644 --- a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-3-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-3-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-5-projects-in-a-solution.js b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-5-projects-in-a-solution.js index edb535d02..ac2086123 100644 --- a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-5-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-5-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-8-projects-in-a-solution.js b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-8-projects-in-a-solution.js index 53b176f58..75a250ca9 100644 --- a/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-8-projects-in-a-solution.js +++ b/testdata/baselines/reference/tsbuildWatch/projectsBuilding/when-there-are-8-projects-in-a-solution.js @@ -4,10 +4,10 @@ Input:: //// [/user/username/projects/myproject/pkg0/index.ts] *new* export const pkg0 = 0; //// [/user/username/projects/myproject/pkg0/tsconfig.json] *new* - { - "compilerOptions": { "composite": true }, +{ + "compilerOptions": { "composite": true }, - } +} //// [/user/username/projects/myproject/pkg1/index.ts] *new* export const pkg1 = 1; //// [/user/username/projects/myproject/pkg1/tsconfig.json] *new* diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js index 52aaf107d..fe4f5e884 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js @@ -568,7 +568,7 @@ let y = 10; //// [/user/username/projects/sample1/logic/index.js.map] *modified* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -650,13 +650,17 @@ let y = 10; "end": 178, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2046 + "size": 2073 } //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* @@ -703,7 +707,7 @@ function multiply(a, b) { return a * b; } let x = 10; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -789,13 +793,17 @@ let x = 10; "end": 183, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1985 + "size": 2012 } //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js index 34661be26..17d1ed8ab 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js @@ -568,7 +568,7 @@ let y = 10; //// [/user/username/projects/sample1/logic/index.js.map] *modified* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -650,13 +650,17 @@ let y = 10; "end": 178, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2046 + "size": 2073 } //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* @@ -703,7 +707,7 @@ function multiply(a, b) { return a * b; } let x = 10; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -789,13 +793,17 @@ let x = 10; "end": 183, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1985 + "size": 2012 } //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js index f39b61638..620473bcd 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js @@ -568,7 +568,7 @@ let y = 10; //// [/user/username/projects/sample1/logic/index.js.map] *modified* {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,0CAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,kDAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"3abed61bf6897ffa70a069303f7ee37f-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;\nlet y: string = 10;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -650,13 +650,17 @@ let y = 10; "end": 178, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2046 + "size": 2073 } logic/tsconfig.json:: @@ -702,7 +706,7 @@ function multiply(a, b) { return a * b; } let x = 10; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"bd46ecaf1bd821bbf62f3d94c22c2a57-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nlet x: string = 10;","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":182,"end":183,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -788,13 +792,17 @@ let x = 10; "end": 183, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 1985 + "size": 2012 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 30362fa24..6c188b0ec 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -145,7 +145,7 @@ function multiply(a, b) { return a * b; } multiply(); //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["2","0"],"relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"messageKey":"An_argument_for_0_was_not_provided_6210","messageArgs":["a"]}]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -231,14 +231,21 @@ multiply(); "end": 185, "code": 2554, "category": 1, - "message": "Expected 2 arguments, but got 0.", + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "2", + "0" + ], "relatedInformation": [ { "pos": 138, "end": 147, "code": 6210, "category": 3, - "message": "An argument for 'a' was not provided." + "messageKey": "An_argument_for_0_was_not_provided_6210", + "messageArgs": [ + "a" + ] } ] } @@ -246,7 +253,7 @@ multiply(); ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2078 + "size": 2133 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 508c861c2..0440b3449 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -146,7 +146,7 @@ function multiply(a, b) { return a * b; } multiply(); //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"messageKey":"Expected_0_arguments_but_got_1_2554","messageArgs":["2","0"],"relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"messageKey":"An_argument_for_0_was_not_provided_6210","messageArgs":["a"]}]}]]],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -232,14 +232,21 @@ multiply(); "end": 185, "code": 2554, "category": 1, - "message": "Expected 2 arguments, but got 0.", + "messageKey": "Expected_0_arguments_but_got_1_2554", + "messageArgs": [ + "2", + "0" + ], "relatedInformation": [ { "pos": 138, "end": 147, "code": 6210, "category": 3, - "message": "An argument for 'a' was not provided." + "messageKey": "An_argument_for_0_was_not_provided_6210", + "messageArgs": [ + "a" + ] } ] } @@ -247,7 +254,7 @@ multiply(); ] ], "latestChangedDtsFile": "./index.d.ts", - "size": 2078 + "size": 2133 } core/tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/commandLine/bad-locale.js b/testdata/baselines/reference/tsc/commandLine/bad-locale.js new file mode 100644 index 000000000..5d1ad434c --- /dev/null +++ b/testdata/baselines/reference/tsc/commandLine/bad-locale.js @@ -0,0 +1,9 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --locale whoops --version +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. + diff --git a/testdata/baselines/reference/tsc/commandLine/locale.js b/testdata/baselines/reference/tsc/commandLine/locale.js new file mode 100644 index 000000000..e8e5716a8 --- /dev/null +++ b/testdata/baselines/reference/tsc/commandLine/locale.js @@ -0,0 +1,9 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --locale cs --version +ExitStatus:: Success +Output:: +Verze FakeTSVersion + diff --git a/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js index 3dfafa66b..f248cf28e 100644 --- a/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js +++ b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js @@ -45,7 +45,7 @@ const jsx_runtime_1 = require("solid-js/jsx-runtime"); exports.default = jsx_runtime_1.jsx("div", {}); //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.es2022.full.d.ts","./node_modules/solid-js/jsx-runtime.d.ts","./src/main.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}","impliedNodeFormat":99},{"version":"5af15af7f9b4d97300f8dcfb2bf5b7c4-export default
;","signature":"ca37c00363f904fe93e299b145186400-declare const _default: any;\nexport default _default;\n","impliedNodeFormat":1}],"options":{"composite":true,"jsx":4,"jsxImportSource":"solid-js","module":100},"semanticDiagnosticsPerFile":[[3,[{"pos":15,"end":21,"code":1479,"category":1,"message":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"solid-js/jsx-runtime\")' call instead.","messageChain":[{"pos":15,"end":21,"code":1483,"category":3,"message":"To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`."}]}]]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.es2022.full.d.ts","./node_modules/solid-js/jsx-runtime.d.ts","./src/main.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}","impliedNodeFormat":99},{"version":"5af15af7f9b4d97300f8dcfb2bf5b7c4-export default
;","signature":"ca37c00363f904fe93e299b145186400-declare const _default: any;\nexport default _default;\n","impliedNodeFormat":1}],"options":{"composite":true,"jsx":4,"jsxImportSource":"solid-js","module":100},"semanticDiagnosticsPerFile":[[3,[{"pos":15,"end":21,"code":1479,"category":1,"messageKey":"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479","messageArgs":["solid-js/jsx-runtime"],"messageChain":[{"pos":15,"end":21,"code":1483,"category":3,"messageKey":"To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483"}]}]]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -112,14 +112,17 @@ exports.default = jsx_runtime_1.jsx("div", {}); "end": 21, "code": 1479, "category": 1, - "message": "The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"solid-js/jsx-runtime\")' call instead.", + "messageKey": "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", + "messageArgs": [ + "solid-js/jsx-runtime" + ], "messageChain": [ { "pos": 15, "end": 21, "code": 1483, "category": 3, - "message": "To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`." + "messageKey": "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" } ] } @@ -127,7 +130,7 @@ exports.default = jsx_runtime_1.jsx("div", {}); ] ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1905 + "size": 1800 } //// [/home/src/tslibs/TS/Lib/lib.es2022.full.d.ts] *Lib* /// diff --git a/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js index 4cd9f7b92..3f898c49e 100644 --- a/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js @@ -88,7 +88,7 @@ import ky from 'ky'; export const api = ky.extend({}); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"message":"Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named."}]]],"latestChangedDtsFile":"./index.d.ts","emitSignatures":[[3,"5229c9e2248679a39697053812e5f6bb-export declare const api: {\n extend(options: Record): KyInstance;\n};\n"]]} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"messageKey":"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","messageArgs":["api","KyInstance","\"/home/src/workspaces/project/node_modules/ky/distribution/index\""]}]]],"latestChangedDtsFile":"./index.d.ts","emitSignatures":[[3,"5229c9e2248679a39697053812e5f6bb-export declare const api: {\n extend(options: Record): KyInstance;\n};\n"]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -131,11 +131,11 @@ export const api = ky.extend({}); { "fileName": "./index.ts", "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", - "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "signature": "80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n", "impliedNodeFormat": "ESNext", "original": { "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", - "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "signature": "80d0207a54fef9a805b5e009ed639094-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\napi\nKyInstance\n\"/home/src/workspaces/project/node_modules/ky/distribution/index\"\n", "impliedNodeFormat": 99 } } @@ -166,7 +166,12 @@ export const api = ky.extend({}); "end": 37, "code": 4023, "category": 1, - "message": "Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named." + "messageKey": "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", + "messageArgs": [ + "api", + "KyInstance", + "\"/home/src/workspaces/project/node_modules/ky/distribution/index\"" + ] } ] ] @@ -182,7 +187,7 @@ export const api = ky.extend({}); ] } ], - "size": 2171 + "size": 2213 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js b/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js index 6b382550c..852c8a05f 100644 --- a/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js +++ b/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js @@ -8,31 +8,31 @@ Input:: "main": "index.js" } //// [D:/Work/pkg1/src/main.ts] *new* - import { PartialType } from './utils'; +import { PartialType } from './utils'; - class Common {} +class Common {} - export class Sub extends PartialType(Common) { - id: string; - } +export class Sub extends PartialType(Common) { + id: string; +} //// [D:/Work/pkg1/src/utils/index.ts] *new* - import { MyType, MyReturnType } from './type-helpers'; +import { MyType, MyReturnType } from './type-helpers'; - export function PartialType(classRef: MyType) { - abstract class PartialClassType { - constructor() {} - } +export function PartialType(classRef: MyType) { + abstract class PartialClassType { + constructor() {} + } - return PartialClassType as MyReturnType; - } + return PartialClassType as MyReturnType; +} //// [D:/Work/pkg1/src/utils/type-helpers.ts] *new* - export type MyReturnType = { - new (...args: any[]): any; - }; +export type MyReturnType = { + new (...args: any[]): any; +}; - export interface MyType extends Function { - new (...args: any[]): T; - } +export interface MyType extends Function { + new (...args: any[]): T; +} //// [D:/Work/pkg1/tsconfig.json] *new* { "compilerOptions": { @@ -46,11 +46,11 @@ Input:: tsgo -p D:\Work\pkg1 --explainFiles ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -src/utils/index.ts:8:27 - error TS2352: Conversion of type 'typeof PartialClassType' to type 'MyReturnType' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +src/utils/index.ts:8:12 - error TS2352: Conversion of type 'typeof PartialClassType' to type 'MyReturnType' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Cannot assign an abstract constructor type to a non-abstract constructor type. -8 return PartialClassType as MyReturnType; -   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +8 return PartialClassType as MyReturnType; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../home/src/tslibs/TS/Lib/lib.es2017.full.d.ts Default library for target 'ES2017' diff --git a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js index 6733ef2ba..9d04eb07a 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js @@ -214,7 +214,7 @@ Errors Files //// [/home/src/workspaces/project/main.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":116,"end":123,"code":4094,"category":1,"message":"Property 'message' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":116,"end":123,"code":9027,"category":1,"message":"Add a type annotation to the variable wrapper."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"messageKey":"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","messageArgs":["message","MessageableClass"]}]]],"emitDiagnosticsPerFile":[[2,[{"pos":116,"end":123,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["message"],"relatedInformation":[{"pos":116,"end":123,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["wrapper"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -251,11 +251,11 @@ Errors Files { "fileName": "./MessageablePerson.ts", "version": "fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;", - "signature": "eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.", + "signature": "9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n", "impliedNodeFormat": "CommonJS", "original": { "version": "fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;", - "signature": "eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.", + "signature": "9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n", "impliedNodeFormat": 1 } }, @@ -294,7 +294,11 @@ Errors Files "end": 138, "code": 2445, "category": 1, - "message": "Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses." + "messageKey": "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", + "messageArgs": [ + "message", + "MessageableClass" + ] } ] ] @@ -308,21 +312,27 @@ Errors Files "end": 123, "code": 4094, "category": 1, - "message": "Property 'message' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "message" + ], "relatedInformation": [ { "pos": 116, "end": 123, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable wrapper." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "wrapper" + ] } ] } ] ] ], - "size": 2717 + "size": 2812 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js index 5fb23344b..e87dc97ab 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js @@ -173,7 +173,7 @@ Found 1 error in main.ts:3 //// [/home/src/workspaces/project/MessageablePerson.js] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"messageKey":"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","messageArgs":["message","MessageableClass"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -210,11 +210,11 @@ Found 1 error in main.ts:3 { "fileName": "./MessageablePerson.ts", "version": "fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;", - "signature": "eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.", + "signature": "9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n", "impliedNodeFormat": "CommonJS", "original": { "version": "fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;", - "signature": "eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.", + "signature": "9bca542f83dba4822510bd12bc5e9db9-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\nmessage\n\n(116,7): error9027: Add_a_type_annotation_to_the_variable_0_9027\nwrapper\n", "impliedNodeFormat": 1 } }, @@ -252,12 +252,16 @@ Found 1 error in main.ts:3 "end": 138, "code": 2445, "category": 1, - "message": "Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses." + "messageKey": "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", + "messageArgs": [ + "message", + "MessageableClass" + ] } ] ] ], - "size": 2392 + "size": 2435 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js index ee5f85490..2935b804d 100644 --- a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js +++ b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js @@ -70,7 +70,7 @@ const App = () => jsx_runtime_1.jsx("div", { propA: true }); exports.App = App; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":49,"code":7016,"category":1,"message":"Could not find a declaration file for module 'react/jsx-runtime'. '/home/src/workspaces/project/node_modules/react/jsx-runtime.js' implicitly has an 'any' type."}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":49,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["react/jsx-runtime","/home/src/workspaces/project/node_modules/react/jsx-runtime.js"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -134,12 +134,16 @@ exports.App = App; "end": 49, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'react/jsx-runtime'. '/home/src/workspaces/project/node_modules/react/jsx-runtime.js' implicitly has an 'any' type." + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "react/jsx-runtime", + "/home/src/workspaces/project/node_modules/react/jsx-runtime.js" + ] } ] ] ], - "size": 1623 + "size": 1647 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js b/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js index 78c6bf193..775a84f61 100644 --- a/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js +++ b/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js @@ -74,7 +74,7 @@ declare const console: { log(msg: any): void; }; React.createElement("div", null))); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8ca521424834f2ae3377cc3ccc9dd3ef-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(\n
\n
\n)","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":3,"module":99,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":265,"end":274,"code":2769,"category":1,"message":"No overload matches this call.","messageChain":[{"pos":265,"end":274,"code":2770,"category":1,"message":"The last overload gave the following error.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type '{ children: any[]; }' is not assignable to type '{ children?: number | undefined; }'.","messageChain":[{"pos":265,"end":274,"code":2326,"category":1,"message":"Types of property 'children' are incompatible.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type 'any[]' is not assignable to type 'number'."}]}]}]}],"relatedInformation":[{"pos":217,"end":226,"code":2771,"category":1,"message":"The last overload is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8ca521424834f2ae3377cc3ccc9dd3ef-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(\n
\n
\n)","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":3,"module":99,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":265,"end":274,"code":2769,"category":1,"messageKey":"No_overload_matches_this_call_2769","messageChain":[{"pos":265,"end":274,"code":2770,"category":1,"messageKey":"The_last_overload_gave_the_following_error_2770","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["{ children: any[]; }","{ children?: number | undefined; }"],"messageChain":[{"pos":265,"end":274,"code":2326,"category":1,"messageKey":"Types_of_property_0_are_incompatible_2326","messageArgs":["children"],"messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["any[]","number"]}]}]}]}],"relatedInformation":[{"pos":217,"end":226,"code":2771,"category":1,"messageKey":"The_last_overload_is_declared_here_2771"}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -130,35 +130,46 @@ declare const console: { log(msg: any): void; }; "end": 274, "code": 2769, "category": 1, - "message": "No overload matches this call.", + "messageKey": "No_overload_matches_this_call_2769", "messageChain": [ { "pos": 265, "end": 274, "code": 2770, "category": 1, - "message": "The last overload gave the following error.", + "messageKey": "The_last_overload_gave_the_following_error_2770", "messageChain": [ { "pos": 265, "end": 274, "code": 2322, "category": 1, - "message": "Type '{ children: any[]; }' is not assignable to type '{ children?: number | undefined; }'.", + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "{ children: any[]; }", + "{ children?: number | undefined; }" + ], "messageChain": [ { "pos": 265, "end": 274, "code": 2326, "category": 1, - "message": "Types of property 'children' are incompatible.", + "messageKey": "Types_of_property_0_are_incompatible_2326", + "messageArgs": [ + "children" + ], "messageChain": [ { "pos": 265, "end": 274, "code": 2322, "category": 1, - "message": "Type 'any[]' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "any[]", + "number" + ] } ] } @@ -173,14 +184,14 @@ declare const console: { log(msg: any): void; }; "end": 226, "code": 2771, "category": 1, - "message": "The last overload is declared here." + "messageKey": "The_last_overload_is_declared_here_2771" } ] } ] ] ], - "size": 2109 + "size": 2209 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js b/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js index 7ac02e2f4..035e5f1d6 100644 --- a/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -9,17 +9,17 @@ import { bar2 } from "bar2"; //// [/home/src/projects/project/node_modules/@types/bar/index.d.ts] *new* export declare const bar: number; //// [/home/src/projects/project/node_modules/@types/bar/package.json] *new* - { - "name": "@types/bar", - "version": "1.0.0", - "types": "index.d.ts", - "exports": { - ".": { - - "require": "./index.d.ts" - } - } - } +{ + "name": "@types/bar", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + + "require": "./index.d.ts" + } + } +} //// [/home/src/projects/project/node_modules/@types/bar2/index.d.ts] *new* export declare const bar2: number; //// [/home/src/projects/project/node_modules/@types/bar2/package.json] *new* @@ -39,37 +39,37 @@ module.exports = { bar: 1 }; //// [/home/src/projects/project/node_modules/bar/index.mjs] *new* export const bar = 1; //// [/home/src/projects/project/node_modules/bar/package.json] *new* - { - "name": "bar", - "version": "1.0.0", - "main": "index.js", - - "exports": { - ".": { - - "import": "./index.mjs", - "require": "./index.js" - } - } - } +{ + "name": "bar", + "version": "1.0.0", + "main": "index.js", + + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } +} //// [/home/src/projects/project/node_modules/bar2/index.js] *new* module.exports = { bar2: 1 }; //// [/home/src/projects/project/node_modules/bar2/index.mjs] *new* export const bar2 = 1; //// [/home/src/projects/project/node_modules/bar2/package.json] *new* - { - "name": "bar2", - "version": "1.0.0", - "main": "index.js", - - "exports": { - ".": { - - "import": "./index.mjs", - "require": "./index.js" - } - } - } +{ + "name": "bar2", + "version": "1.0.0", + "main": "index.js", + + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } +} //// [/home/src/projects/project/node_modules/foo/index.d.ts] *new* export declare const foo: number; //// [/home/src/projects/project/node_modules/foo/index.js] *new* @@ -77,19 +77,19 @@ module.exports = { foo: 1 }; //// [/home/src/projects/project/node_modules/foo/index.mjs] *new* export const foo = 1; //// [/home/src/projects/project/node_modules/foo/package.json] *new* - { - "name": "foo", - "version": "1.0.0", - "main": "index.js", - "types": "index.d.ts", - "exports": { - ".": { - - "import": "./index.mjs", - "require": "./index.js" - } - } - } +{ + "name": "foo", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } +} //// [/home/src/projects/project/node_modules/foo2/index.d.ts] *new* export declare const foo2: number; //// [/home/src/projects/project/node_modules/foo2/index.js] *new* @@ -327,7 +327,7 @@ Found 2 errors in the same file, starting at: index.mts:1 export {}; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":25,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings."}]},{"pos":47,"end":52,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":47,"end":52,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar' library may need to update its package.json or typings."}]}]]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":25,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["foo","/home/src/projects/project/node_modules/foo/index.mjs"],"messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/foo/index.d.ts","foo"]}]},{"pos":47,"end":52,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["bar","/home/src/projects/project/node_modules/bar/index.mjs"],"messageChain":[{"pos":47,"end":52,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/@types/bar/index.d.ts","@types/bar"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -406,14 +406,22 @@ export {}; "end": 25, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "foo", + "/home/src/projects/project/node_modules/foo/index.mjs" + ], "messageChain": [ { "pos": 20, "end": 25, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/foo/index.d.ts", + "foo" + ] } ] }, @@ -422,21 +430,29 @@ export {}; "end": 52, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "bar", + "/home/src/projects/project/node_modules/bar/index.mjs" + ], "messageChain": [ { "pos": 47, "end": 52, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/@types/bar/index.d.ts", + "@types/bar" + ] } ] } ] ] ], - "size": 2399 + "size": 2377 } //// [/home/src/tslibs/TS/Lib/lib.es2022.full.d.ts] *Lib* /// @@ -1574,7 +1590,7 @@ Found 1 error in index.mts:1 //// [/home/src/projects/project/index.mjs] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":20,"end":25,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings."}]}]]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":20,"end":25,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["foo","/home/src/projects/project/node_modules/foo/index.mjs"],"messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/foo/index.d.ts","foo"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1663,21 +1679,29 @@ Found 1 error in index.mts:1 "end": 25, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "foo", + "/home/src/projects/project/node_modules/foo/index.mjs" + ], "messageChain": [ { "pos": 20, "end": 25, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/foo/index.d.ts", + "foo" + ] } ] } ] ] ], - "size": 2063 + "size": 2052 } tsconfig.json:: @@ -1913,17 +1937,17 @@ Signatures:: Edit [6]:: update package.json from @types so error is introduced //// [/home/src/projects/project/node_modules/@types/bar2/package.json] *modified* - { - "name": "@types/bar2", - "version": "1.0.0", - "types": "index.d.ts", - "exports": { - ".": { - - "require": "./index.d.ts" - } - } - } +{ + "name": "@types/bar2", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + + "require": "./index.d.ts" + } + } +} tsgo ExitStatus:: DiagnosticsPresent_OutputsGenerated @@ -2086,7 +2110,7 @@ Found 1 error in index.mts:4 //// [/home/src/projects/project/index.mjs] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":104,"end":110,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings."}]}]]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":104,"end":110,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["bar2","/home/src/projects/project/node_modules/bar2/index.mjs"],"messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/@types/bar2/index.d.ts","@types/bar2"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -2175,21 +2199,29 @@ Found 1 error in index.mts:4 "end": 110, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "bar2", + "/home/src/projects/project/node_modules/bar2/index.mjs" + ], "messageChain": [ { "pos": 104, "end": 110, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/@types/bar2/index.d.ts", + "@types/bar2" + ] } ] } ] ] ], - "size": 2076 + "size": 2065 } tsconfig.json:: @@ -2201,19 +2233,19 @@ Signatures:: Edit [7]:: update package.json so error is introduced //// [/home/src/projects/project/node_modules/foo2/package.json] *modified* - { - "name": "foo2", - "version": "1.0.0", - "main": "index.js", - "types": "index.d.ts", - "exports": { - ".": { - - "import": "./index.mjs", - "require": "./index.js" - } - } - } +{ + "name": "foo2", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } +} tsgo ExitStatus:: DiagnosticsPresent_OutputsGenerated @@ -2417,7 +2449,7 @@ Found 2 errors in the same file, starting at: index.mts:3 //// [/home/src/projects/project/index.mjs] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":75,"end":81,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":75,"end":81,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo2' library may need to update its package.json or typings."}]},{"pos":104,"end":110,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings."}]}]]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":75,"end":81,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["foo2","/home/src/projects/project/node_modules/foo2/index.mjs"],"messageChain":[{"pos":75,"end":81,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/foo2/index.d.ts","foo2"]}]},{"pos":104,"end":110,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["bar2","/home/src/projects/project/node_modules/bar2/index.mjs"],"messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"messageKey":"There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278","messageArgs":["/home/src/projects/project/node_modules/@types/bar2/index.d.ts","@types/bar2"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -2497,14 +2529,22 @@ Found 2 errors in the same file, starting at: index.mts:3 "end": 81, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "foo2", + "/home/src/projects/project/node_modules/foo2/index.mjs" + ], "messageChain": [ { "pos": 75, "end": 81, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo2' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/foo2/index.d.ts", + "foo2" + ] } ] }, @@ -2513,21 +2553,29 @@ Found 2 errors in the same file, starting at: index.mts:3 "end": 110, "code": 7016, "category": 1, - "message": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "messageKey": "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", + "messageArgs": [ + "bar2", + "/home/src/projects/project/node_modules/bar2/index.mjs" + ], "messageChain": [ { "pos": 104, "end": 110, "code": 6278, "category": 3, - "message": "There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings." + "messageKey": "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", + "messageArgs": [ + "/home/src/projects/project/node_modules/@types/bar2/index.d.ts", + "@types/bar2" + ] } ] } ] ] ], - "size": 2467 + "size": 2445 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js b/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js index d50d7c12a..cd3c79443 100644 --- a/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js +++ b/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js @@ -106,7 +106,7 @@ exports.x = void 0; exports.x = 10; //// [/home/src/workspaces/project/src/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.es2016.full.d.ts","./main.ts","./fileB.mts","./fileA.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1},{"version":"d03690d860e74c03bcacf63f0dd68b93-export function foo() {}","signature":"7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n","impliedNodeFormat":99},{"version":"cc520ca096f0b81d18073ba8a9776fe3-import { foo } from \"./fileB.mjs\";\nfoo();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"module":100,"target":3},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":33,"code":1479,"category":1,"message":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.","messageChain":[{"pos":20,"end":33,"code":1481,"category":3,"message":"To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/home/src/workspaces/project/package.json'."}]}]]],"latestChangedDtsFile":"./fileA.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.es2016.full.d.ts","./main.ts","./fileB.mts","./fileA.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1},{"version":"d03690d860e74c03bcacf63f0dd68b93-export function foo() {}","signature":"7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n","impliedNodeFormat":99},{"version":"cc520ca096f0b81d18073ba8a9776fe3-import { foo } from \"./fileB.mjs\";\nfoo();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"module":100,"target":3},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":33,"code":1479,"category":1,"messageKey":"The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479","messageArgs":["./fileB.mjs"],"messageChain":[{"pos":20,"end":33,"code":1481,"category":3,"messageKey":"To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481","messageArgs":[".mts","/home/src/workspaces/project/package.json"]}]}]]],"latestChangedDtsFile":"./fileA.d.ts"} //// [/home/src/workspaces/project/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -200,14 +200,21 @@ exports.x = 10; "end": 33, "code": 1479, "category": 1, - "message": "The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.", + "messageKey": "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", + "messageArgs": [ + "./fileB.mjs" + ], "messageChain": [ { "pos": 20, "end": 33, "code": 1481, "category": 3, - "message": "To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/home/src/workspaces/project/package.json'." + "messageKey": "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", + "messageArgs": [ + ".mts", + "/home/src/workspaces/project/package.json" + ] } ] } @@ -215,7 +222,7 @@ exports.x = 10; ] ], "latestChangedDtsFile": "./fileA.d.ts", - "size": 2140 + "size": 2043 } src/tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js index 31b85a5cb..7efb7cb50 100644 --- a/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js @@ -77,7 +77,7 @@ exports.b = void 0; exports.b = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -115,11 +115,11 @@ exports.b = 10; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -152,21 +152,27 @@ exports.b = 10; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1810 + "size": 1878 } tsconfig.json:: @@ -449,7 +455,7 @@ const a = class { exports.a = a; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -487,11 +493,11 @@ exports.a = a; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -522,21 +528,27 @@ exports.a = a; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1806 + "size": 1874 } tsconfig.json:: @@ -588,7 +600,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -625,11 +637,11 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -657,21 +669,27 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1753 + "size": 1821 } tsconfig.json:: @@ -871,7 +889,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -953,12 +971,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -1004,7 +1026,7 @@ const a = class { exports.a = a; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1044,11 +1066,11 @@ exports.a = a; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -1088,7 +1110,11 @@ exports.a = a; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -1102,21 +1128,27 @@ exports.a = a; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 2114 + "size": 2209 } tsconfig.json:: @@ -1143,7 +1175,7 @@ exports.a = void 0; exports.a = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1227,12 +1259,16 @@ exports.a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1256,7 +1292,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1338,12 +1374,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js index 79f706207..9f42a3e02 100644 --- a/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js @@ -466,7 +466,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -535,12 +535,16 @@ Found 1 error in a.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1398 + "size": 1425 } tsconfig.json:: @@ -735,7 +739,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -817,12 +821,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -844,7 +852,7 @@ export declare const a: number; //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -928,12 +936,16 @@ export declare const a: number; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1615 + "size": 1642 } tsconfig.json:: @@ -955,7 +967,7 @@ export declare const a = "hello"; //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1039,12 +1051,16 @@ export declare const a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1068,7 +1084,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1150,12 +1166,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js index 3dea3854e..402fd4c26 100644 --- a/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js @@ -768,7 +768,7 @@ exports.c = void 0; exports.c = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -850,12 +850,16 @@ exports.c = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: @@ -888,7 +892,7 @@ exports.a = void 0; exports.a = "hello; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -973,12 +977,16 @@ exports.a = "hello; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1622 + "size": 1649 } tsconfig.json:: @@ -1003,7 +1011,7 @@ exports.a = void 0; exports.a = "hello"; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1087,12 +1095,16 @@ exports.a = "hello"; "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1611 + "size": 1638 } tsconfig.json:: @@ -1116,7 +1128,7 @@ Output:: Found 1 error in c.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1198,12 +1210,16 @@ Found 1 error in c.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1589 + "size": 1616 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-composite.js b/testdata/baselines/reference/tsc/noEmit/changes-composite.js index 684ab7b06..37ee82042 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-composite.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-composite.js @@ -331,7 +331,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -463,7 +463,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -471,7 +476,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -485,7 +493,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -493,7 +506,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -553,7 +569,7 @@ Errors Files ] } ], - "size": 3190 + "size": 3298 } tsconfig.json:: @@ -825,7 +841,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -967,7 +983,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -975,7 +996,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -989,7 +1013,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -997,7 +1026,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -1005,7 +1037,7 @@ exports.classC = classC; ] ], "latestChangedDtsFile": "./src/class.d.ts", - "size": 3093 + "size": 3201 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js b/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js index 5b783b64e..095b898f9 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js @@ -330,7 +330,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -462,7 +462,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -470,7 +475,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -484,7 +492,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -492,7 +505,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -525,7 +541,7 @@ Errors Files ] ] ], - "size": 2906 + "size": 3014 } tsconfig.json:: @@ -803,7 +819,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -945,7 +961,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -953,7 +974,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -967,7 +991,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -975,14 +1004,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 3053 + "size": 3161 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-incremental.js b/testdata/baselines/reference/tsc/noEmit/changes-incremental.js index e7d2f13ae..169d7db32 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-incremental.js @@ -272,7 +272,7 @@ Errors Files 1 src/indirectUse.ts:2 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -405,7 +405,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -413,7 +418,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -427,7 +435,12 @@ Errors Files "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -435,7 +448,10 @@ Errors Files "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -464,7 +480,7 @@ Errors Files 5 ] ], - "size": 2807 + "size": 2915 } tsconfig.json:: @@ -713,7 +729,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -836,7 +852,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -844,7 +865,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -858,7 +882,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -866,14 +895,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 2582 + "size": 2690 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js index 36c0d08c5..446644d52 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js @@ -521,7 +521,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -663,7 +663,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -671,7 +676,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -685,7 +693,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -693,7 +706,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -701,7 +717,7 @@ exports.classC = classC; ] ], "latestChangedDtsFile": "./src/class.d.ts", - "size": 3093 + "size": 3201 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js index 06cf8ee6c..ee6f0436f 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -497,7 +497,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -639,7 +639,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -647,7 +652,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -661,7 +669,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -669,14 +682,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 3053 + "size": 3161 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js index 30ecfe766..671a78cf8 100644 --- a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js @@ -412,7 +412,7 @@ exports.classC = classC; //// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* //// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"messageKey":"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","messageArgs":["prop","classC","prop1"],"relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"messageKey":"_0_is_declared_here_2728","messageArgs":["prop1"]}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -545,7 +545,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -553,7 +558,10 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } @@ -567,7 +575,12 @@ exports.classC = classC; "end": 80, "code": 2551, "category": 1, - "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "messageKey": "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", + "messageArgs": [ + "prop", + "classC", + "prop1" + ], "relatedInformation": [ { "file": "./src/class.ts", @@ -575,14 +588,17 @@ exports.classC = classC; "end": 31, "code": 2728, "category": 3, - "message": "'prop1' is declared here." + "messageKey": "_0_is_declared_here_2728", + "messageArgs": [ + "prop1" + ] } ] } ] ] ], - "size": 2770 + "size": 2878 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index fbd4468cd..cb01d2344 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -193,7 +193,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -268,14 +268,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -289,14 +295,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -310,14 +322,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -358,7 +376,7 @@ Errors Files ] ] ], - "size": 2084 + "size": 2240 } tsconfig.json:: @@ -407,7 +425,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -483,14 +501,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -504,14 +528,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -525,14 +555,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -573,7 +609,7 @@ Errors Files ] ] ], - "size": 2106 + "size": 2262 } tsconfig.json:: @@ -690,7 +726,7 @@ const d = class { exports.d = d; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -731,11 +767,11 @@ exports.d = d; { "fileName": "./a.ts", "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": "CommonJS", "original": { "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", - "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "signature": "797d7267ef7f35dc3f989be23b6d4fe3-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "impliedNodeFormat": 1 } }, @@ -753,22 +789,22 @@ exports.d = d; { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -785,14 +821,20 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -806,14 +848,20 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -827,21 +875,27 @@ exports.d = d; "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } ] ] ], - "size": 3087 + "size": 3291 } tsconfig.json:: @@ -861,7 +915,7 @@ tsgo --noEmit ExitStatus:: Success Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -924,22 +978,22 @@ Output:: { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -953,14 +1007,20 @@ Output:: "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -974,14 +1034,20 @@ Output:: "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -995,7 +1061,7 @@ Output:: 2 ] ], - "size": 2663 + "size": 2799 } tsconfig.json:: @@ -1036,7 +1102,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1099,22 +1165,22 @@ Errors Files { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1131,14 +1197,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -1152,14 +1224,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1200,7 +1278,7 @@ Errors Files ] ] ], - "size": 2720 + "size": 2856 } tsconfig.json:: @@ -1239,7 +1317,7 @@ Errors Files 1 d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["c"]}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1302,22 +1380,22 @@ Errors Files { "fileName": "./c.ts", "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": "CommonJS", "original": { "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", - "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "signature": "e1e85d69ff8bbf5440c12f8f1badf3e4-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nc\n", "impliedNodeFormat": 1 } }, { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1335,14 +1413,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable c." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "c" + ] } ] } @@ -1356,14 +1440,20 @@ Errors Files "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1404,7 +1494,7 @@ Errors Files ] ] ], - "size": 2742 + "size": 2878 } tsconfig.json:: @@ -1432,7 +1522,7 @@ Output:: Found 1 error in d.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["d"]}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -1506,11 +1596,11 @@ Found 1 error in d.ts:1 { "fileName": "./d.ts", "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": "CommonJS", "original": { "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", - "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "signature": "9bb613afbef9c5e40a1cbd833df92c7f-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(13,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\nd\n", "impliedNodeFormat": 1 } } @@ -1528,14 +1618,20 @@ Found 1 error in d.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable d." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "d" + ] } ] } @@ -1576,7 +1672,7 @@ Found 1 error in d.ts:1 ] ] ], - "size": 2318 + "size": 2386 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js index 081315949..eac12bb8a 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js @@ -29,7 +29,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -88,14 +88,20 @@ Found 1 error in a.ts:1 "end": 14, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 13, "end": 14, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -120,7 +126,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1368 + "size": 1420 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -403,7 +409,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -440,12 +446,12 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -474,14 +480,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -498,7 +510,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1795 + "size": 1863 } tsconfig.json:: @@ -539,7 +551,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -576,12 +588,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -610,21 +622,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1759 + "size": 1827 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js index 21f7e2d3a..26f97a2be 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js @@ -27,7 +27,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -81,14 +81,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -105,7 +111,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1341 + "size": 1393 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -344,7 +350,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -376,12 +382,12 @@ Found 1 error in a.ts:1 { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -399,14 +405,20 @@ Found 1 error in a.ts:1 "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -423,7 +435,7 @@ Found 1 error in a.ts:1 ] ] ], - "size": 1614 + "size": 1682 } tsconfig.json:: @@ -464,7 +476,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -496,12 +508,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -519,21 +531,27 @@ const a = class { "end": 7, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 6, "end": 7, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } ] ] ], - "size": 1578 + "size": 1646 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js index ad330475c..57fd7cf97 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -320,7 +320,7 @@ tsgo --noEmit ExitStatus:: Success Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -357,12 +357,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -384,7 +384,7 @@ Output:: 2 ] ], - "size": 1393 + "size": 1409 } tsconfig.json:: @@ -406,7 +406,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -443,12 +443,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -463,7 +463,7 @@ const a = class { "options": { "declaration": false }, - "size": 1362 + "size": 1378 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js index e75cb2871..253723134 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -276,7 +276,7 @@ tsgo --noEmit ExitStatus:: Success Output:: //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -308,12 +308,12 @@ Output:: { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -329,7 +329,7 @@ Output:: 2 ] ], - "size": 1324 + "size": 1340 } tsconfig.json:: @@ -351,7 +351,7 @@ const a = class { }; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -383,12 +383,12 @@ const a = class { { "fileName": "./a.ts", "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": "CommonJS", "original": { "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", - "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "signature": "e4289913a1e3c6021f5a6745f65d4044-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094\np\n\n(6,1): error9027: Add_a_type_annotation_to_the_variable_0_9027\na\n", "affectsGlobalScope": true, "impliedNodeFormat": 1 } @@ -397,7 +397,7 @@ const a = class { "options": { "declaration": false }, - "size": 1293 + "size": 1309 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js index 549ea01b3..8a0748882 100644 --- a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js @@ -25,7 +25,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2,3]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -84,7 +84,11 @@ Found 1 error in a.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -101,7 +105,7 @@ Found 1 error in a.ts:1 3 ] ], - "size": 1204 + "size": 1231 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -358,7 +362,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -424,7 +428,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -436,7 +444,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1327 + "size": 1354 } tsconfig.json:: @@ -464,7 +472,7 @@ Found 1 error in a.ts:1 const a = "hello"; //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -530,12 +538,16 @@ const a = "hello"; "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1296 + "size": 1323 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js index d8d37eb0b..2ef820b08 100644 --- a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js @@ -23,7 +23,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -77,7 +77,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -89,7 +93,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1184 + "size": 1211 } //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -314,7 +318,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -369,7 +373,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] @@ -381,7 +389,7 @@ Found 1 error in a.ts:1 2 ] ], - "size": 1258 + "size": 1285 } tsconfig.json:: @@ -407,7 +415,7 @@ Found 1 error in a.ts:1 //// [/home/src/projects/project/a.js] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["string","number"]}]]]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -462,12 +470,16 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type 'string' is not assignable to type 'number'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "string", + "number" + ] } ] ] ], - "size": 1227 + "size": 1254 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js index 9ad5ae42c..60737ba2d 100644 --- a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -60,7 +60,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"messageKey":"Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094","messageArgs":["p"],"relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"messageKey":"Add_a_type_annotation_to_the_variable_0_9027","messageArgs":["a"]}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -139,14 +139,20 @@ declare const console: { log(msg: any): void; }; "end": 54, "code": 4094, "category": 1, - "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "messageKey": "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", + "messageArgs": [ + "p" + ], "relatedInformation": [ { "pos": 53, "end": 54, "code": 9027, "category": 1, - "message": "Add a type annotation to the variable a." + "messageKey": "Add_a_type_annotation_to_the_variable_0_9027", + "messageArgs": [ + "a" + ] } ] } @@ -179,7 +185,7 @@ declare const console: { log(msg: any): void; }; ] ] ], - "size": 1628 + "size": 1680 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js b/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js index 68b504499..4cf35eb31 100644 --- a/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js +++ b/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js @@ -48,7 +48,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../file1.ts","../file2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";","f7d221ab360f516a6280e3b725f4cd31-export class D { }"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type '\"hello\"' is not assignable to type '30'."}]]],"affectedFilesPendingEmit":[2,3]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../file1.ts","../file2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";","f7d221ab360f516a6280e3b725f4cd31-export class D { }"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["\"hello\"","30"]}]]],"affectedFilesPendingEmit":[2,3]} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -108,7 +108,11 @@ declare const console: { log(msg: any): void; }; "end": 14, "code": 2322, "category": 1, - "message": "Type '\"hello\"' is not assignable to type '30'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "\"hello\"", + "30" + ] } ] ] @@ -125,7 +129,7 @@ declare const console: { log(msg: any): void; }; 3 ] ], - "size": 1223 + "size": 1250 } tsconfig.json:: @@ -151,7 +155,7 @@ Output:: Found 1 error in file1.ts:1 //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../file1.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type '\"hello\"' is not assignable to type '30'."}]]],"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../file1.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["\"hello\"","30"]}]]],"affectedFilesPendingEmit":[2]} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -200,7 +204,11 @@ Found 1 error in file1.ts:1 "end": 14, "code": 2322, "category": 1, - "message": "Type '\"hello\"' is not assignable to type '30'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "\"hello\"", + "30" + ] } ] ] @@ -212,7 +220,7 @@ Found 1 error in file1.ts:1 2 ] ], - "size": 1149 + "size": 1176 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js index 19e0e565e..ffc2b7b64 100644 --- a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js @@ -56,7 +56,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[2,3,4]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -135,7 +135,11 @@ declare const console: { log(msg: any): void; }; "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -157,7 +161,7 @@ declare const console: { log(msg: any): void; }; 4 ] ], - "size": 1445 + "size": 1472 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js index 6720293a5..c82673852 100644 --- a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js @@ -56,7 +56,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["number","string"]}]]],"affectedFilesPendingEmit":[2,3,4]} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -135,7 +135,11 @@ declare const console: { log(msg: any): void; }; "end": 47, "code": 2322, "category": 1, - "message": "Type 'number' is not assignable to type 'string'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "number", + "string" + ] } ] ] @@ -157,7 +161,7 @@ declare const console: { log(msg: any): void; }; 4 ] ], - "size": 1446 + "size": 1473 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js b/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js index 28ab717da..47ae7bdf2 100644 --- a/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js +++ b/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js @@ -149,7 +149,7 @@ Output:: Found 1 error in a.ts:1 //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6792320cbdee0286d2b3e83ff1d9fcc1-const x: 20 = 10;","signature":"c4dd771ef0ee0838482d28bc7dea6269-declare const x: 20;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4448aee3ffd6eaf52054c6f2413c128a-const y = 10;","signature":"b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"noEmitOnError":true},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type '10' is not assignable to type '20'."}]]],"affectedFilesPendingEmit":[2,[3,48]],"latestChangedDtsFile":"./b.d.ts","emitSignatures":[[2,["4be7af7f970696121f4f582a5d074177-declare const x = 10;\n"]],[3,[]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6792320cbdee0286d2b3e83ff1d9fcc1-const x: 20 = 10;","signature":"c4dd771ef0ee0838482d28bc7dea6269-declare const x: 20;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4448aee3ffd6eaf52054c6f2413c128a-const y = 10;","signature":"b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"noEmitOnError":true},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"messageKey":"Type_0_is_not_assignable_to_type_1_2322","messageArgs":["10","20"]}]]],"affectedFilesPendingEmit":[2,[3,48]],"latestChangedDtsFile":"./b.d.ts","emitSignatures":[[2,["4be7af7f970696121f4f582a5d074177-declare const x = 10;\n"]],[3,[]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", @@ -225,7 +225,11 @@ Found 1 error in a.ts:1 "end": 7, "code": 2322, "category": 1, - "message": "Type '10' is not assignable to type '20'." + "messageKey": "Type_0_is_not_assignable_to_type_1_2322", + "messageArgs": [ + "10", + "20" + ] } ] ] @@ -267,7 +271,7 @@ Found 1 error in a.ts:1 ] } ], - "size": 1620 + "size": 1647 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js index 8175413de..70775185d 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js @@ -66,7 +66,7 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":28,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":28,"code":6305,"category":1,"messageKey":"Output_file_0_has_not_been_built_from_source_file_1_6305","messageArgs":["/home/src/workspaces/project/alpha/bin/a.d.ts","/home/src/workspaces/project/alpha/a.ts"]}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -120,13 +120,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); "end": 28, "code": 6305, "category": 1, - "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + "messageKey": "Output_file_0_has_not_been_built_from_source_file_1_6305", + "messageArgs": [ + "/home/src/workspaces/project/alpha/bin/a.d.ts", + "/home/src/workspaces/project/alpha/a.ts" + ] } ] ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1325 + "size": 1352 } beta/tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js index be88f86fa..913e9640b 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js @@ -64,7 +64,7 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":30,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":30,"code":6305,"category":1,"messageKey":"Output_file_0_has_not_been_built_from_source_file_1_6305","messageArgs":["/home/src/workspaces/project/alpha/bin/a.d.ts","/home/src/workspaces/project/alpha/a.ts"]}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -118,13 +118,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); "end": 30, "code": 6305, "category": 1, - "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + "messageKey": "Output_file_0_has_not_been_built_from_source_file_1_6305", + "messageArgs": [ + "/home/src/workspaces/project/alpha/bin/a.d.ts", + "/home/src/workspaces/project/alpha/a.ts" + ] } ] ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1327 + "size": 1354 } beta/tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js b/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js index fad1de319..af46244a7 100644 --- a/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js +++ b/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js @@ -72,7 +72,7 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../alpha/bin/a.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"3145b36c4687eb0550eabb198d0c0d22-export { };",{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":10,"code":2305,"category":1,"message":"Module '\"../alpha/bin/a\"' has no exported member 'm'."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../alpha/bin/a.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"3145b36c4687eb0550eabb198d0c0d22-export { };",{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":10,"code":2305,"category":1,"messageKey":"Module_0_has_no_exported_member_1_2305","messageArgs":["\"../alpha/bin/a\"","m"]}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -143,13 +143,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); "end": 10, "code": 2305, "category": 1, - "message": "Module '\"../alpha/bin/a\"' has no exported member 'm'." + "messageKey": "Module_0_has_no_exported_member_1_2305", + "messageArgs": [ + "\"../alpha/bin/a\"", + "m" + ] } ] ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1359 + "size": 1386 } beta/tsconfig.json::