From 5b021109b18e402fcb6a489fbea5560d10c41329 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 07:03:49 +0000 Subject: [PATCH 1/2] deps(deps): bump microsoft/typescript-go from `a7acc87` to `0a7c6b4` Bumps [microsoft/typescript-go](https://github.com/microsoft/typescript-go) from `a7acc87` to `0a7c6b4`. - [Commits](https://github.com/microsoft/typescript-go/compare/a7acc872b4a479ba78737975abfb270b6bae48a7...0a7c6b47e6163892880e0e5814e519c435445f11) --- updated-dependencies: - dependency-name: microsoft/typescript-go dependency-version: 0a7c6b47e6163892880e0e5814e519c435445f11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- microsoft/typescript-go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/typescript-go b/microsoft/typescript-go index a7acc872b..0a7c6b47e 160000 --- a/microsoft/typescript-go +++ b/microsoft/typescript-go @@ -1 +1 @@ -Subproject commit a7acc872b4a479ba78737975abfb270b6bae48a7 +Subproject commit 0a7c6b47e6163892880e0e5814e519c435445f11 From ef94b4b9f7699bf8d10bc11215f9931da421f366 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 07:12:31 +0000 Subject: [PATCH 2/2] chore(sync): mirror internal packages into pkg/ (auto) --- pkg/ast/parseoptions.go | 2 +- pkg/checker/checker.go | 50 +- pkg/checker/flow.go | 8 +- pkg/checker/grammarchecks.go | 29 +- pkg/checker/inference.go | 14 +- pkg/checker/jsx.go | 2 +- pkg/checker/nodecopy.go | 15 +- pkg/checker/relater.go | 8 +- pkg/execute/tsc/extendedconfigcache.go | 2 +- pkg/execute/tsc/extendedconfigcache_test.go | 97 + pkg/fourslash/_scripts/failingTests.txt | 2 - ...deFixImportNonTextualSpecifierText_test.go | 27 + .../jsDocDontBreakWithNamespacesVS_test.go | 34 + .../manual/jsDocFunctionSignatures5VS_test.go | 32 + .../manual/jsDocFunctionSignatures6VS_test.go | 27 + .../tests/manual/jsdocReturnsTagVS_test.go | 29 + .../manual/quickInfoJsDocTags13VS_test.go | 42 + .../quickInfoJsDocTextFormatting1VS_test.go | 58 + .../signatureHelpAfterParameterVS_test.go | 21 + .../signatureHelpAnonymousTypeVS_test.go | 20 + .../signatureHelpBindingPatternVS_test.go | 67 + ...ignatureHelpCommentsClassMembersVS_test.go | 148 + .../signatureHelpCommentsClassVS_test.go | 74 + ...natureHelpCommentsCommentParsingVS_test.go | 218 + ...eHelpCommentsFunctionDeclarationVS_test.go | 34 + ...reHelpCommentsFunctionExpressionVS_test.go | 43 + ...lpConstructorCallParamPropertiesVS_test.go | 26 + ...lpExpandedRestTuplesLocalLabels1VS_test.go | 80 + ...atureHelpInferenceJsDocImportTagVS_test.go | 34 + .../signatureHelpIteratorNextVS_test.go | 37 + .../signatureHelpJSDocCallbackTagVS_test.go | 42 + .../manual/signatureHelpJSDocTagsVS_test.go | 75 + ...atureHelpJSMissingPropertyAccessVS_test.go | 21 + .../manual/signatureHelpRestArgs1VS_test.go | 26 + .../manual/signatureHelpRestArgs2VS_test.go | 29 + .../manual/signatureHelpRestArgs3VS_test.go | 20 + .../signatureHelpSkippedArgs1VS_test.go | 19 + .../signatureHelpTypeArguments2VS_test.go | 29 + .../manual/signatureHelpWithUnknownVS_test.go | 18 + .../manual/signatureHelp_unionTypeVS_test.go | 33 + .../trailingCommaSignatureHelpVS_test.go | 29 + pkg/ls/autoimport/fix.go | 16 +- pkg/ls/displaypartswriter.go | 217 + pkg/ls/signaturehelp.go | 190 +- pkg/lsp/lsproto/_generate/generate.mts | 77 +- pkg/lsp/lsproto/lsp_generated.go | 196 + pkg/parser/parser.go | 2 +- pkg/parser/reparser.go | 10 +- pkg/printer/emitcontext.go | 6 +- pkg/printer/printer.go | 27 +- pkg/printer/utilities.go | 15 +- pkg/project/configfileregistrybuilder.go | 2 +- pkg/project/extendedconfigcache.go | 2 +- pkg/scanner/scanner.go | 20 +- pkg/transformers/declarations/transform.go | 21 +- pkg/transformers/destructuring.go | 16 +- .../estransforms/objectrestspread.go | 2 +- pkg/transformers/jsxtransforms/jsx.go | 13 + .../tstransforms/runtimesyntax.go | 2 +- pkg/tsoptions/commandlineparser_test.go | 16 + pkg/tsoptions/parsinghelpers.go | 8 + pkg/tsoptions/tsconfigparsing.go | 23 +- pkg/tsoptions/tsconfigparsing_test.go | 2 +- .../anonymousClassDecoratorEs2022.errors.txt | 16 + .../compiler/anonymousClassDecoratorEs2022.js | 66 + .../anonymousClassDecoratorEs2022.symbols | 12 + .../anonymousClassDecoratorEs2022.types | 14 + .../reference/compiler/awaitObjectLiteral.js | 15 + .../compiler/awaitObjectLiteral.symbols | 14 + .../compiler/awaitObjectLiteral.types | 21 + .../compiler/backslashBeforeNonSpecialChar.js | 13 + .../backslashBeforeNonSpecialChar.symbols | 16 + .../backslashBeforeNonSpecialChar.types | 17 + .../catchClauseRestProperties.errors.txt | 12 + .../compiler/catchClauseRestProperties.js | 30 + .../catchClauseRestProperties.symbols | 11 + .../compiler/catchClauseRestProperties.types | 11 + ...llyTypedFunctionOptionalAndRest.errors.txt | 8 + ...ontextuallyTypedFunctionOptionalAndRest.js | 9 + ...tuallyTypedFunctionOptionalAndRest.symbols | 8 + ...extuallyTypedFunctionOptionalAndRest.types | 9 + ...eclarationEmitNonAsciiStringLiteralType.js | 37 + ...ationEmitNonAsciiStringLiteralType.symbols | 42 + ...arationEmitNonAsciiStringLiteralType.types | 53 + .../declarationEmitPrivateAsyncMethod.js | 44 + .../declarationEmitPrivateAsyncMethod.symbols | 22 + .../declarationEmitPrivateAsyncMethod.types | 21 + ...larationEmitTypeofIndexedAccessNoParens.js | 41 + ...ionEmitTypeofIndexedAccessNoParens.symbols | 48 + ...ationEmitTypeofIndexedAccessNoParens.types | 51 + .../destructuringEmptyBinding.errors.txt | 11 + .../compiler/destructuringEmptyBinding.js | 20 + .../destructuringEmptyBinding.symbols | 6 + .../compiler/destructuringEmptyBinding.types | 7 + .../emitIncompleteDoStatement.errors.txt | 7 + .../compiler/emitIncompleteDoStatement.js | 10 + .../emitIncompleteDoStatement.symbols | 5 + .../compiler/emitIncompleteDoStatement.types | 7 + .../emitReactJsxSelfClosingElement.errors.txt | 12 + .../emitReactJsxSelfClosingElement.js | 9 + .../emitReactJsxSelfClosingElement.symbols | 6 + .../emitReactJsxSelfClosingElement.types | 8 + .../compiler/enumAutoIncrementValue.types | 2 +- .../compiler/enumNaNValues.errors.txt | 20 + .../reference/compiler/enumNaNValues.js | 32 + .../reference/compiler/enumNaNValues.symbols | 47 + .../reference/compiler/enumNaNValues.types | 44 + .../forAwaitInAsyncAccessor.errors.txt | 20 + .../compiler/forAwaitInAsyncAccessor.js | 19 + .../compiler/forAwaitInAsyncAccessor.symbols | 15 + .../compiler/forAwaitInAsyncAccessor.types | 16 + .../compiler/inferFromTupleRestAndVariadic.js | 34 + .../inferFromTupleRestAndVariadic.symbols | 55 + .../inferFromTupleRestAndVariadic.types | 35 + .../inferRestTupleShortSource.errors.txt | 16 + .../compiler/inferRestTupleShortSource.js | 19 + .../inferRestTupleShortSource.symbols | 17 + .../compiler/inferRestTupleShortSource.types | 17 + .../jsDocAugmentsEmptyExtends.errors.txt | 15 + .../jsDocAugmentsEmptyExtends.symbols | 11 + .../compiler/jsDocAugmentsEmptyExtends.types | 11 + .../compiler/jsDocTypedefWithThisTag.symbols | 7 + .../compiler/jsDocTypedefWithThisTag.types | 8 + ...jsdocCallbackParamQualifiedName.errors.txt | 31 + .../jsdocCallbackParamQualifiedName.symbols | 32 + .../jsdocCallbackParamQualifiedName.types | 34 + .../jsdocThisTagWithThisParameter.errors.txt | 9 + .../jsdocThisTagWithThisParameter.symbols | 8 + .../jsdocThisTagWithThisParameter.types | 8 + ...xAttributeValueBinaryExpression.errors.txt | 17 + .../jsxAttributeValueBinaryExpression.js | 9 + .../jsxElementTypeUnexpectedType.errors.txt | 14 + .../compiler/jsxElementTypeUnexpectedType.js | 15 + .../jsxElementTypeUnexpectedType.symbols | 17 + .../jsxElementTypeUnexpectedType.types | 18 + ...yDecoderAfterNonEntityAmpersand.errors.txt | 54 + ...jsxEntityDecoderAfterNonEntityAmpersand.js | 17 + ...tityDecoderAfterNonEntityAmpersand.symbols | 18 + ...EntityDecoderAfterNonEntityAmpersand.types | 33 + ...ManagedAttributesUnexpectedType.errors.txt | 14 + ...xLibraryManagedAttributesUnexpectedType.js | 15 + ...aryManagedAttributesUnexpectedType.symbols | 17 + ...braryManagedAttributesUnexpectedType.types | 18 + .../jsxSpreadWithAssertion.errors.txt | 26 + .../compiler/jsxSpreadWithAssertion.js | 23 + .../compiler/jsxSpreadWithAssertion.symbols | 29 + .../compiler/jsxSpreadWithAssertion.types | 38 + .../compiler/numericExportNameDeclaration.js | 41 + .../numericExportNameDeclaration.symbols | 19 + .../numericExportNameDeclaration.types | 28 + ...lisionCommonJS(module=commonjs).errors.txt | 9 + ...tNameCollisionCommonJS(module=commonjs).js | 13 + ...CollisionCommonJS(module=commonjs).symbols | 9 + ...meCollisionCommonJS(module=commonjs).types | 11 + ...ectNameCollisionCommonJS(module=esnext).js | 10 + ...meCollisionCommonJS(module=esnext).symbols | 9 + ...NameCollisionCommonJS(module=esnext).types | 11 + .../templateLiteralTypeTooComplex.errors.txt | 10 + .../compiler/templateLiteralTypeTooComplex.js | 10 + .../templateLiteralTypeTooComplex.symbols | 59 + .../templateLiteralTypeTooComplex.types | 10 + .../tsconfigMalformedNonObject.errors.txt | 13 + .../compiler/tsconfigMalformedNonObject.js | 8 + .../tsconfigMalformedNonObject.symbols | 6 + .../compiler/tsconfigMalformedNonObject.types | 7 + .../typeOnlyExportAsIfBody.errors.txt | 8 + .../compiler/typeOnlyExportAsIfBody.js | 10 + .../compiler/typeOnlyExportAsIfBody.symbols | 6 + .../compiler/typeOnlyExportAsIfBody.types | 6 + .../compiler/typeRootsRelativePath.errors.txt | 11 + .../compiler/typeRootsRelativePath.symbols | 6 + .../compiler/typeRootsRelativePath.types | 7 + .../typeofSwitchEmptyStringCase.errors.txt | 17 + .../typeofSwitchEmptyStringCase.symbols | 23 + .../typeofSwitchEmptyStringCase.types | 30 + .../unicodeSurrogatesInStringLiterals.js | 12 +- .../jsDocDontBreakWithNamespacesVS.baseline | 175 + .../jsDocFunctionSignatures5VS.baseline | 201 + .../jsDocFunctionSignatures6VS.baseline | 796 +++ .../signatureHelp/jsdocReturnsTagVS.baseline | 127 + .../quickInfoJsDocTags13VS.baseline | 278 + .../quickInfoJsDocTextFormatting1VS.baseline | 595 ++ .../signatureHelpAfterParameterVS.baseline | 1532 ++++ .../signatureHelpAnonymousTypeVS.baseline | 107 + .../signatureHelpBindingPattern.baseline | 112 +- .../signatureHelpBindingPatternVS.baseline | 1874 +++++ ...gnatureHelpCommentsClassMembersVS.baseline | 1440 ++++ .../signatureHelpCommentsClassVS.baseline | 420 ++ ...atureHelpCommentsCommentParsingVS.baseline | 6307 +++++++++++++++++ ...HelpCommentsFunctionDeclarationVS.baseline | 390 + ...eHelpCommentsFunctionExpressionVS.baseline | 341 + ...pConstructorCallParamPropertiesVS.baseline | 97 + ...pExpandedRestTuplesLocalLabels1VS.baseline | 6213 ++++++++++++++++ ...tureHelpInferenceJsDocImportTagVS.baseline | 88 + .../signatureHelpIteratorNextVS.baseline | 1343 ++++ .../signatureHelpJSDocCallbackTagVS.baseline | 497 ++ .../signatureHelpJSDocTagsVS.baseline | 301 + ...tureHelpJSMissingPropertyAccessVS.baseline | 464 ++ .../signatureHelpRestArgs1VS.baseline | 648 ++ .../signatureHelpRestArgs2VS.baseline | 139 + .../signatureHelpRestArgs3VS.baseline | 706 ++ .../signatureHelpSkippedArgs1VS.baseline | 641 ++ .../signatureHelpTypeArguments2VS.baseline | 748 ++ .../signatureHelpWithUnknownVS.baseline | 89 + .../signatureHelp_unionTypeVS.baseline | 395 ++ .../trailingCommaSignatureHelpVS.baseline | 253 + .../declarationEmitGlobalThisPreserved.js | 6 +- ...eclarationEmitResolveTypesIfNotReusable.js | 2 +- ...arationEmitResolveTypesIfNotReusable.types | 4 +- ...onEmitResolveTypesIfNotReusable.types.diff | 4 +- .../reachabilityChecksNoCrash1.errors.txt | 8 +- .../sourceMap-LineBreaks(target=es2015).types | 6 +- ...ceMap-LineBreaks(target=es2015).types.diff | 20 - ...raphAndLineSeparatorsInStringLiteral.types | 2 +- ...ndLineSeparatorsInStringLiteral.types.diff | 11 - .../conformance/enumConstantMembers.types | 4 +- .../enumConstantMembers.types.diff | 20 - ...declarationEmitGlobalThisPreserved.js.diff | 29 - ...ationEmitResolveTypesIfNotReusable.js.diff | 2 +- ...reachabilityChecksNoCrash1.errors.txt.diff | 39 +- testdata/submoduleAccepted.txt | 1 - .../compiler/anonymousClassDecoratorEs2022.ts | 8 + .../cases/compiler/awaitObjectLiteral.ts | 9 + .../compiler/backslashBeforeNonSpecialChar.ts | 7 + .../compiler/catchClauseRestProperties.ts | 7 + ...ontextuallyTypedFunctionOptionalAndRest.ts | 3 + ...eclarationEmitNonAsciiStringLiteralType.ts | 21 + .../declarationEmitPrivateAsyncMethod.ts | 15 + ...larationEmitTypeofIndexedAccessNoParens.ts | 23 + .../compiler/destructuringEmptyBinding.ts | 3 + .../compiler/emitIncompleteDoStatement.ts | 2 + .../emitReactJsxSelfClosingElement.tsx | 3 + .../tests/cases/compiler/enumNaNValues.ts | 15 + .../cases/compiler/forAwaitInAsyncAccessor.ts | 7 + .../compiler/inferFromTupleRestAndVariadic.ts | 23 + .../compiler/inferRestTupleShortSource.ts | 9 + .../compiler/jsDocAugmentsEmptyExtends.ts | 11 + .../cases/compiler/jsDocTypedefWithThisTag.ts | 7 + .../jsdocCallbackParamQualifiedName.ts | 29 + .../compiler/jsdocThisTagWithThisParameter.ts | 8 + .../jsxAttributeValueBinaryExpression.tsx | 4 + .../compiler/jsxElementTypeUnexpectedType.tsx | 9 + ...sxEntityDecoderAfterNonEntityAmpersand.tsx | 8 + ...LibraryManagedAttributesUnexpectedType.tsx | 9 + .../cases/compiler/jsxSpreadWithAssertion.tsx | 15 + .../compiler/numericExportNameDeclaration.ts | 8 + .../compiler/objectNameCollisionCommonJS.ts | 4 + .../compiler/templateLiteralTypeTooComplex.ts | 5 + .../compiler/tsconfigMalformedNonObject.ts | 4 + .../cases/compiler/typeOnlyExportAsIfBody.ts | 4 + .../cases/compiler/typeRootsRelativePath.ts | 5 + .../compiler/typeofSwitchEmptyStringCase.ts | 12 + 252 files changed, 32056 insertions(+), 382 deletions(-) create mode 100644 pkg/execute/tsc/extendedconfigcache_test.go create mode 100644 pkg/fourslash/tests/codeFixImportNonTextualSpecifierText_test.go create mode 100644 pkg/fourslash/tests/manual/jsDocDontBreakWithNamespacesVS_test.go create mode 100644 pkg/fourslash/tests/manual/jsDocFunctionSignatures5VS_test.go create mode 100644 pkg/fourslash/tests/manual/jsDocFunctionSignatures6VS_test.go create mode 100644 pkg/fourslash/tests/manual/jsdocReturnsTagVS_test.go create mode 100644 pkg/fourslash/tests/manual/quickInfoJsDocTags13VS_test.go create mode 100644 pkg/fourslash/tests/manual/quickInfoJsDocTextFormatting1VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpAfterParameterVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpAnonymousTypeVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpBindingPatternVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpCommentsClassMembersVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpCommentsClassVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpCommentsCommentParsingVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpCommentsFunctionDeclarationVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpCommentsFunctionExpressionVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpConstructorCallParamPropertiesVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpExpandedRestTuplesLocalLabels1VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpInferenceJsDocImportTagVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpIteratorNextVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpJSDocCallbackTagVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpJSDocTagsVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpJSMissingPropertyAccessVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpRestArgs1VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpRestArgs2VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpRestArgs3VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpSkippedArgs1VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpTypeArguments2VS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelpWithUnknownVS_test.go create mode 100644 pkg/fourslash/tests/manual/signatureHelp_unionTypeVS_test.go create mode 100644 pkg/fourslash/tests/manual/trailingCommaSignatureHelpVS_test.go create mode 100644 pkg/ls/displaypartswriter.go create mode 100644 testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.errors.txt create mode 100644 testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.js create mode 100644 testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.symbols create mode 100644 testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.types create mode 100644 testdata/baselines/reference/compiler/awaitObjectLiteral.js create mode 100644 testdata/baselines/reference/compiler/awaitObjectLiteral.symbols create mode 100644 testdata/baselines/reference/compiler/awaitObjectLiteral.types create mode 100644 testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.js create mode 100644 testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.symbols create mode 100644 testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.types create mode 100644 testdata/baselines/reference/compiler/catchClauseRestProperties.errors.txt create mode 100644 testdata/baselines/reference/compiler/catchClauseRestProperties.js create mode 100644 testdata/baselines/reference/compiler/catchClauseRestProperties.symbols create mode 100644 testdata/baselines/reference/compiler/catchClauseRestProperties.types create mode 100644 testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.errors.txt create mode 100644 testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.js create mode 100644 testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.symbols create mode 100644 testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.types create mode 100644 testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.js create mode 100644 testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.symbols create mode 100644 testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.types create mode 100644 testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.js create mode 100644 testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.symbols create mode 100644 testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.types create mode 100644 testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.js create mode 100644 testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.symbols create mode 100644 testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.types create mode 100644 testdata/baselines/reference/compiler/destructuringEmptyBinding.errors.txt create mode 100644 testdata/baselines/reference/compiler/destructuringEmptyBinding.js create mode 100644 testdata/baselines/reference/compiler/destructuringEmptyBinding.symbols create mode 100644 testdata/baselines/reference/compiler/destructuringEmptyBinding.types create mode 100644 testdata/baselines/reference/compiler/emitIncompleteDoStatement.errors.txt create mode 100644 testdata/baselines/reference/compiler/emitIncompleteDoStatement.js create mode 100644 testdata/baselines/reference/compiler/emitIncompleteDoStatement.symbols create mode 100644 testdata/baselines/reference/compiler/emitIncompleteDoStatement.types create mode 100644 testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.errors.txt create mode 100644 testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.js create mode 100644 testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.symbols create mode 100644 testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.types create mode 100644 testdata/baselines/reference/compiler/enumNaNValues.errors.txt create mode 100644 testdata/baselines/reference/compiler/enumNaNValues.js create mode 100644 testdata/baselines/reference/compiler/enumNaNValues.symbols create mode 100644 testdata/baselines/reference/compiler/enumNaNValues.types create mode 100644 testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.errors.txt create mode 100644 testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.js create mode 100644 testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.symbols create mode 100644 testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.types create mode 100644 testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.js create mode 100644 testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.symbols create mode 100644 testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.types create mode 100644 testdata/baselines/reference/compiler/inferRestTupleShortSource.errors.txt create mode 100644 testdata/baselines/reference/compiler/inferRestTupleShortSource.js create mode 100644 testdata/baselines/reference/compiler/inferRestTupleShortSource.symbols create mode 100644 testdata/baselines/reference/compiler/inferRestTupleShortSource.types create mode 100644 testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.symbols create mode 100644 testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.types create mode 100644 testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.symbols create mode 100644 testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.types create mode 100644 testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.symbols create mode 100644 testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.types create mode 100644 testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.symbols create mode 100644 testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.types create mode 100644 testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.js create mode 100644 testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.js create mode 100644 testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.symbols create mode 100644 testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.types create mode 100644 testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.js create mode 100644 testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.symbols create mode 100644 testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.types create mode 100644 testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.js create mode 100644 testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.symbols create mode 100644 testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.types create mode 100644 testdata/baselines/reference/compiler/jsxSpreadWithAssertion.errors.txt create mode 100644 testdata/baselines/reference/compiler/jsxSpreadWithAssertion.js create mode 100644 testdata/baselines/reference/compiler/jsxSpreadWithAssertion.symbols create mode 100644 testdata/baselines/reference/compiler/jsxSpreadWithAssertion.types create mode 100644 testdata/baselines/reference/compiler/numericExportNameDeclaration.js create mode 100644 testdata/baselines/reference/compiler/numericExportNameDeclaration.symbols create mode 100644 testdata/baselines/reference/compiler/numericExportNameDeclaration.types create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).errors.txt create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).js create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).symbols create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).types create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).js create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).symbols create mode 100644 testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).types create mode 100644 testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.errors.txt create mode 100644 testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.js create mode 100644 testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.symbols create mode 100644 testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.types create mode 100644 testdata/baselines/reference/compiler/tsconfigMalformedNonObject.errors.txt create mode 100644 testdata/baselines/reference/compiler/tsconfigMalformedNonObject.js create mode 100644 testdata/baselines/reference/compiler/tsconfigMalformedNonObject.symbols create mode 100644 testdata/baselines/reference/compiler/tsconfigMalformedNonObject.types create mode 100644 testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.errors.txt create mode 100644 testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.js create mode 100644 testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.symbols create mode 100644 testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.types create mode 100644 testdata/baselines/reference/compiler/typeRootsRelativePath.errors.txt create mode 100644 testdata/baselines/reference/compiler/typeRootsRelativePath.symbols create mode 100644 testdata/baselines/reference/compiler/typeRootsRelativePath.types create mode 100644 testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.errors.txt create mode 100644 testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.symbols create mode 100644 testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.types create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespacesVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTagVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTags13VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAfterParameterVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAnonymousTypeVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPatternVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembersVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsingVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclarationVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpressionVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamPropertiesVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpExpandedRestTuplesLocalLabels1VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpInferenceJsDocImportTagVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpIteratorNextVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocCallbackTagVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTagsVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSMissingPropertyAccessVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs1VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs2VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpSkippedArgs1VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2VS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknownVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/signatureHelp_unionTypeVS.baseline create mode 100644 testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelpVS.baseline delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/enumConstantMembers.types.diff delete mode 100644 testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitGlobalThisPreserved.js.diff create mode 100644 testdata/tests/cases/compiler/anonymousClassDecoratorEs2022.ts create mode 100644 testdata/tests/cases/compiler/awaitObjectLiteral.ts create mode 100644 testdata/tests/cases/compiler/backslashBeforeNonSpecialChar.ts create mode 100644 testdata/tests/cases/compiler/catchClauseRestProperties.ts create mode 100644 testdata/tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts create mode 100644 testdata/tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts create mode 100644 testdata/tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts create mode 100644 testdata/tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts create mode 100644 testdata/tests/cases/compiler/destructuringEmptyBinding.ts create mode 100644 testdata/tests/cases/compiler/emitIncompleteDoStatement.ts create mode 100644 testdata/tests/cases/compiler/emitReactJsxSelfClosingElement.tsx create mode 100644 testdata/tests/cases/compiler/enumNaNValues.ts create mode 100644 testdata/tests/cases/compiler/forAwaitInAsyncAccessor.ts create mode 100644 testdata/tests/cases/compiler/inferFromTupleRestAndVariadic.ts create mode 100644 testdata/tests/cases/compiler/inferRestTupleShortSource.ts create mode 100644 testdata/tests/cases/compiler/jsDocAugmentsEmptyExtends.ts create mode 100644 testdata/tests/cases/compiler/jsDocTypedefWithThisTag.ts create mode 100644 testdata/tests/cases/compiler/jsdocCallbackParamQualifiedName.ts create mode 100644 testdata/tests/cases/compiler/jsdocThisTagWithThisParameter.ts create mode 100644 testdata/tests/cases/compiler/jsxAttributeValueBinaryExpression.tsx create mode 100644 testdata/tests/cases/compiler/jsxElementTypeUnexpectedType.tsx create mode 100644 testdata/tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx create mode 100644 testdata/tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx create mode 100644 testdata/tests/cases/compiler/jsxSpreadWithAssertion.tsx create mode 100644 testdata/tests/cases/compiler/numericExportNameDeclaration.ts create mode 100644 testdata/tests/cases/compiler/objectNameCollisionCommonJS.ts create mode 100644 testdata/tests/cases/compiler/templateLiteralTypeTooComplex.ts create mode 100644 testdata/tests/cases/compiler/tsconfigMalformedNonObject.ts create mode 100644 testdata/tests/cases/compiler/typeOnlyExportAsIfBody.ts create mode 100644 testdata/tests/cases/compiler/typeRootsRelativePath.ts create mode 100644 testdata/tests/cases/compiler/typeofSwitchEmptyStringCase.ts diff --git a/pkg/ast/parseoptions.go b/pkg/ast/parseoptions.go index aa548cbf9..8a84cce69 100644 --- a/pkg/ast/parseoptions.go +++ b/pkg/ast/parseoptions.go @@ -137,7 +137,7 @@ func walkTreeForJSXTags(node *Node) *Node { if node.SubtreeFacts()&SubtreeContainsJsx == 0 { return false } - if IsJsxOpeningElement(node) || IsJsxFragment(node) { + if IsJsxOpeningLikeElement(node) || IsJsxFragment(node) { found = node return true } diff --git a/pkg/checker/checker.go b/pkg/checker/checker.go index 11a3c6623..a50ea0f08 100644 --- a/pkg/checker/checker.go +++ b/pkg/checker/checker.go @@ -614,8 +614,10 @@ type Checker struct { evaluate evaluator.Evaluator stringLiteralTypes map[string]*Type numberLiteralTypes map[jsnum.Number]*Type + nanType *Type bigintLiteralTypes map[jsnum.PseudoBigInt]*Type enumLiteralTypes map[EnumLiteralKey]*Type + enumNaNLiteralTypes map[*ast.Symbol]*Type indexedAccessTypes map[CacheHashKey]*Type templateLiteralTypes map[CacheHashKey]*Type stringMappingTypes map[StringMappingKey]*Type @@ -924,6 +926,7 @@ func NewChecker(program Program, tracer *Tracer) (*Checker, *sync.Mutex) { c.numberLiteralTypes = make(map[jsnum.Number]*Type) c.bigintLiteralTypes = make(map[jsnum.PseudoBigInt]*Type) c.enumLiteralTypes = make(map[EnumLiteralKey]*Type) + c.enumNaNLiteralTypes = make(map[*ast.Symbol]*Type) c.indexedAccessTypes = make(map[CacheHashKey]*Type) c.templateLiteralTypes = make(map[CacheHashKey]*Type) c.stringMappingTypes = make(map[StringMappingKey]*Type) @@ -10402,6 +10405,7 @@ func (c *Checker) checkCollisionsForDeclarationName(node *ast.Node, name *ast.No return } c.checkCollisionWithRequireExportsInGeneratedCode(node, name) + c.checkCollisionWithGlobalObjectInGeneratedCode(node, name) c.checkCollisionWithGlobalPromiseInGeneratedCode(node, name) c.recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name) c.recordPotentialCollisionWithReflectInGeneratedCode(node, name) @@ -10435,6 +10439,22 @@ func (c *Checker) checkCollisionWithRequireExportsInGeneratedCode(node *ast.Node } } +func (c *Checker) checkCollisionWithGlobalObjectInGeneratedCode(node *ast.Node, name *ast.Node) { + if name == nil || ast.IsClassLike(node) || !c.needCollisionCheckForIdentifier(node, name, "Object") { + return + } + // Uninstantiated modules shouldn't do this check + if ast.IsModuleDeclaration(node) && ast.GetModuleInstanceState(node) != ast.ModuleInstanceStateInstantiated { + return + } + // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent + parent := ast.GetDeclarationContainer(node) + if ast.IsSourceFile(parent) && ast.IsExternalOrCommonJSModule(parent.AsSourceFile()) && c.program.GetEmitModuleFormatOfFile(parent.AsSourceFile()) == core.ModuleKindCommonJS { + // If the declaration happens to be in external module, report error that Object is a reserved identifier. + c.errorSkippedOnNoEmit(name, diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, scanner.DeclarationNameToString(name), scanner.DeclarationNameToString(name)) + } +} + func (c *Checker) needCollisionCheckForIdentifier(node *ast.Node, identifier *ast.Node, name string) bool { if identifier != nil && identifier.Text() != name { return false @@ -25135,6 +25155,14 @@ func (c *Checker) getStringLiteralType(value string) *Type { } func (c *Checker) getNumberLiteralType(value jsnum.Number) *Type { + // NaN cannot be used as a Go map key because NaN != NaN in IEEE 754, + // so Go map lookups for NaN always miss. Cache NaN type separately. + if value.IsNaN() { + if c.nanType == nil { + c.nanType = c.newLiteralType(TypeFlagsNumberLiteral, value, nil) + } + return c.nanType + } t := c.numberLiteralTypes[value] if t == nil { t = c.newLiteralType(TypeFlagsNumberLiteral, value, nil) @@ -25176,11 +25204,22 @@ func getBooleanLiteralValue(t *Type) bool { func (c *Checker) getEnumLiteralType(value any, enumSymbol *ast.Symbol, symbol *ast.Symbol) *Type { var flags TypeFlags - switch value.(type) { + switch v := value.(type) { case string: flags = TypeFlagsEnumLiteral | TypeFlagsStringLiteral case jsnum.Number: flags = TypeFlagsEnumLiteral | TypeFlagsNumberLiteral + // NaN cannot be used as a Go map key because NaN != NaN in IEEE 754, + // so Go map lookups for NaN always miss. Cache NaN enum types separately by enum symbol. + if v.IsNaN() { + t := c.enumNaNLiteralTypes[enumSymbol] + if t == nil { + t = c.newLiteralType(flags, value, nil) + t.symbol = symbol + c.enumNaNLiteralTypes[enumSymbol] = t + } + return t + } default: panic("Unhandled case in getEnumLiteralType") } @@ -26430,7 +26469,14 @@ func (c *Checker) getCrossProductUnionSize(types []*Type) int { for _, t := range types { switch { case t.flags&TypeFlagsUnion != 0: - size *= len(t.Types()) + n := len(t.Types()) + // Cap the result to avoid integer overflow when computing the cross product of many large unions. + // In TypeScript, number overflow produces Infinity which naturally exceeds the limit check; + // in Go, we must guard against int wrapping to zero or negative. + if n > 0 && size > math.MaxInt/n { + return math.MaxInt + } + size *= n case t.flags&TypeFlagsNever != 0: return 0 } diff --git a/pkg/checker/flow.go b/pkg/checker/flow.go index 4ae44332f..cc0105dc5 100644 --- a/pkg/checker/flow.go +++ b/pkg/checker/flow.go @@ -1970,15 +1970,11 @@ func (c *Checker) getSwitchClauseTypeOfWitnesses(node *ast.Node) []string { witnesses := make([]string, len(clauses)) for i, clause := range clauses { if clause.Kind == ast.KindCaseClause { - var text string - if ast.IsStringLiteralLike(clause.Expression()) { - text = clause.Expression().Text() - } - if text == "" { + if !ast.IsStringLiteralLike(clause.Expression()) { witnesses = nil break } - if !slices.Contains(witnesses, text) { + if text := clause.Expression().Text(); !slices.Contains(witnesses, text) { witnesses[i] = text } } diff --git a/pkg/checker/grammarchecks.go b/pkg/checker/grammarchecks.go index cabfb092f..498c53b17 100644 --- a/pkg/checker/grammarchecks.go +++ b/pkg/checker/grammarchecks.go @@ -922,18 +922,20 @@ func (c *Checker) checkGrammarClassDeclarationHeritageClauses(node *ast.ClassLik return c.grammarErrorOnFirstToken(typeNodes[1], diagnostics.Classes_can_only_extend_a_single_class) } - for _, j := range node.EagerJSDoc(file) { - if j.AsJSDoc().Tags == nil { - continue - } - for _, tag := range j.AsJSDoc().Tags.Nodes { - if tag.Kind == ast.KindJSDocAugmentsTag { - target := typeNodes[0].AsExpressionWithTypeArguments() - source := tag.ClassName().AsExpressionWithTypeArguments() - targetName := getIdentifierFromEntityNameExpression(target.Expression) - sourceName := getIdentifierFromEntityNameExpression(source.Expression) - if targetName != nil && sourceName != nil && targetName.Text() != sourceName.Text() { - return c.grammarErrorOnNode(sourceName, diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, tag.TagName().Text(), sourceName.Text(), targetName.Text()) + if len(typeNodes) > 0 { + for _, j := range node.EagerJSDoc(file) { + if j.AsJSDoc().Tags == nil { + continue + } + for _, tag := range j.AsJSDoc().Tags.Nodes { + if tag.Kind == ast.KindJSDocAugmentsTag { + target := typeNodes[0].AsExpressionWithTypeArguments() + source := tag.ClassName().AsExpressionWithTypeArguments() + targetName := getIdentifierFromEntityNameExpression(target.Expression) + sourceName := getIdentifierFromEntityNameExpression(source.Expression) + if targetName != nil && sourceName != nil && targetName.Text() != sourceName.Text() { + return c.grammarErrorOnNode(sourceName, diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, tag.TagName().Text(), sourceName.Text(), targetName.Text()) + } } } } @@ -1246,9 +1248,6 @@ func (c *Checker) checkGrammarForInOrForOfStatement(forInOrOfStatement *ast.ForI containingFunc := ast.GetContainingFunction(forInOrOfStatement.AsNode()) if containingFunc != nil && containingFunc.Kind != ast.KindConstructor { debug.Assert((ast.GetFunctionFlags(containingFunc)&ast.FunctionFlagsAsync) == 0, "Enclosing function should never be an async function.") - if hasAsyncModifier(containingFunc) { - panic("Enclosing function should never be an async function.") - } relatedInfo := createDiagnosticForNode(containingFunc, diagnostics.Did_you_mean_to_mark_this_function_as_async) diagnostic.AddRelatedInfo(relatedInfo) } diff --git a/pkg/checker/inference.go b/pkg/checker/inference.go index 86659fde0..82a5b4fc2 100644 --- a/pkg/checker/inference.go +++ b/pkg/checker/inference.go @@ -713,7 +713,9 @@ func (c *Checker) inferFromObjectTypes(n *InferenceState, source *Type, target * if constraint != nil && isTupleType(constraint) && constraint.TargetTupleType().combinedFlags&ElementFlagsVariable == 0 { impliedArity := constraint.TargetTupleType().fixedLength c.inferFromTypes(n, c.sliceTupleType(source, startLength, sourceArity-(startLength+impliedArity)), elementTypes[startLength]) - c.inferFromTypes(n, c.getElementTypeOfSliceOfTupleType(source, startLength+impliedArity, endLength, false, false), elementTypes[startLength+1]) + if restType := c.getElementTypeOfSliceOfTupleType(source, startLength+impliedArity, endLength, false, false); restType != nil { + c.inferFromTypes(n, restType, elementTypes[startLength+1]) + } } } } else if elementInfos[startLength].flags&ElementFlagsRest != 0 && elementInfos[startLength+1].flags&ElementFlagsVariadic != 0 { @@ -725,9 +727,13 @@ func (c *Checker) inferFromObjectTypes(n *InferenceState, source *Type, target * impliedArity := constraint.TargetTupleType().fixedLength endIndex := sourceArity - getEndElementCount(target.TargetTupleType(), ElementFlagsFixed) startIndex := endIndex - impliedArity - trailingSlice := c.createTupleTypeEx(c.getTypeArguments(source)[startIndex:endIndex], source.TargetTupleType().elementInfos[startIndex:endIndex], false /*readonly*/) - c.inferFromTypes(n, c.getElementTypeOfSliceOfTupleType(source, startLength, endLength+impliedArity, false, false), elementTypes[startLength]) - c.inferFromTypes(n, trailingSlice, elementTypes[startLength+1]) + if startIndex >= startLength { + trailingSlice := c.createTupleTypeEx(c.getTypeArguments(source)[startIndex:endIndex], source.TargetTupleType().elementInfos[startIndex:endIndex], false /*readonly*/) + if restType := c.getElementTypeOfSliceOfTupleType(source, startLength, endLength+impliedArity, false, false); restType != nil { + c.inferFromTypes(n, restType, elementTypes[startLength]) + } + c.inferFromTypes(n, trailingSlice, elementTypes[startLength+1]) + } } } } diff --git a/pkg/checker/jsx.go b/pkg/checker/jsx.go index bd196c925..b85e65c0b 100644 --- a/pkg/checker/jsx.go +++ b/pkg/checker/jsx.go @@ -1041,7 +1041,7 @@ func (c *Checker) instantiateAliasOrInterfaceWithDefaults(managedSym *ast.Symbol return c.getTypeAliasInstantiation(managedSym, args, nil) } } - if len(declaredManagedType.AsInterfaceType().TypeParameters()) >= len(typeArguments) { + if declaredManagedType.objectFlags&ObjectFlagsClassOrInterface != 0 && len(declaredManagedType.AsInterfaceType().TypeParameters()) >= len(typeArguments) { args := c.fillMissingTypeArguments(typeArguments, declaredManagedType.AsInterfaceType().TypeParameters(), len(typeArguments), inJavaScript) return c.createTypeReference(declaredManagedType, args) } diff --git a/pkg/checker/nodecopy.go b/pkg/checker/nodecopy.go index cbb479ff3..cf6f63e24 100644 --- a/pkg/checker/nodecopy.go +++ b/pkg/checker/nodecopy.go @@ -482,6 +482,9 @@ func getExistingNodeTreeVisitor(b *NodeBuilderImpl, bound *recoveryBoundary) *as if node.Kind == ast.KindJSDocTypeLiteral { var members []*ast.Node for _, t := range node.AsJSDocTypeLiteral().JSDocPropertyTags { + if t.Kind != ast.KindJSDocPropertyTag && t.Kind != ast.KindJSDocParameterTag { + continue + } n := t.Name() var targetName *ast.Node if ast.IsIdentifier(n) { @@ -779,10 +782,16 @@ func getExistingNodeTreeVisitor(b *NodeBuilderImpl, bound *recoveryBoundary) *as return res } - if ast.IsStringLiteral(node) && b.ctx.flags&nodebuilder.FlagsUseSingleQuotesForStringLiteralType != 0 && node.AsStringLiteral().TokenFlags&ast.TokenFlagsSingleQuote == 0 { - // set single quote on string literals + if ast.IsStringLiteralLike(node) { + // Preserve the original characters of the literal (e.g. emojis) in declaration emit + // rather than escaping them as ASCII Unicode escapes. Mirrors TypeScript's behavior + // for synthesized string literal types in the node builder (checker.ts:6853). c := node.Clone(b.f) - c.AsStringLiteral().TokenFlags ^= ast.TokenFlagsSingleQuote + if ast.IsStringLiteral(node) && b.ctx.flags&nodebuilder.FlagsUseSingleQuotesForStringLiteralType != 0 && node.AsStringLiteral().TokenFlags&ast.TokenFlagsSingleQuote == 0 { + // set single quote on string literals + c.AsStringLiteral().TokenFlags ^= ast.TokenFlagsSingleQuote + } + b.e.AddEmitFlags(c, printer.EFNoAsciiEscaping) return c } diff --git a/pkg/checker/relater.go b/pkg/checker/relater.go index 9353c6e52..c79fa4f2a 100644 --- a/pkg/checker/relater.go +++ b/pkg/checker/relater.go @@ -1801,8 +1801,12 @@ func (c *Checker) getRestTypeAtPosition(source *Signature, pos int, readonly boo return c.createArrayType(c.getIndexedAccessType(restType, c.numberType)) } } - types := make([]*Type, parameterCount-pos) - infos := make([]TupleElementInfo, parameterCount-pos) + length := parameterCount - pos + if length <= 0 { + return c.createTupleTypeEx(nil, nil, readonly) + } + types := make([]*Type, length) + infos := make([]TupleElementInfo, length) for i := range types { var flags ElementFlags if restType == nil || i < len(types)-1 { diff --git a/pkg/execute/tsc/extendedconfigcache.go b/pkg/execute/tsc/extendedconfigcache.go index 014964d86..a70d981e8 100644 --- a/pkg/execute/tsc/extendedconfigcache.go +++ b/pkg/execute/tsc/extendedconfigcache.go @@ -24,7 +24,7 @@ type extendedConfigCacheEntry struct { var _ tsoptions.ExtendedConfigCache = (*ExtendedConfigCache)(nil) // GetExtendedConfig implements tsoptions.ExtendedConfigCache. -func (e *ExtendedConfigCache) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { +func (e *ExtendedConfigCache) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []tspath.Path, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { entry, loaded := e.loadOrStoreNewLockedEntry(path) defer entry.mu.Unlock() if !loaded { diff --git a/pkg/execute/tsc/extendedconfigcache_test.go b/pkg/execute/tsc/extendedconfigcache_test.go new file mode 100644 index 000000000..75c3d60a8 --- /dev/null +++ b/pkg/execute/tsc/extendedconfigcache_test.go @@ -0,0 +1,97 @@ +package tsc_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/execute/tsc" + "github.com/buke/typescript-go-internal/pkg/tsoptions" + "github.com/buke/typescript-go-internal/pkg/vfs" + "github.com/buke/typescript-go-internal/pkg/vfs/vfstest" +) + +type testParseConfigHost struct { + fs vfs.FS + cwd string +} + +func (h *testParseConfigHost) FS() vfs.FS { return h.fs } +func (h *testParseConfigHost) GetCurrentDirectory() string { return h.cwd } + +func TestExtendedConfigCacheExtendsCircularity(t *testing.T) { + t.Parallel() + + t.Run("self-referencing extends", func(t *testing.T) { + t.Parallel() + + // Regression test: a tsconfig extends cycle should produce an error, + // not a deadlock when using the tsc ExtendedConfigCache. + files := map[string]any{ + "/project/tsconfig.json": `{"extends": "./base.json"}`, + "/project/base.json": `{"extends": "./base.json"}`, + "/project/main.ts": `// Hello World!`, + } + + fs := vfstest.FromMap(files, false /*useCaseSensitiveFileNames*/) + host := &testParseConfigHost{fs: fs, cwd: "/project"} + cache := &tsc.ExtendedConfigCache{} + + cmd, _ := tsoptions.GetParsedCommandLineOfConfigFile("/project/tsconfig.json", nil, nil, host, cache) + if cmd == nil { + t.Fatal("expected non-nil ParsedCommandLine") + } + assertHasCircularityDiagnostic(t, cmd) + }) + + t.Run("mutual extends cycle", func(t *testing.T) { + t.Parallel() + + // Two config files that extend each other. + files := map[string]any{ + "/project/tsconfig.json": `{"extends": "./other.json"}`, + "/project/other.json": `{"extends": "./tsconfig.json"}`, + "/project/main.ts": `// Hello World!`, + } + + fs := vfstest.FromMap(files, false /*useCaseSensitiveFileNames*/) + host := &testParseConfigHost{fs: fs, cwd: "/project"} + cache := &tsc.ExtendedConfigCache{} + + cmd, _ := tsoptions.GetParsedCommandLineOfConfigFile("/project/tsconfig.json", nil, nil, host, cache) + if cmd == nil { + t.Fatal("expected non-nil ParsedCommandLine") + } + assertHasCircularityDiagnostic(t, cmd) + }) + + t.Run("case-insensitive self-referencing extends", func(t *testing.T) { + t.Parallel() + + // On a case-insensitive FS, ./Base.json and ./base.json resolve to the same + // cache entry. The cycle check must use canonical paths to avoid deadlock. + files := map[string]any{ + "/project/tsconfig.json": `{"extends": "./Base.json"}`, + "/project/base.json": `{"extends": "./base.json"}`, + "/project/main.ts": `// Hello World!`, + } + + fs := vfstest.FromMap(files, false /*useCaseSensitiveFileNames*/) + host := &testParseConfigHost{fs: fs, cwd: "/project"} + cache := &tsc.ExtendedConfigCache{} + + cmd, _ := tsoptions.GetParsedCommandLineOfConfigFile("/project/tsconfig.json", nil, nil, host, cache) + if cmd == nil { + t.Fatal("expected non-nil ParsedCommandLine") + } + assertHasCircularityDiagnostic(t, cmd) + }) +} + +func assertHasCircularityDiagnostic(t *testing.T, cmd *tsoptions.ParsedCommandLine) { + t.Helper() + for _, d := range cmd.Errors { + if d != nil && d.Code() == 18000 { + return + } + } + t.Error("expected circularity diagnostic (code 18000), but none was found") +} diff --git a/pkg/fourslash/_scripts/failingTests.txt b/pkg/fourslash/_scripts/failingTests.txt index d1295ad6f..b9bb35865 100644 --- a/pkg/fourslash/_scripts/failingTests.txt +++ b/pkg/fourslash/_scripts/failingTests.txt @@ -33,7 +33,6 @@ TestAutoImportSortCaseSensitivity1 TestAutoImportTypeImport4 TestAutoImportTypeOnlyPreferred3 TestAutoImportVerbatimTypeOnly1 -TestCalledUnionsOfDissimilarTyeshaveGoodDisplay TestCloduleTypeOf1 TestCodeCompletionEscaping TestCodeFixAddParameterNames1 @@ -338,7 +337,6 @@ TestNoQuickInfoForLabel TestNoQuickInfoInWhitespace TestOverloadQuickInfo TestProtoVarVisibleWithOuterScopeUnderscoreProto -TestQualifyModuleTypeNames TestQuickfixImplementInterfaceUnreachableTypeUsesRelativeImport TestQuickInfo_notInsideComment TestQuickinfo01 diff --git a/pkg/fourslash/tests/codeFixImportNonTextualSpecifierText_test.go b/pkg/fourslash/tests/codeFixImportNonTextualSpecifierText_test.go new file mode 100644 index 000000000..eaa7bafe2 --- /dev/null +++ b/pkg/fourslash/tests/codeFixImportNonTextualSpecifierText_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +// https://github.com/microsoft/typescript-go/issues/3944 +func TestCodeFixImportNonTextualSpecifierText(t *testing.T) { + fourslash.SkipIfFailing(t) + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = "// @Filename: /a.ts\n" + + "import type { A } from `./${myFolder}/${myFile}`;\n" + + "\n" + + "new A/**/()" + f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) + defer done() + f.GoToMarker(t, "") + f.VerifyImportFixAtPosition(t, []string{ + "import { A } from `./${myFolder}/${myFile}`;\n" + + "\n" + + "new A()", + }, nil /*preferences*/) +} diff --git a/pkg/fourslash/tests/manual/jsDocDontBreakWithNamespacesVS_test.go b/pkg/fourslash/tests/manual/jsDocDontBreakWithNamespacesVS_test.go new file mode 100644 index 000000000..f6e48ffe8 --- /dev/null +++ b/pkg/fourslash/tests/manual/jsDocDontBreakWithNamespacesVS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestJsDocDontBreakWithNamespacesVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: jsDocDontBreakWithNamespaces.js +/** + * @returns {module:@nodefuel/web~Webserver~wsServer#hello} Websocket server object + */ +function foo() { } +foo(''/*foo*/); + +/** + * @type {module:xxxxx} */ + */ +function bar() { } +bar(''/*bar*/); + +/** @type {function(module:xxxx, module:xxxx): module:xxxxx} */ +function zee() { } +zee(''/*zee*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/jsDocFunctionSignatures5VS_test.go b/pkg/fourslash/tests/manual/jsDocFunctionSignatures5VS_test.go new file mode 100644 index 000000000..d27192983 --- /dev/null +++ b/pkg/fourslash/tests/manual/jsDocFunctionSignatures5VS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestJsDocFunctionSignatures5VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +// @allowJs: true +// @Filename: Foo.js +/** + * Filters a path based on a regexp or glob pattern. + * @param {String} basePath The base path where the search will be performed. + * @param {String} pattern A string defining a regexp of a glob pattern. + * @param {String} type The search pattern type, can be a regexp or a glob. + * @param {Object} options A object containing options to the search. + * @return {Array} A list containing the filtered paths. + */ +function pathFilter(basePath, pattern, type, options){ +//... +} +pathFilter(/**/'foo', 'bar', 'baz', {});` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/jsDocFunctionSignatures6VS_test.go b/pkg/fourslash/tests/manual/jsDocFunctionSignatures6VS_test.go new file mode 100644 index 000000000..bea32dce7 --- /dev/null +++ b/pkg/fourslash/tests/manual/jsDocFunctionSignatures6VS_test.go @@ -0,0 +1,27 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestJsDocFunctionSignatures6VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: Foo.js +/** + * @param {string} p1 - A string param + * @param {string?} p2 - An optional param + * @param {string} [p3] - Another optional param + * @param {string} [p4="test"] - An optional param with a default value + */ +function f1(p1, p2, p3, p4){} +f1(/*1*/'foo', /*2*/'bar', /*3*/'baz', /*4*/'qux');` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/jsdocReturnsTagVS_test.go b/pkg/fourslash/tests/manual/jsdocReturnsTagVS_test.go new file mode 100644 index 000000000..6213321af --- /dev/null +++ b/pkg/fourslash/tests/manual/jsdocReturnsTagVS_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestJsdocReturnsTagVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @Filename: dummy.js +/** + * Find an item + * @template T + * @param {T[]} l + * @param {T} x + * @returns {?T} The names of the found item(s). + */ +function find(l, x) { +} +find(''/**/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/quickInfoJsDocTags13VS_test.go b/pkg/fourslash/tests/manual/quickInfoJsDocTags13VS_test.go new file mode 100644 index 000000000..a3f1e87ad --- /dev/null +++ b/pkg/fourslash/tests/manual/quickInfoJsDocTags13VS_test.go @@ -0,0 +1,42 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestQuickInfoJsDocTags13VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @filename: ./a.js +/** + * First overload + * @overload + * @param {number} a + * @returns {void} + */ + +/** + * Second overload + * @overload + * @param {string} a + * @returns {void} + */ + +/** + * @param {string | number} a + * @returns {void} + */ +function f(a) {} + +f(/*a*/1); +f(/*b*/"");` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/quickInfoJsDocTextFormatting1VS_test.go b/pkg/fourslash/tests/manual/quickInfoJsDocTextFormatting1VS_test.go new file mode 100644 index 000000000..989de6c56 --- /dev/null +++ b/pkg/fourslash/tests/manual/quickInfoJsDocTextFormatting1VS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestQuickInfoJsDocTextFormatting1VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * @param {number} var1 **Highlighted text** + * @param {string} var2 Another **Highlighted text** +*/ +function f1(var1, var2) { } + +/** + * @param {number} var1 *Regular text with an asterisk + * @param {string} var2 Another *Regular text with an asterisk +*/ +function f2(var1, var2) { } + +/** + * @param {number} var1 + * *Regular text with an asterisk + * @param {string} var2 + * Another *Regular text with an asterisk +*/ +function f3(var1, var2) { } + +/** + * @param {number} var1 + * **Highlighted text** + * @param {string} var2 + * Another **Highlighted text** +*/ +function f4(var1, var2) { } + +/** + * @param {number} var1 + **Highlighted text** + * @param {string} var2 + Another **Highlighted text** +*/ +function f5(var1, var2) { } + +f1(/*1*/); +f2(/*2*/); +f3(/*3*/); +f4(/*4*/); +f5(/*5*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpAfterParameterVS_test.go b/pkg/fourslash/tests/manual/signatureHelpAfterParameterVS_test.go new file mode 100644 index 000000000..314b4eb3a --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpAfterParameterVS_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpAfterParameterVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `type Type = (a, b, c) => void +const a: Type = (a/*1*/, b/*2*/) => {} +const b: Type = function (a/*3*/, b/*4*/) {} +const c: Type = ({ /*5*/a: { b/*6*/ }}/*7*/ = { }/*8*/, [b/*9*/]/*10*/, .../*11*/c/*12*/) => {}` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpAnonymousTypeVS_test.go b/pkg/fourslash/tests/manual/signatureHelpAnonymousTypeVS_test.go new file mode 100644 index 000000000..71e9061a6 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpAnonymousTypeVS_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpAnonymousTypeVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `const comparers: Array<(a: any, b: any) => boolean> = []; + +comparers.push((a,/**/ b) => true);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpBindingPatternVS_test.go b/pkg/fourslash/tests/manual/signatureHelpBindingPatternVS_test.go new file mode 100644 index 000000000..ef3d3b03b --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpBindingPatternVS_test.go @@ -0,0 +1,67 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpBindingPatternVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = ` +/** + * @param options An empty object binding pattern. + */ +function emptyObj({}) {} +emptyObj(/*emptyObj*/) + +/** + * @param items An empty array binding pattern. + */ +function emptyArr([]) {} +emptyArr(/*emptyArr*/) + +/** + * @param param An object with a and b properties. + */ +function nonEmptyObj({a, b}: {a: number, b: string}) {} +nonEmptyObj(/*nonEmptyObj*/) + +/** + * @param tuple A tuple with two elements. + */ +function nonEmptyArr([x, y]: [number, string]) {} +nonEmptyArr(/*nonEmptyArr*/) + +/** + * @param first The first number parameter. + * @param second An object with a and b properties. + */ +function idLeading(first: number, {a, b}: {a: number, b: string}) {} +idLeading(123/*idLeading*/, { a: 1, b: 2 }/*bindingTrailing*/) + +/** + * @param first An object with a and b properties. + * @param last The last number parameter. + */ +function bindingLeading({a, b}: {a: number, b: string}, last: number) {} +bindingLeading(/*bindingLeading*/{ a: 1, b: 2 }, 123 /*idTrailing*/) + +/** + * @param param1 {Object} The first parameter + * @param param1.a {number} Comment a + * @param param1.b {string} Comment b + * @param param2 {Object} The second parameter + * @param param2.c {boolean} Comment c + * @param param2.d {unknown} Comment d + */ +function multipleBindings({ a, b }, { c, d }) {} +multipleBindings({ a: 0, b: "" }/*firstObjParam*/, { c: true, d: "" }/*secondObjParam*/) +` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpCommentsClassMembersVS_test.go b/pkg/fourslash/tests/manual/signatureHelpCommentsClassMembersVS_test.go new file mode 100644 index 000000000..bacd3294c --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpCommentsClassMembersVS_test.go @@ -0,0 +1,148 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpCommentsClassMembersVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This is comment for c1*/ +class c1 { + /** p1 is property of c1*/ + public p1: number; + /** sum with property*/ + public p2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property 1*/ + public get p3() { + return this.p2(/*8*/this.p1); + } + /** setter property 1*/ + public set p3(/** this is value*/value: number) { + this.p1 = this.p2(/*13*/value); + } + /** pp1 is property of c1*/ + private pp1: number; + /** sum with property*/ + private pp2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property 2*/ + private get pp3() { + return this.pp2(/*20*/this.pp1); + } + /** setter property 2*/ + private set pp3( /** this is value*/value: number) { + this.pp1 = this.pp2(/*25*/value); + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; + /** static sum with property*/ + static s2(/** number to add*/b: number) { + return c1.s1 + b; + } + /** static getter property*/ + static get s3() { + return c1.s2(/*35*/c1.s1); + } + /** setter property 3*/ + static set s3( /** this is value*/value: number) { + c1.s1 = c1.s2(/*42*/value); + } + public nc_p1: number; + public nc_p2(b: number) { + return this.nc_p1 + b; + } + public get nc_p3() { + return this.nc_p2(/*47*/this.nc_p1); + } + public set nc_p3(value: number) { + this.nc_p1 = this.nc_p2(/*49*/value); + } + private nc_pp1: number; + private nc_pp2(b: number) { + return this.nc_pp1 + b; + } + private get nc_pp3() { + return this.nc_pp2(/*54*/this.nc_pp1); + } + private set nc_pp3(value: number) { + this.nc_pp1 = this.nc_pp2(/*56*/value); + } + static nc_s1: number; + static nc_s2(b: number) { + return c1.nc_s1 + b; + } + static get nc_s3() { + return c1.nc_s2(/*61*/c1.nc_s1); + } + static set nc_s3(value: number) { + c1.nc_s1 = c1.nc_s2(/*63*/value); + } +} +var i1 = new c1(/*65*/); +var i1_p = i1.p1; +var i1_f = i1.p2; +var i1_r = i1.p2(/*71*/20); +var i1_prop = i1.p3; +i1.p3 = i1_prop; +var i1_nc_p = i1.nc_p1; +var i1_ncf = i1.nc_p2; +var i1_ncr = i1.nc_p2(/*81*/20); +var i1_ncprop = i1.nc_p3; +i1.nc_p3 = i1_ncprop; +var i1_s_p = c1.s1; +var i1_s_f = c1.s2; +var i1_s_r = c1.s2(/*92*/20); +var i1_s_prop = c1.s3; +c1.s3 = i1_s_prop; +var i1_s_nc_p = c1.nc_s1; +var i1_s_ncf = c1.nc_s2; +var i1_s_ncr = c1.nc_s2(/*102*/20); +var i1_s_ncprop = c1.nc_s3; +c1.nc_s3 = i1_s_ncprop; +var i1_c = c1; + +class cProperties { + private val: number; + /** getter only property*/ + public get p1() { + return this.val; + } + public get nc_p1() { + return this.val; + } + /**setter only property*/ + public set p2(value: number) { + this.val = value; + } + public set nc_p2(value: number) { + this.val = value; + } +} +var cProperties_i = new cProperties(); +cProperties_i.p2 = cProperties_i.p1; +cProperties_i.nc_p2 = cProperties_i.nc_p1; +class cWithConstructorProperty { + /** + * this is class cWithConstructorProperty's constructor + * @param a this is first parameter a + */ + constructor(/**more info about a*/public a: number) { + var bbbb = 10; + this.a = a + 2 + bbbb; + } +}` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpCommentsClassVS_test.go b/pkg/fourslash/tests/manual/signatureHelpCommentsClassVS_test.go new file mode 100644 index 000000000..aeb9d1f0b --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpCommentsClassVS_test.go @@ -0,0 +1,74 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpCommentsClassVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This is class c2 without constructor*/ +class c2 { +} +var i2 = new c2(/*3*/); +var i2_c = c2; +class c3 { + /** Constructor comment*/ + constructor() { + } +} +var i3 = new c3(/*8*/); +var i3_c = c3; +/** Class comment*/ +class c4 { + /** Constructor comment*/ + constructor() { + } +} +var i4 = new c4(/*13*/); +var i4_c = c4; +/** Class with statics*/ +class c5 { + static s1: number; +} +var i5 = new c5(/*18*/); +var i5_c = c5; +/** class with statics and constructor*/ +class c6 { + /** s1 comment*/ + static s1: number; + /** constructor comment*/ + constructor() { + } +} +var i6 = new c6(/*23*/); +var i6_c = c6; + +class a { + /** + constructor for a + @param a this is my a + */ + constructor(a: string) { + } +} +new a(/*27*/"Hello"); +namespace m { + export namespace m2 { + /** class comment */ + export class c1 { + /** constructor comment*/ + constructor() { + } + } + } +} +var myVar = new m.m2.c1();` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpCommentsCommentParsingVS_test.go b/pkg/fourslash/tests/manual/signatureHelpCommentsCommentParsingVS_test.go new file mode 100644 index 000000000..3deeff998 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpCommentsCommentParsingVS_test.go @@ -0,0 +1,218 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpCommentsCommentParsingVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/// This is simple /// comments +function simple() { +} + +simple( /*1*/); + +/// multiLine /// Comments +/// This is example of multiline /// comments +/// Another multiLine +function multiLine() { +} +multiLine( /*2*/); + +/** this is eg of single line jsdoc style comment */ +function jsDocSingleLine() { +} +jsDocSingleLine(/*3*/); + + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +function jsDocMultiLine() { +} +jsDocMultiLine(/*4*/); + +/** multiple line jsdoc comments no longer merge +*New line1 +*New Line2*/ +/** Shoul mege this line as well +* and this too*/ /** Another this one too*/ +function jsDocMultiLineMerge() { +} +jsDocMultiLineMerge(/*5*/); + + +/// Triple slash comment +/** jsdoc comment */ +function jsDocMixedComments1() { +} +jsDocMixedComments1(/*6*/); + +/// Triple slash comment +/** jsdoc comment */ /** another jsDocComment*/ +function jsDocMixedComments2() { +} +jsDocMixedComments2(/*7*/); + +/** jsdoc comment */ /*** triplestar jsDocComment*/ +/// Triple slash comment +function jsDocMixedComments3() { +} +jsDocMixedComments3(/*8*/); + +/** jsdoc comment */ /** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments4() { +} +jsDocMixedComments4(/*9*/); + +/// Triple slash comment 1 +/** jsdoc comment */ /** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments5() { +} +jsDocMixedComments5(/*10*/); + +/** another jsDocComment*/ +/// Triple slash comment 1 +/// Triple slash comment +/// Triple slash comment 2 +/** jsdoc comment */ +function jsDocMixedComments6() { +} +jsDocMixedComments6(/*11*/); + +// This shoulnot be help comment +function noHelpComment1() { +} +noHelpComment1(/*12*/); + +/* This shoulnot be help comment */ +function noHelpComment2() { +} +noHelpComment2(/*13*/); + +function noHelpComment3() { +} +noHelpComment3(/*14*/); +/** Adds two integers and returns the result + * @param {number} a first number + * @param b second number + */ +function sum(a: number, b: number) { + return a + b; +} +sum(/*16*/10, /*17*/20); +/** This is multiplication function + * @param + * @param a first number + * @param b + * @param c { + @param d @anotherTag + * @param e LastParam @anotherTag*/ +function multiply(a: number, b: number, c?: number, d?, e?) { +} +multiply(/*19*/10,/*20*/ 20,/*21*/ 30, /*22*/40, /*23*/50); +/** fn f1 with number +* @param { string} b about b +*/ +function f1(a: number); +function f1(b: string); +/**@param opt optional parameter*/ +function f1(aOrb, opt?) { + return aOrb; +} +f1(/*25*/10); +f1(/*26*/"hello"); + +/** This is subtract function +@param { a +*@param { number | } b this is about b +@param { { () => string; } } c this is optional param c +@param { { () => string; } d this is optional param d +@param { { () => string; } } e this is optional param e +@param { { { () => string; } } f this is optional param f +*/ +function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +} +subtract(/*28*/10, /*29*/ 20, /*30*/ null, /*31*/ null, /*32*/ null, /*33*/null); +/** this is square function +@paramTag { number } a this is input number of paramTag +@param { number } a this is input number +@returnType { number } it is return type +*/ +function square(a: number) { + return a * a; +} +square(/*34*/10); +/** this is divide function +@param { number} a this is a +@paramTag { number } g this is optional param g +@param { number} b this is b +*/ +function divide(a: number, b: number) { +} +divide(/*35*/10, /*36*/20); +/** +Function returns string concat of foo and bar +@param {string} foo is string +@param {string} bar is second string +*/ +function fooBar(foo: string, bar: string) { + return foo + bar; +} +fooBar(/*37*/"foo",/*38*/"bar"); +/** This is a comment */ +var x; +/** + * This is a comment + */ +var y; +/** this is jsdoc style function with param tag as well as inline parameter help +*@param a it is first parameter +*@param c it is third parameter +*/ +function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { + return /*39*/a + b + c + d; +} +jsDocParamTest(/*40*/30, /*41*/40, /*42*/50, /*43*/60); +/** This is function comment + * And properly aligned comment + */ +function jsDocCommentAlignmentTest1() { +} +jsDocCommentAlignmentTest1(/*45*/); +/** This is function comment + * And aligned with 4 space char margin + */ +function jsDocCommentAlignmentTest2() { +} +jsDocCommentAlignmentTest2(/*46*/); +/** This is function comment + * And aligned with 4 space char margin + * @param {string} a this is info about a + * spanning on two lines and aligned perfectly + * @param b this is info about b + * spanning on two lines and aligned perfectly + * spanning one more line alined perfectly + * spanning another line with more margin + * @param c this is info about b + * not aligned text about parameter will eat only one space + */ +function jsDocCommentAlignmentTest3(a: string, b, c) { +} +jsDocCommentAlignmentTest3(/*47*/"hello",/*48*/1, /*49*/2); +/**/ +class NoQuickInfoClass { +}` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionDeclarationVS_test.go b/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionDeclarationVS_test.go new file mode 100644 index 000000000..49b2792b5 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionDeclarationVS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpCommentsFunctionDeclarationVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** This comment should appear for foo*/ +function foo() { +} +foo(/*4*/); +/** This is comment for function signature*/ +function fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; +} +fooWithParameters(/*10*/"a",/*11*/10); +/** +* Does something +* @param a a string +*/ +declare function fn(a: string); +fn(/*12*/"hello");` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionExpressionVS_test.go b/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionExpressionVS_test.go new file mode 100644 index 000000000..d3a0dc30e --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpCommentsFunctionExpressionVS_test.go @@ -0,0 +1,43 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpCommentsFunctionExpressionVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** lambdaFoo var comment*/ +var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +lambdaFoo(/*5*/10, /*6*/20); +function anotherFunc(a: number) { + /** documentation + @param b {string} inner parameter */ + var lambdaVar = /** inner docs */(b: string) => { + var localVar = "Hello "; + return localVar + b; + } + return lambdaVar("World") + a; +} +/** + * On variable + * @param s the first parameter! + * @returns the parameter's length + */ +var assigned = /** + * Summary on expression + * @param s param on expression + * @returns return on expression + */function(/** On parameter */s: string) { + return s.length; +} +assigned(/*18*/"hey");` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpConstructorCallParamPropertiesVS_test.go b/pkg/fourslash/tests/manual/signatureHelpConstructorCallParamPropertiesVS_test.go new file mode 100644 index 000000000..bd28b55e4 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpConstructorCallParamPropertiesVS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpConstructorCallParamPropertiesVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `class Circle { + /** + * Initialize a circle. + * @param radius The radius of the circle. + */ + constructor(private radius: number) { + } +} +var a = new Circle(/**/` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpExpandedRestTuplesLocalLabels1VS_test.go b/pkg/fourslash/tests/manual/signatureHelpExpandedRestTuplesLocalLabels1VS_test.go new file mode 100644 index 000000000..a9dfc4f79 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpExpandedRestTuplesLocalLabels1VS_test.go @@ -0,0 +1,80 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpExpandedRestTuplesLocalLabels1VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `interface AppleInfo { + color: "green" | "red"; +} + +interface BananaInfo { + curvature: number; +} + +type FruitAndInfo1 = ["apple", AppleInfo] | ["banana", BananaInfo]; + +function logFruitTuple1(...[fruit, info]: FruitAndInfo1) {} +logFruitTuple1(/*1*/); + +function logFruitTuple2(...[, info]: FruitAndInfo1) {} +logFruitTuple2(/*2*/); +logFruitTuple2("apple", /*3*/); + +function logFruitTuple3(...[fruit, ...rest]: FruitAndInfo1) {} +logFruitTuple3(/*4*/); +logFruitTuple3("apple", /*5*/); +function logFruitTuple4(...[fruit, ...[info]]: FruitAndInfo1) {} +logFruitTuple4(/*6*/); +logFruitTuple4("apple", /*7*/); + +type FruitAndInfo2 = ["apple", ...AppleInfo[]] | ["banana", ...BananaInfo[]]; + +function logFruitTuple5(...[fruit, firstInfo]: FruitAndInfo2) {} +logFruitTuple5(/*8*/); +logFruitTuple5("apple", /*9*/); + +function logFruitTuple6(...[fruit, ...fruitInfo]: FruitAndInfo2) {} +logFruitTuple6(/*10*/); +logFruitTuple6("apple", /*11*/); + +type FruitAndInfo3 = ["apple", ...AppleInfo[], number] | ["banana", ...BananaInfo[], number]; + +function logFruitTuple7(...[fruit, fruitInfoOrNumber, secondFruitInfoOrNumber]: FruitAndInfo3) {} +logFruitTuple7(/*12*/); +logFruitTuple7("apple", /*13*/); +logFruitTuple7("apple", { color: "red" }, /*14*/); + +function logFruitTuple8(...[fruit, , secondFruitInfoOrNumber]: FruitAndInfo3) {} +logFruitTuple8(/*15*/); +logFruitTuple8("apple", /*16*/); +logFruitTuple8("apple", { color: "red" }, /*17*/); + +function logFruitTuple9(...[...[fruit, fruitInfoOrNumber, secondFruitInfoOrNumber]]: FruitAndInfo3) {} +logFruitTuple9(/*18*/); +logFruitTuple9("apple", /*19*/); +logFruitTuple9("apple", { color: "red" }, /*20*/); + +function logFruitTuple10(...[fruit, {}, secondFruitInfoOrNumber]: FruitAndInfo3) {} +logFruitTuple10(/*21*/); +logFruitTuple10("apple", /*22*/); +logFruitTuple10("apple", { color: "red" }, /*23*/); + +function logFruitTuple11(...{}: FruitAndInfo3) {} +logFruitTuple11(/*24*/); +logFruitTuple11("apple", /*25*/); +logFruitTuple11("apple", { color: "red" }, /*26*/); +function withPair(...[first, second]: [number, named: string]) {} +withPair(/*27*/); +withPair(101, /*28*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpInferenceJsDocImportTagVS_test.go b/pkg/fourslash/tests/manual/signatureHelpInferenceJsDocImportTagVS_test.go new file mode 100644 index 000000000..cfa46fd05 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpInferenceJsDocImportTagVS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpInferenceJsDocImportTagVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJS: true +// @checkJs: true +// @module: esnext +// @filename: a.ts +export interface Foo {} +// @filename: b.js +/** + * @import { + * Foo + * } from './a' + */ + +/** + * @param {Foo} a + */ +function foo(a) {} +foo(/**/)` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpIteratorNextVS_test.go b/pkg/fourslash/tests/manual/signatureHelpIteratorNextVS_test.go new file mode 100644 index 000000000..8c67a37d4 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpIteratorNextVS_test.go @@ -0,0 +1,37 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpIteratorNextVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @lib: esnext +declare const iterator: Iterator; + +iterator.next(/*1*/); +iterator.next(/*2*/ 0); + +declare const generator: Generator; + +generator.next(/*3*/); +generator.next(/*4*/ 0); + +declare const asyncIterator: AsyncIterator; + +asyncIterator.next(/*5*/); +asyncIterator.next(/*6*/ 0); + +declare const asyncGenerator: AsyncGenerator; + +asyncGenerator.next(/*7*/); +asyncGenerator.next(/*8*/ 0);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpJSDocCallbackTagVS_test.go b/pkg/fourslash/tests/manual/signatureHelpJSDocCallbackTagVS_test.go new file mode 100644 index 000000000..ebff6fa48 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpJSDocCallbackTagVS_test.go @@ -0,0 +1,42 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpJSDocCallbackTagVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @lib: es5 +// @allowNonTsExtensions: true +// @Filename: jsdocCallbackTag.js +/** + * @callback FooHandler - A kind of magic + * @param {string} eventName - So many words + * @param eventName2 {number | string} - Silence is golden + * @param eventName3 - Osterreich mos def + * @return {number} - DIVEKICK + */ +/** + * @type {FooHandler} callback + */ +var t; + +/** + * @callback FooHandler2 - What, another one? + * @param {string=} eventName - it keeps happening + * @param {string} [eventName2] - i WARNED you dog + */ +/** + * @type {FooHandler2} callback + */ +var t2; +t(/*4*/"!", /*5*/12, /*6*/false);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpJSDocTagsVS_test.go b/pkg/fourslash/tests/manual/signatureHelpJSDocTagsVS_test.go new file mode 100644 index 000000000..79969b084 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpJSDocTagsVS_test.go @@ -0,0 +1,75 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpJSDocTagsVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** + * This is class Foo. + * @mytag comment1 comment2 + */ +class Foo { + /** + * This is the constructor. + * @myjsdoctag this is a comment + */ + constructor(value: number) {} + /** + * method1 documentation + * @mytag comment1 comment2 + */ + static method1() {} + /** + * @mytag + */ + method2() {} + /** + * @mytag comment1 comment2 + */ + property1: string; + /** + * @mytag1 some comments + * some more comments about mytag1 + * @mytag2 + * here all the comments are on a new line + * @mytag3 + * @mytag + */ + property2: number; + /** + * @returns {number} a value + */ + method3(): number { return 3; } + /** + * @param {string} foo A value. + * @returns {number} Another value + * @mytag + */ + method4(foo: string): number { return 3; } + /** @mytag */ + method5() {} + /** method documentation + * @mytag a JSDoc tag + */ + newMethod() {} +} +var foo = new Foo(/*10*/4); +Foo.method1(/*11*/); +foo.method2(/*12*/); +foo.method3(/*13*/); +foo.method4(); +foo.property1; +foo.property2; +foo.method5(); +foo.newMet` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpJSMissingPropertyAccessVS_test.go b/pkg/fourslash/tests/manual/signatureHelpJSMissingPropertyAccessVS_test.go new file mode 100644 index 000000000..9675be15e --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpJSMissingPropertyAccessVS_test.go @@ -0,0 +1,21 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpJSMissingPropertyAccessVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @allowJs: true +// @checkJs: true +// @Filename: test.js +foo.filter(/**/)` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpRestArgs1VS_test.go b/pkg/fourslash/tests/manual/signatureHelpRestArgs1VS_test.go new file mode 100644 index 000000000..aadacab36 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpRestArgs1VS_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/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpRestArgs1VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function fn(a: number, b: number, c: number) {} +const a = [1, 2] as const; +const b = [1] as const; + +fn(...a, /*1*/); +fn(/*2*/, ...a); + +fn(...b, /*3*/); +fn(/*4*/, ...b, /*5*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpRestArgs2VS_test.go b/pkg/fourslash/tests/manual/signatureHelpRestArgs2VS_test.go new file mode 100644 index 000000000..121ffc1d5 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpRestArgs2VS_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpRestArgs2VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @strict: true +// @allowJs: true +// @checkJs: true +// @filename: index.js +const promisify = function (thisArg, fnName) { + const fn = thisArg[fnName]; + return function () { + return new Promise((resolve) => { + fn.call(thisArg, ...arguments, /*1*/); + }); + }; +};` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpRestArgs3VS_test.go b/pkg/fourslash/tests/manual/signatureHelpRestArgs3VS_test.go new file mode 100644 index 000000000..e68bd7098 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpRestArgs3VS_test.go @@ -0,0 +1,20 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpRestArgs3VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `// @target: esnext +// @lib: esnext +const layers = Object.assign({}, /*1*/...[]);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpSkippedArgs1VS_test.go b/pkg/fourslash/tests/manual/signatureHelpSkippedArgs1VS_test.go new file mode 100644 index 000000000..1acb828d3 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpSkippedArgs1VS_test.go @@ -0,0 +1,19 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpSkippedArgs1VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function fn(a: number, b: number, c: number) {} +fn(/*1*/, /*2*/, /*3*/, /*4*/, /*5*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/signatureHelpTypeArguments2VS_test.go b/pkg/fourslash/tests/manual/signatureHelpTypeArguments2VS_test.go new file mode 100644 index 000000000..7ff143a72 --- /dev/null +++ b/pkg/fourslash/tests/manual/signatureHelpTypeArguments2VS_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestSignatureHelpTypeArguments2VS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `/** some documentation + * @template T some documentation 2 + * @template W + * @template U,V others + * @param a ok + * @param b not ok + */ +function f(a: number, b: string, c: boolean): void { } +f string) | ((y: number) => number)) => void; +declare const b: (x: string | number) => void; + +interface Callback { + (x: string): string; + (x: number): number; + (x: string | number): string | number; +} +declare function c(callback: Callback): void; +a((/*1*/) => { + return undefined; +}); + +b(/*2*/); + +c((/*3*/) => {});` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/fourslash/tests/manual/trailingCommaSignatureHelpVS_test.go b/pkg/fourslash/tests/manual/trailingCommaSignatureHelpVS_test.go new file mode 100644 index 000000000..721bbb97f --- /dev/null +++ b/pkg/fourslash/tests/manual/trailingCommaSignatureHelpVS_test.go @@ -0,0 +1,29 @@ +package fourslash_test + +import ( + "testing" + + "github.com/buke/typescript-go-internal/pkg/fourslash" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/testutil" +) + +func TestTrailingCommaSignatureHelpVS(t *testing.T) { + t.Parallel() + defer testutil.RecoverAndFail(t, "Panic on fourslash test") + const content = `function str(n: number): string; +/** + * Stringifies a number with radix + * @param radix The radix + */ +function str(n: number, radix: number): string; +function str(n: number, radix?: number): string { return ""; } + +str(1, /*a*/) + +declare function f(a: T): T; +f(2, /*b*/);` + f, done := fourslash.NewFourslash(t, &lsproto.ClientCapabilities{VSSupportsVisualStudioExtensions: new(true)}, content) + defer done() + f.VerifyBaselineSignatureHelp(t) +} diff --git a/pkg/ls/autoimport/fix.go b/pkg/ls/autoimport/fix.go index 6cf5e5560..8afc1fdce 100644 --- a/pkg/ls/autoimport/fix.go +++ b/pkg/ls/autoimport/fix.go @@ -1288,14 +1288,20 @@ func getModuleSpecifierText(promotedDeclaration *ast.Node) string { importEqualsDeclaration := promotedDeclaration.AsImportEqualsDeclaration() if ast.IsExternalModuleReference(importEqualsDeclaration.ModuleReference) { expr := importEqualsDeclaration.ModuleReference.Expression() - if expr != nil && expr.Kind == ast.KindStringLiteral { - return expr.Text() + if expr != nil { + if ast.IsStringLiteralLike(expr) { + return expr.Text() + } + return scanner.GetTextOfNode(expr) } - } - return importEqualsDeclaration.ModuleReference.Text() + return scanner.GetTextOfNode(importEqualsDeclaration.ModuleReference) + } + moduleSpecifier := promotedDeclaration.Parent.ModuleSpecifier() + if ast.IsStringLiteralLike(moduleSpecifier) { + return moduleSpecifier.Text() } - return promotedDeclaration.Parent.ModuleSpecifier().Text() + return scanner.GetTextOfNode(moduleSpecifier) } // returns `-1` if `a` is better than `b` diff --git a/pkg/ls/displaypartswriter.go b/pkg/ls/displaypartswriter.go new file mode 100644 index 000000000..40e6602b0 --- /dev/null +++ b/pkg/ls/displaypartswriter.go @@ -0,0 +1,217 @@ +package ls + +import ( + "strings" + "unicode/utf8" + + "github.com/buke/typescript-go-internal/pkg/ast" + "github.com/buke/typescript-go-internal/pkg/core" + "github.com/buke/typescript-go-internal/pkg/lsp/lsproto" + "github.com/buke/typescript-go-internal/pkg/printer" + "github.com/buke/typescript-go-internal/pkg/stringutil" +) + +var _ printer.EmitTextWriter = &displayPartsWriter{} + +// displayPartsWriter implements EmitTextWriter and captures classified text runs +// for VS colorized labels, while also building a plain string. +// When vsCapability is false, only the plain string is built; runs are skipped. +type displayPartsWriter struct { + builder strings.Builder + runs []*lsproto.ClassifiedTextRun + vsCapability bool + lastWritten string +} + +func newDisplayPartsWriter(vsCapability bool) *displayPartsWriter { + return &displayPartsWriter{vsCapability: vsCapability} +} + +func (w *displayPartsWriter) addRun(classification lsproto.ClassificationTypeName, text string) { + if text == "" { + return + } + if w.vsCapability { + w.runs = append(w.runs, &lsproto.ClassifiedTextRun{ + ClassificationTypeName: string(classification), + Text: text, + }) + } + w.lastWritten = text + w.builder.WriteString(text) +} + +// WriteClassified writes text with an explicit classification type. +func (w *displayPartsWriter) WriteClassified(text string, classification lsproto.ClassificationTypeName) { + w.addRun(classification, text) +} + +// WriteFrom copies the accumulated content from another displayPartsWriter. +func (w *displayPartsWriter) WriteFrom(other *displayPartsWriter) { + w.builder.WriteString(other.String()) + if w.vsCapability { + w.runs = append(w.runs, other.GetRuns()...) + } + if other.lastWritten != "" { + w.lastWritten = other.lastWritten + } +} + +func (w *displayPartsWriter) GetRuns() []*lsproto.ClassifiedTextRun { + return w.runs +} + +func (w *displayPartsWriter) String() string { + return w.builder.String() +} + +func (w *displayPartsWriter) Clear() { + w.lastWritten = "" + w.builder.Reset() + w.runs = nil +} + +func (w displayPartsWriter) DecreaseIndent() {} + +func (w displayPartsWriter) GetColumn() core.UTF16Offset { return 0 } + +func (w displayPartsWriter) GetIndent() int { return 0 } + +func (w displayPartsWriter) GetLine() int { return 0 } + +func (w displayPartsWriter) GetTextPos() int { + return w.builder.Len() +} + +func (w displayPartsWriter) HasTrailingComment() bool { return false } + +func (w displayPartsWriter) HasTrailingWhitespace() bool { + if w.builder.Len() == 0 { + return false + } + ch, _ := utf8.DecodeLastRuneInString(w.lastWritten) + if ch == utf8.RuneError { + return false + } + return stringutil.IsWhiteSpaceLike(ch) +} + +func (w displayPartsWriter) IncreaseIndent() {} + +func (w displayPartsWriter) IsAtStartOfLine() bool { return false } + +func (w *displayPartsWriter) RawWrite(s string) { + w.addRun(lsproto.ClassificationTypeNameText, s) +} + +func (w *displayPartsWriter) Write(s string) { + w.addRun(lsproto.ClassificationTypeNameText, s) +} + +func (w *displayPartsWriter) WriteComment(text string) { + // Strada's writeComment uses unknownWrite → SymbolDisplayPartKind.text → "text" + w.addRun(lsproto.ClassificationTypeNameText, text) +} + +func (w *displayPartsWriter) WriteKeyword(text string) { + w.addRun(lsproto.ClassificationTypeNameKeyword, text) +} + +func (w *displayPartsWriter) WriteLine() { + w.addRun(lsproto.ClassificationTypeNameWhiteSpace, " ") +} + +func (w *displayPartsWriter) WriteLineForce(force bool) { + w.addRun(lsproto.ClassificationTypeNameWhiteSpace, " ") +} + +func (w *displayPartsWriter) WriteLiteral(s string) { + // Strada's writeLiteral → SymbolDisplayPartKind.stringLiteral → "string" + w.addRun(lsproto.ClassificationTypeNameString, s) +} + +func (w *displayPartsWriter) WriteOperator(text string) { + w.addRun(lsproto.ClassificationTypeNameOperator, text) +} + +func (w *displayPartsWriter) WriteParameter(text string) { + w.addRun(lsproto.ClassificationTypeNameParameterName, text) +} + +func (w *displayPartsWriter) WriteProperty(text string) { + w.addRun(lsproto.ClassificationTypeNamePropertyName, text) +} + +func (w *displayPartsWriter) WritePunctuation(text string) { + w.addRun(lsproto.ClassificationTypeNamePunctuation, text) +} + +func (w *displayPartsWriter) WriteSpace(text string) { + w.addRun(lsproto.ClassificationTypeNameWhiteSpace, text) +} + +func (w *displayPartsWriter) WriteStringLiteral(text string) { + w.addRun(lsproto.ClassificationTypeNameString, text) +} + +func (w *displayPartsWriter) WriteSymbol(text string, symbol *ast.Symbol) { + classification := classificationForSymbol(symbol) + w.addRun(classification, text) +} + +func (w *displayPartsWriter) WriteTrailingSemicolon(text string) { + w.addRun(lsproto.ClassificationTypeNamePunctuation, text) +} + +// classificationForSymbol determines the Roslyn classification type name based on a symbol's flags. +// Matches the Strada translation chain: displayPartKind() → GetClassificationName(). +func classificationForSymbol(symbol *ast.Symbol) lsproto.ClassificationTypeName { + if symbol == nil { + return lsproto.ClassificationTypeNameText + } + flags := symbol.Flags + switch { + case flags&ast.SymbolFlagsVariable != 0: + if isFirstDeclarationOfSymbolParameter(symbol) { + return lsproto.ClassificationTypeNameParameterName + } + return lsproto.ClassificationTypeNameLocalName + case flags&ast.SymbolFlagsProperty != 0: + return lsproto.ClassificationTypeNamePropertyName + case flags&ast.SymbolFlagsGetAccessor != 0: + return lsproto.ClassificationTypeNamePropertyName + case flags&ast.SymbolFlagsSetAccessor != 0: + return lsproto.ClassificationTypeNamePropertyName + case flags&ast.SymbolFlagsEnumMember != 0: + return lsproto.ClassificationTypeNameFieldName + case flags&ast.SymbolFlagsFunction != 0: + return lsproto.ClassificationTypeNameMethodName + case flags&ast.SymbolFlagsClass != 0: + return lsproto.ClassificationTypeNameClassName + case flags&ast.SymbolFlagsInterface != 0: + return lsproto.ClassificationTypeNameInterfaceName + case flags&ast.SymbolFlagsEnum != 0: + return lsproto.ClassificationTypeNameEnumName + case flags&ast.SymbolFlagsModule != 0: + return lsproto.ClassificationTypeNameModuleName + case flags&ast.SymbolFlagsMethod != 0: + return lsproto.ClassificationTypeNameMethodName + case flags&ast.SymbolFlagsTypeParameter != 0: + return lsproto.ClassificationTypeNameTypeParameterName + case flags&ast.SymbolFlagsTypeAlias != 0: + return lsproto.ClassificationTypeNameIdentifier + case flags&ast.SymbolFlagsAlias != 0: + return lsproto.ClassificationTypeNameIdentifier + default: + return lsproto.ClassificationTypeNameText + } +} + +// isFirstDeclarationOfSymbolParameter checks if the symbol's first declaration is a parameter. +func isFirstDeclarationOfSymbolParameter(symbol *ast.Symbol) bool { + declarations := symbol.Declarations + if len(declarations) == 0 { + return false + } + return declarations[0].Kind == ast.KindParameter +} diff --git a/pkg/ls/signaturehelp.go b/pkg/ls/signaturehelp.go index f6fbca855..218e8c5ba 100644 --- a/pkg/ls/signaturehelp.go +++ b/pkg/ls/signaturehelp.go @@ -276,6 +276,7 @@ func (l *LanguageService) findSignatureHelpFromNamedDeclarations(ctx context.Con func (l *LanguageService) createSignatureHelpItems(ctx context.Context, candidates []*checker.Signature, resolvedSignature *checker.Signature, argumentInfo *argumentListInfo, sourceFile *ast.SourceFile, c *checker.Checker, useFullPrefix bool) *lsproto.SignatureHelp { caps := lsproto.GetClientCapabilities(ctx) docFormat := lsproto.PreferredMarkupKind(caps.TextDocument.SignatureHelp.SignatureInformation.DocumentationFormat) + vsCapability := caps.VSSupportsVisualStudioExtensions enclosingDeclaration := getEnclosingDeclarationFromInvocation(argumentInfo.invocation) if enclosingDeclaration == nil { @@ -301,7 +302,7 @@ func (l *LanguageService) createSignatureHelpItems(ctx context.Context, candidat } items := make([][]signatureInformation, len(candidates)) for i, candidateSignature := range candidates { - items[i] = l.getSignatureHelpItem(candidateSignature, argumentInfo.isTypeParameterList, callTargetDisplayParts.String(), enclosingDeclaration, sourceFile, c, docFormat) + items[i] = l.getSignatureHelpItem(candidateSignature, argumentInfo.isTypeParameterList, callTargetDisplayParts.String(), callTargetSymbol, enclosingDeclaration, sourceFile, c, docFormat, vsCapability) } selectedItemIndex := 0 @@ -360,6 +361,13 @@ func (l *LanguageService) createSignatureHelpItems(ctx context.Context, candidat Parameters: ¶meters, } + // Set VS-specific colorized label if we have classified runs + if len(item.ColorizedRuns) > 0 { + sigInfo.VSColorizedLabel = &lsproto.ClassifiedTextElement{ + Runs: item.ColorizedRuns, + } + } + // If client supports per-signature activeParameter, set it on each SignatureInformation if supportsPerSignatureActiveParam { sigInfo.ActiveParameter = l.computeActiveParameter(item, argumentInfo.argumentIndex, supportsNullActiveParam) @@ -414,15 +422,15 @@ func (l *LanguageService) computeActiveParameter(sig signatureInformation, argum return &lsproto.UintegerOrNull{Uinteger: new(activeParam)} } -func (l *LanguageService) getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool, callTargetSymbol string, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, c *checker.Checker, docFormat lsproto.MarkupKind) []signatureInformation { +func (l *LanguageService) getSignatureHelpItem(candidate *checker.Signature, isTypeParameterList bool, callTargetSymbol string, callTargetSym *ast.Symbol, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, c *checker.Checker, docFormat lsproto.MarkupKind, vsCapability bool) []signatureInformation { var infos []*signatureHelpItemInfo if isTypeParameterList { - infos = l.itemInfoForTypeParameters(candidate, c, enclosingDeclaration, sourceFile, docFormat) + infos = l.itemInfoForTypeParameters(candidate, c, enclosingDeclaration, sourceFile, docFormat, vsCapability) } else { - infos = l.itemInfoForParameters(candidate, c, enclosingDeclaration, sourceFile, docFormat) + infos = l.itemInfoForParameters(candidate, c, enclosingDeclaration, sourceFile, docFormat, vsCapability) } - suffixDisplayParts := returnTypeToDisplayParts(candidate, c) + suffixDpw := returnTypeToDisplayParts(candidate, c, enclosingDeclaration, sourceFile, vsCapability) // Generate documentation from the signature's declaration var documentation *string @@ -435,34 +443,53 @@ func (l *LanguageService) getSignatureHelpItem(candidate *checker.Signature, isT result := make([]signatureInformation, len(infos)) for i, info := range infos { - var display strings.Builder - display.WriteString(callTargetSymbol) - display.WriteString(info.displayParts) - display.WriteString(suffixDisplayParts) + labelDpw := newDisplayPartsWriter(vsCapability) + if callTargetSymbol != "" { + labelDpw.WriteSymbol(callTargetSymbol, callTargetSym) + } + labelDpw.WriteFrom(info.writer) + labelDpw.WriteFrom(suffixDpw) + result[i] = signatureInformation{ - Label: display.String(), + Label: labelDpw.String(), Documentation: documentation, Parameters: info.parameters, IsVariadic: info.isVariadic, + ColorizedRuns: labelDpw.GetRuns(), } } return result } -func returnTypeToDisplayParts(candidateSignature *checker.Signature, c *checker.Checker) string { - var returnType strings.Builder - returnType.WriteString(": ") +func returnTypeToDisplayParts(candidateSignature *checker.Signature, c *checker.Checker, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, vsCapability bool) *displayPartsWriter { + dpw := newDisplayPartsWriter(vsCapability) + + // Add ": " prefix + dpw.WritePunctuation(":") + dpw.WriteSpace(" ") + predicate := c.GetTypePredicateOfSignature(candidateSignature) if predicate != nil { - returnType.WriteString(c.TypePredicateToString(predicate)) + dpw.Write(c.TypePredicateToString(predicate)) } else { - returnType.WriteString(c.TypeToString(c.GetReturnTypeOfSignature(candidateSignature))) + returnType := c.GetReturnTypeOfSignature(candidateSignature) + typeNode := c.TypeToTypeNode(returnType, enclosingDeclaration, signatureHelpNodeBuilderFlags, nil) + if typeNode != nil { + p := printer.NewPrinter(printer.PrinterOptions{NewLine: core.NewLineKindLF}, printer.PrintHandlers{}, printer.NewEmitContext()) + // Use a temporary writer for p.Write since the printer calls Clear() on its writer + tempDpw := newDisplayPartsWriter(vsCapability) + p.Write(typeNode, sourceFile, tempDpw, nil) + dpw.WriteFrom(tempDpw) + } else { + dpw.Write(c.TypeToString(returnType)) + } } - return returnType.String() + return dpw } -func (l *LanguageService) itemInfoForTypeParameters(candidateSignature *checker.Signature, c *checker.Checker, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, docFormat lsproto.MarkupKind) []*signatureHelpItemInfo { - printer := printer.NewPrinter(printer.PrinterOptions{NewLine: core.NewLineKindLF}, printer.PrintHandlers{}, nil) +func (l *LanguageService) itemInfoForTypeParameters(candidateSignature *checker.Signature, c *checker.Checker, enclosingDeclaration *ast.Node, sourceFile *ast.SourceFile, docFormat lsproto.MarkupKind, vsCapability bool) []*signatureHelpItemInfo { + emitContext := printer.NewEmitContext() + p := printer.NewPrinter(printer.PrinterOptions{NewLine: core.NewLineKindLF}, printer.PrintHandlers{}, emitContext) var typeParameters []*checker.Type if candidateSignature.Target() != nil { @@ -472,82 +499,105 @@ func (l *LanguageService) itemInfoForTypeParameters(candidateSignature *checker. } signatureHelpTypeParameters := make([]signatureHelpParameter, len(typeParameters)) for i, typeParameter := range typeParameters { - signatureHelpTypeParameters[i] = createSignatureHelpParameterForTypeParameter(typeParameter, sourceFile, enclosingDeclaration, c, printer) + signatureHelpTypeParameters[i] = createSignatureHelpParameterForTypeParameter(typeParameter, sourceFile, enclosingDeclaration, c, p) } thisParameter := []signatureHelpParameter{} if candidateSignature.ThisParameter() != nil { - thisParameter = []signatureHelpParameter{l.createSignatureHelpParameterForParameter(candidateSignature.ThisParameter(), enclosingDeclaration, printer, sourceFile, c, docFormat)} + thisParameter = []signatureHelpParameter{l.createSignatureHelpParameterForParameter(candidateSignature.ThisParameter(), enclosingDeclaration, p, sourceFile, c, docFormat)} } // Creating type parameter display label - var displayParts strings.Builder - displayParts.WriteString(scanner.TokenToString(ast.KindLessThanToken)) + dpw := newDisplayPartsWriter(vsCapability) + + lessThanToken := scanner.TokenToString(ast.KindLessThanToken) + dpw.WritePunctuation(lessThanToken) for i, typeParameter := range signatureHelpTypeParameters { if i > 0 { - displayParts.WriteString(", ") + dpw.WritePunctuation(",") + dpw.WriteSpace(" ") } - displayParts.WriteString(*typeParameter.parameterInfo.Label.String) + label := *typeParameter.parameterInfo.Label.String + dpw.WriteClassified(label, lsproto.ClassificationTypeNameTypeParameterName) } - displayParts.WriteString(scanner.TokenToString(ast.KindGreaterThanToken)) + greaterThanToken := scanner.TokenToString(ast.KindGreaterThanToken) + dpw.WritePunctuation(greaterThanToken) // Creating display label for parameters like, (a: string, b: number) lists := c.GetExpandedParameters(candidateSignature, false) if len(lists) != 0 { - displayParts.WriteString(scanner.TokenToString(ast.KindOpenParenToken)) + openParen := scanner.TokenToString(ast.KindOpenParenToken) + dpw.WritePunctuation(openParen) } result := make([]*signatureHelpItemInfo, len(lists)) for i, parameterList := range lists { - var displayParameters strings.Builder - displayParameters.WriteString(displayParts.String()) + paramDpw := newDisplayPartsWriter(vsCapability) + paramDpw.WriteFrom(dpw) + parameters := thisParameter for j, param := range parameterList { - parameter := l.createSignatureHelpParameterForParameter(param, enclosingDeclaration, printer, sourceFile, c, docFormat) - parameters = append(parameters, parameter) + paramNode := checker.NewNodeBuilder(c, emitContext).SymbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags, nodebuilder.InternalFlagsNone, nil) + if j > 0 { - displayParameters.WriteString(", ") + paramDpw.WritePunctuation(",") + paramDpw.WriteSpace(" ") } - displayParameters.WriteString(*parameter.parameterInfo.Label.String) + // Use a temporary writer for p.Write since the printer calls Clear() on its writer + tempDpw := newDisplayPartsWriter(vsCapability) + p.Write(paramNode, sourceFile, tempDpw, nil) + paramLabel := tempDpw.String() + paramDpw.WriteFrom(tempDpw) + + parameter := l.createSignatureHelpParameterFromLabel(param, paramLabel, c, docFormat) + parameters = append(parameters, parameter) } - displayParameters.WriteString(scanner.TokenToString(ast.KindCloseParenToken)) + closeParen := scanner.TokenToString(ast.KindCloseParenToken) + paramDpw.WritePunctuation(closeParen) result[i] = &signatureHelpItemInfo{ - isVariadic: false, - parameters: signatureHelpTypeParameters, - displayParts: displayParameters.String(), + isVariadic: false, + parameters: signatureHelpTypeParameters, + writer: paramDpw, } } return result } -func (l *LanguageService) itemInfoForParameters(candidateSignature *checker.Signature, c *checker.Checker, enclosingDeclaratipn *ast.Node, sourceFile *ast.SourceFile, docFormat lsproto.MarkupKind) []*signatureHelpItemInfo { - printer := printer.NewPrinter(printer.PrinterOptions{NewLine: core.NewLineKindLF}, printer.PrintHandlers{}, nil) +func (l *LanguageService) itemInfoForParameters(candidateSignature *checker.Signature, c *checker.Checker, enclosingDeclaratipn *ast.Node, sourceFile *ast.SourceFile, docFormat lsproto.MarkupKind, vsCapability bool) []*signatureHelpItemInfo { + emitContext := printer.NewEmitContext() + p := printer.NewPrinter(printer.PrinterOptions{NewLine: core.NewLineKindLF}, printer.PrintHandlers{}, emitContext) signatureHelpTypeParameters := make([]signatureHelpParameter, len(candidateSignature.TypeParameters())) if len(candidateSignature.TypeParameters()) != 0 { for i, typeParameter := range candidateSignature.TypeParameters() { - signatureHelpTypeParameters[i] = createSignatureHelpParameterForTypeParameter(typeParameter, sourceFile, enclosingDeclaratipn, c, printer) + signatureHelpTypeParameters[i] = createSignatureHelpParameterForTypeParameter(typeParameter, sourceFile, enclosingDeclaratipn, c, p) } } // Creating display label for type parameters like, - var displayParts strings.Builder + dpw := newDisplayPartsWriter(vsCapability) + if len(signatureHelpTypeParameters) != 0 { - displayParts.WriteString(scanner.TokenToString(ast.KindLessThanToken)) + lessThanToken := scanner.TokenToString(ast.KindLessThanToken) + dpw.WritePunctuation(lessThanToken) for i, typeParameter := range signatureHelpTypeParameters { if i > 0 { - displayParts.WriteString(", ") + dpw.WritePunctuation(",") + dpw.WriteSpace(" ") } - displayParts.WriteString(*typeParameter.parameterInfo.Label.String) + label := *typeParameter.parameterInfo.Label.String + dpw.WriteClassified(label, lsproto.ClassificationTypeNameTypeParameterName) } - displayParts.WriteString(scanner.TokenToString(ast.KindGreaterThanToken)) + greaterThanToken := scanner.TokenToString(ast.KindGreaterThanToken) + dpw.WritePunctuation(greaterThanToken) } // Creating display parts for parameters. For example, (a: string, b: number) lists := c.GetExpandedParameters(candidateSignature, false) if len(lists) != 0 { - displayParts.WriteString(scanner.TokenToString(ast.KindOpenParenToken)) + openParen := scanner.TokenToString(ast.KindOpenParenToken) + dpw.WritePunctuation(openParen) } isVariadic := func(parameterList []*ast.Symbol) bool { @@ -563,32 +613,41 @@ func (l *LanguageService) itemInfoForParameters(candidateSignature *checker.Sign result := make([]*signatureHelpItemInfo, len(lists)) for i, parameterList := range lists { parameters := make([]signatureHelpParameter, len(parameterList)) - var displayParameters strings.Builder - displayParameters.WriteString(displayParts.String()) + paramDpw := newDisplayPartsWriter(vsCapability) + paramDpw.WriteFrom(dpw) + for j, param := range parameterList { - parameter := l.createSignatureHelpParameterForParameter(param, enclosingDeclaratipn, printer, sourceFile, c, docFormat) - parameters[j] = parameter + paramNode := checker.NewNodeBuilder(c, emitContext).SymbolToParameterDeclaration(param, enclosingDeclaratipn, signatureHelpNodeBuilderFlags, nodebuilder.InternalFlagsNone, nil) + if j > 0 { - displayParameters.WriteString(", ") + paramDpw.WritePunctuation(",") + paramDpw.WriteSpace(" ") } - displayParameters.WriteString(*parameter.parameterInfo.Label.String) + // Use a temporary writer for p.Write since the printer calls Clear() on its writer + tempDpw := newDisplayPartsWriter(vsCapability) + p.Write(paramNode, sourceFile, tempDpw, nil) + paramLabel := tempDpw.String() + paramDpw.WriteFrom(tempDpw) + + parameter := l.createSignatureHelpParameterFromLabel(param, paramLabel, c, docFormat) + parameters[j] = parameter } - displayParameters.WriteString(scanner.TokenToString(ast.KindCloseParenToken)) + closeParen := scanner.TokenToString(ast.KindCloseParenToken) + paramDpw.WritePunctuation(closeParen) result[i] = &signatureHelpItemInfo{ - isVariadic: isVariadic(parameterList), - parameters: parameters, - displayParts: displayParameters.String(), + isVariadic: isVariadic(parameterList), + parameters: parameters, + writer: paramDpw, } - } return result } const signatureHelpNodeBuilderFlags = nodebuilder.FlagsOmitParameterModifiers | nodebuilder.FlagsIgnoreErrors | nodebuilder.FlagsUseAliasDefinedOutsideCurrentScope -func (l *LanguageService) createSignatureHelpParameterForParameter(parameter *ast.Symbol, enclosingDeclaratipn *ast.Node, p *printer.Printer, sourceFile *ast.SourceFile, c *checker.Checker, docFormat lsproto.MarkupKind) signatureHelpParameter { - display := p.Emit(checker.NewNodeBuilder(c, printer.NewEmitContext()).SymbolToParameterDeclaration(parameter, enclosingDeclaratipn, signatureHelpNodeBuilderFlags, nodebuilder.InternalFlagsNone, nil), sourceFile) +// createSignatureHelpParameterFromLabel creates a signatureHelpParameter from a pre-computed label string. +func (l *LanguageService) createSignatureHelpParameterFromLabel(parameter *ast.Symbol, label string, c *checker.Checker, docFormat lsproto.MarkupKind) signatureHelpParameter { isOptional := parameter.CheckFlags&ast.CheckFlagsOptionalParameter != 0 isRest := parameter.CheckFlags&ast.CheckFlagsRestParameter != 0 var documentation *lsproto.StringOrMarkupContent @@ -605,7 +664,7 @@ func (l *LanguageService) createSignatureHelpParameterForParameter(parameter *as } return signatureHelpParameter{ parameterInfo: &lsproto.ParameterInformation{ - Label: lsproto.StringOrTuple{String: &display}, + Label: lsproto.StringOrTuple{String: &label}, Documentation: documentation, }, isRest: isRest, @@ -613,6 +672,11 @@ func (l *LanguageService) createSignatureHelpParameterForParameter(parameter *as } } +func (l *LanguageService) createSignatureHelpParameterForParameter(parameter *ast.Symbol, enclosingDeclaratipn *ast.Node, p *printer.Printer, sourceFile *ast.SourceFile, c *checker.Checker, docFormat lsproto.MarkupKind) signatureHelpParameter { + display := p.Emit(checker.NewNodeBuilder(c, printer.NewEmitContext()).SymbolToParameterDeclaration(parameter, enclosingDeclaratipn, signatureHelpNodeBuilderFlags, nodebuilder.InternalFlagsNone, nil), sourceFile) + return l.createSignatureHelpParameterFromLabel(parameter, display, c, docFormat) +} + func createSignatureHelpParameterForTypeParameter(t *checker.Type, sourceFile *ast.SourceFile, enclosingDeclaration *ast.Node, c *checker.Checker, p *printer.Printer) signatureHelpParameter { display := p.Emit(checker.NewNodeBuilder(c, printer.NewEmitContext()).TypeParameterToDeclaration(t, enclosingDeclaration, signatureHelpNodeBuilderFlags, nodebuilder.InternalFlagsNone, nil), sourceFile) return signatureHelpParameter{ @@ -638,12 +702,14 @@ type signatureInformation struct { Parameters []signatureHelpParameter // Needed only here, not in lsp IsVariadic bool + // Classified text runs for VS colorized label + ColorizedRuns []*lsproto.ClassifiedTextRun } type signatureHelpItemInfo struct { - isVariadic bool - parameters []signatureHelpParameter - displayParts string + isVariadic bool + parameters []signatureHelpParameter + writer *displayPartsWriter } type signatureHelpParameter struct { diff --git a/pkg/lsp/lsproto/_generate/generate.mts b/pkg/lsp/lsproto/_generate/generate.mts index f4e2e4a94..33b6c7bf3 100755 --- a/pkg/lsp/lsproto/_generate/generate.mts +++ b/pkg/lsp/lsproto/_generate/generate.mts @@ -464,6 +464,45 @@ const customStructures: Structure[] = [ ], documentation: "Parameters for the custom/textDocument/multiDocumentHighlight request.", }, + { + name: "ClassifiedTextRun", + properties: [ + { + name: "ClassificationTypeName", + type: { kind: "base", name: "string" }, + documentation: "The classification type name (e.g. 'keyword', 'class name', 'parameter name').", + }, + { + name: "Text", + type: { kind: "base", name: "string" }, + documentation: "The text content of this run.", + }, + { + name: "MarkerTagType", + type: { kind: "base", name: "string" }, + optional: true, + documentation: "Optional marker tag type.", + }, + { + name: "Style", + type: { kind: "base", name: "integer" }, + omitzeroValue: true, + documentation: "The style of this text run.", + }, + ], + documentation: "A classified text run with text and classification type, used for colorized display in VS.", + }, + { + name: "ClassifiedTextElement", + properties: [ + { + name: "Runs", + type: { kind: "array", element: { kind: "reference", name: "ClassifiedTextRun" } }, + documentation: "The classified text runs that make up this element.", + }, + ], + documentation: "A classified text element containing an array of classified text runs, used for colorized labels in VS.", + }, ]; const customEnumerations: Enumeration[] = [ @@ -514,9 +553,33 @@ const customEnumerations: Enumeration[] = [ { name: "NotAllowed", value: 4, documentation: "Import cannot be marked type-only." }, ], }, + { + name: "ClassificationTypeName", + type: { kind: "base", name: "string" }, + values: [ + { name: "Keyword", value: "keyword", documentation: "Language keyword (e.g., function, const, class)." }, + { name: "Punctuation", value: "punctuation", documentation: "Punctuation characters (e.g., parentheses, commas, semicolons)." }, + { name: "Operator", value: "operator", documentation: "Operators (e.g., =, +, ?)." }, + { name: "WhiteSpace", value: "whitespace", documentation: "Whitespace including spaces and line breaks." }, + { name: "Text", value: "text", documentation: "Plain text with no special classification." }, + { name: "String", value: "string", documentation: "String and literal values." }, + { name: "Number", value: "number", documentation: "Numeric literal values." }, + { name: "Comment", value: "comment", documentation: "Comment text." }, + { name: "ClassName", value: "class name", documentation: "Class names." }, + { name: "InterfaceName", value: "interface name", documentation: "Interface names." }, + { name: "EnumName", value: "enum name", documentation: "Enum names." }, + { name: "ModuleName", value: "module name", documentation: "Module/namespace names." }, + { name: "MethodName", value: "method name", documentation: "Method and function names." }, + { name: "ParameterName", value: "parameter name", documentation: "Parameter names." }, + { name: "PropertyName", value: "property name", documentation: "Property and accessor names." }, + { name: "FieldName", value: "field name", documentation: "Field names (e.g., enum members)." }, + { name: "LocalName", value: "local name", documentation: "Local variable names." }, + { name: "TypeParameterName", value: "type parameter name", documentation: "Type parameter names." }, + { name: "Identifier", value: "identifier", documentation: "General identifiers (e.g., type aliases, imports)." }, + ], + documentation: "Roslyn classification type names used by VS for syntax coloring in tooltips and other UI elements.", + }, ]; - -// Custom requests to add to the model (tsgo-specific) const customRequests: Request[] = [ { method: "custom/runGC", @@ -788,6 +851,16 @@ function patchAndPreprocessModel() { }); } + // Patch SignatureInformation to add VS-specific colorized label + if (structure.name === "SignatureInformation") { + structure.properties.push({ + name: "_vs_colorizedLabel", + type: { kind: "reference", name: "ClassifiedTextElement" }, + optional: true, + documentation: "A colorized label for the signature, providing classified text runs for VS syntax coloring.", + }); + } + // Patch ServerCapabilities to add custom tsgo capability flags if (structure.name === "ServerCapabilities") { structure.properties.push({ diff --git a/pkg/lsp/lsproto/lsp_generated.go b/pkg/lsp/lsproto/lsp_generated.go index 8eb4ac35b..38a2efe89 100644 --- a/pkg/lsp/lsproto/lsp_generated.go +++ b/pkg/lsp/lsproto/lsp_generated.go @@ -18625,6 +18625,9 @@ type SignatureInformation struct { // // Since: 3.16.0 ActiveParameter *UintegerOrNull `json:"activeParameter,omitzero"` + + // A colorized label for the signature, providing classified text runs for VS syntax coloring. + VSColorizedLabel *ClassifiedTextElement `json:"_vs_colorizedLabel,omitzero"` } var _ json.UnmarshalerFrom = (*SignatureInformation)(nil) @@ -18672,6 +18675,13 @@ func (s *SignatureInformation) UnmarshalJSONFrom(dec *json.Decoder) error { if err := json.UnmarshalDecode(dec, &s.ActiveParameter); err != nil { return err } + case `"_vs_colorizedLabel"`: + if dec.PeekKind() == 'n' { + return errNull("_vs_colorizedLabel") + } + if err := json.UnmarshalDecode(dec, &s.VSColorizedLabel); err != nil { + return err + } default: if err := dec.SkipValue(); err != nil { return err @@ -29573,6 +29583,148 @@ func (s *MultiDocumentHighlightParams) UnmarshalJSONFrom(dec *json.Decoder) erro return nil } +// A classified text run with text and classification type, used for colorized display in VS. +type ClassifiedTextRun struct { + // The classification type name (e.g. 'keyword', 'class name', 'parameter name'). + ClassificationTypeName string `json:"ClassificationTypeName"` + + // The text content of this run. + Text string `json:"Text"` + + // Optional marker tag type. + MarkerTagType *string `json:"MarkerTagType,omitzero"` + + // The style of this text run. + Style int32 `json:"Style,omitzero"` +} + +var _ json.UnmarshalerFrom = (*ClassifiedTextRun)(nil) + +func (s *ClassifiedTextRun) UnmarshalJSONFrom(dec *json.Decoder) error { + const ( + missingClassificationTypeName uint = 1 << iota + missingText + _missingLast + ) + missing := _missingLast - 1 + + if k := dec.PeekKind(); k != '{' { + return errNotObject(k) + } + if _, err := dec.ReadToken(); err != nil { + return err + } + + for dec.PeekKind() != '}' { + name, err := dec.ReadValue() + if err != nil { + return err + } + switch string(name) { + case `"ClassificationTypeName"`: + missing &^= missingClassificationTypeName + if err := json.UnmarshalDecode(dec, &s.ClassificationTypeName); err != nil { + return err + } + case `"Text"`: + missing &^= missingText + if err := json.UnmarshalDecode(dec, &s.Text); err != nil { + return err + } + case `"MarkerTagType"`: + if dec.PeekKind() == 'n' { + return errNull("MarkerTagType") + } + if err := json.UnmarshalDecode(dec, &s.MarkerTagType); err != nil { + return err + } + case `"Style"`: + if err := json.UnmarshalDecode(dec, &s.Style); err != nil { + return err + } + default: + if err := dec.SkipValue(); err != nil { + return err + } + } + } + + if _, err := dec.ReadToken(); err != nil { + return err + } + + if missing != 0 { + var missingProps []string + if missing&missingClassificationTypeName != 0 { + missingProps = append(missingProps, "ClassificationTypeName") + } + if missing&missingText != 0 { + missingProps = append(missingProps, "Text") + } + return errMissing(missingProps) + } + + return nil +} + +// A classified text element containing an array of classified text runs, used for colorized labels in VS. +type ClassifiedTextElement struct { + // The classified text runs that make up this element. + Runs []*ClassifiedTextRun `json:"Runs"` +} + +var _ json.UnmarshalerFrom = (*ClassifiedTextElement)(nil) + +func (s *ClassifiedTextElement) UnmarshalJSONFrom(dec *json.Decoder) error { + const ( + missingRuns uint = 1 << iota + _missingLast + ) + missing := _missingLast - 1 + + if k := dec.PeekKind(); k != '{' { + return errNotObject(k) + } + if _, err := dec.ReadToken(); err != nil { + return err + } + + for dec.PeekKind() != '}' { + name, err := dec.ReadValue() + if err != nil { + return err + } + switch string(name) { + case `"Runs"`: + missing &^= missingRuns + if dec.PeekKind() == 'n' { + return errNull("Runs") + } + if err := json.UnmarshalDecode(dec, &s.Runs); err != nil { + return err + } + default: + if err := dec.SkipValue(); err != nil { + return err + } + } + } + + if _, err := dec.ReadToken(); err != nil { + return err + } + + if missing != 0 { + var missingProps []string + if missing&missingRuns != 0 { + missingProps = append(missingProps, "Runs") + } + return errMissing(missingProps) + } + + return nil +} + // CallHierarchyItemData is a placeholder for custom data preserved on a CallHierarchyItem. type CallHierarchyItemData struct{} @@ -30801,6 +30953,50 @@ func (e AddAsTypeOnly) String() string { } } +// Roslyn classification type names used by VS for syntax coloring in tooltips and other UI elements. +type ClassificationTypeName string + +const ( + // Language keyword (e.g., function, const, class). + ClassificationTypeNameKeyword ClassificationTypeName = "keyword" + // Punctuation characters (e.g., parentheses, commas, semicolons). + ClassificationTypeNamePunctuation ClassificationTypeName = "punctuation" + // Operators (e.g., =, +, ?). + ClassificationTypeNameOperator ClassificationTypeName = "operator" + // Whitespace including spaces and line breaks. + ClassificationTypeNameWhiteSpace ClassificationTypeName = "whitespace" + // Plain text with no special classification. + ClassificationTypeNameText ClassificationTypeName = "text" + // String and literal values. + ClassificationTypeNameString ClassificationTypeName = "string" + // Numeric literal values. + ClassificationTypeNameNumber ClassificationTypeName = "number" + // Comment text. + ClassificationTypeNameComment ClassificationTypeName = "comment" + // Class names. + ClassificationTypeNameClassName ClassificationTypeName = "class name" + // Interface names. + ClassificationTypeNameInterfaceName ClassificationTypeName = "interface name" + // Enum names. + ClassificationTypeNameEnumName ClassificationTypeName = "enum name" + // Module/namespace names. + ClassificationTypeNameModuleName ClassificationTypeName = "module name" + // Method and function names. + ClassificationTypeNameMethodName ClassificationTypeName = "method name" + // Parameter names. + ClassificationTypeNameParameterName ClassificationTypeName = "parameter name" + // Property and accessor names. + ClassificationTypeNamePropertyName ClassificationTypeName = "property name" + // Field names (e.g., enum members). + ClassificationTypeNameFieldName ClassificationTypeName = "field name" + // Local variable names. + ClassificationTypeNameLocalName ClassificationTypeName = "local name" + // Type parameter names. + ClassificationTypeNameTypeParameterName ClassificationTypeName = "type parameter name" + // General identifiers (e.g., type aliases, imports). + ClassificationTypeNameIdentifier ClassificationTypeName = "identifier" +) + func unmarshalParams(method Method, data []byte) (any, error) { switch method { case MethodTextDocumentImplementation: diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index dcb9755ca..52bca2dd5 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -532,7 +532,7 @@ func (p *Parser) reparseTopLevelAwait(sourceFile *ast.SourceFile) *ast.Node { }) var diagnosticEnd int if diagnosticStart >= 0 { - diagnosticEnd = core.FindIndex(savedParseDiagnostics[:diagnosticStart], func(diagnostic *ast.Diagnostic) bool { + diagnosticEnd = core.FindIndex(savedParseDiagnostics[diagnosticStart:], func(diagnostic *ast.Diagnostic) bool { return diagnostic.Pos() >= nextStatement.Pos() }) } else { diff --git a/pkg/parser/reparser.go b/pkg/parser/reparser.go index 191f53008..538b9434b 100644 --- a/pkg/parser/reparser.go +++ b/pkg/parser/reparser.go @@ -135,6 +135,11 @@ func (p *Parser) reparseJSDocSignature(jsSignature *ast.Node, fun *ast.Node, jsD } } else if param.Kind == ast.KindJSDocParameterTag || param.Kind == ast.KindJSDocPropertyTag { jsparam := param.AsJSDocParameterOrPropertyTag() + // Skip sub-property parameters (e.g., @param x.y) - these have QualifiedNames + // and describe properties of a parent parameter, not standalone parameters. + if ast.IsQualifiedName(jsparam.Name()) { + continue + } var dotDotDotToken *ast.Node var paramType *ast.TypeNode @@ -179,6 +184,9 @@ func (p *Parser) reparseJSDocTypeLiteral(t *ast.TypeNode) *ast.Node { isArrayType := jstypeliteral.IsArrayType properties := p.nodeSliceArena.NewSlice(0) for _, prop := range jstypeliteral.JSDocPropertyTags { + if prop.Kind != ast.KindJSDocPropertyTag && prop.Kind != ast.KindJSDocParameterTag { + continue + } jsprop := prop.AsJSDocParameterOrPropertyTag() name := prop.Name() if name.Kind == ast.KindQualifiedName { @@ -415,7 +423,7 @@ func (p *Parser) reparseHosted(tag *ast.Node, parent *ast.Node, jsDoc *ast.Node) case ast.KindJSDocThisTag: if fun := getFunctionLikeHost(parent); fun != nil { params := fun.Parameters() - if len(params) == 0 || params[0].Name().Kind != ast.KindThisKeyword { + if len(params) == 0 || (params[0].Name().Kind != ast.KindThisKeyword && !ast.IsThisIdentifier(params[0].Name())) { thisParam := p.factory.NewParameterDeclaration( nil, /* decorators */ nil, /* modifiers */ diff --git a/pkg/printer/emitcontext.go b/pkg/printer/emitcontext.go index 96294be7e..0980c4094 100644 --- a/pkg/printer/emitcontext.go +++ b/pkg/printer/emitcontext.go @@ -943,11 +943,11 @@ func (c *EmitContext) VisitIterationBody(body *ast.Statement, visitor *ast.NodeV } func (c *EmitContext) VisitEmbeddedStatement(node *ast.Statement, visitor *ast.NodeVisitor) *ast.Statement { - embeddedStatement := visitor.VisitEmbeddedStatement(node) - if embeddedStatement == nil { + if node == nil { return nil } - if ast.IsNotEmittedStatement(embeddedStatement) { + embeddedStatement := visitor.VisitEmbeddedStatement(node) + if embeddedStatement == nil || ast.IsNotEmittedStatement(embeddedStatement) { emptyStatement := visitor.Factory.NewEmptyStatement() emptyStatement.Loc = node.Loc c.SetOriginal(emptyStatement, node) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 7dc9ae096..c5e656694 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -565,7 +565,7 @@ func (p *Printer) getSeparatingLineTerminatorCount(previousNode *ast.Node, nextN // JsxText will be written with its leading whitespace, so don't add more manually. return 0 } else if p.currentSourceFile != nil && !ast.NodeIsSynthesized(previousNode) && !ast.NodeIsSynthesized(nextNode) { - if p.Options.PreserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode) { + if p.Options.PreserveSourceNewlines && siblingNodePositionsAreComparable(p.emitContext, previousNode, nextNode) { return p.getEffectiveLines( func(includeComments bool) int { return getLinesBetweenRangeEndAndRangeStart( @@ -576,7 +576,7 @@ func (p *Printer) getSeparatingLineTerminatorCount(previousNode *ast.Node, nextN ) }, ) - } else if !p.Options.PreserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode) { + } else if !p.Options.PreserveSourceNewlines && originalNodesHaveSameParent(p.emitContext, previousNode, nextNode) { // If `preserveSourceNewlines` is `false` we do not intend to preserve the effective lines between the // previous and next node. Instead we naively check whether nodes are on separate lines within the // same node parent. If so, we intend to preserve a single line terminator. This is less precise and @@ -1962,12 +1962,27 @@ func (p *Printer) emitTypeLiteral(node *ast.TypeLiteralNode) { func (p *Printer) emitArrayType(node *ast.ArrayTypeNode) { state := p.enterNode(node.AsNode()) - p.emitTypeNode(node.ElementType, ast.TypePrecedencePostfix) + p.emitPostfixTypeOperand(node.ElementType, node.AsNode()) p.writePunctuation("[") p.writePunctuation("]") p.exitNode(node.AsNode(), state) } +// emitPostfixTypeOperand emits the operand of a postfix type (ArrayType, IndexedAccessType, +// OptionalType). It is equivalent to `emitTypeNode(operand, TypePrecedencePostfix)` except +// that it preserves a parsed `typeof X` operand without adding parentheses (e.g., +// `typeof C[K]` instead of `(typeof C)[K]`). TypeScript's `parenthesizeNonArrayTypeOfPostfixType` +// factory rule wraps `TypeQuery` in `ParenthesizedType` only when a postfix type is constructed +// via the factory, so parsed postfix types preserve the source as written during round-trip +// emit while synthesized postfix types (e.g., from declaration emit) still get the parentheses. +func (p *Printer) emitPostfixTypeOperand(operand *ast.TypeNode, parent *ast.Node) { + if ast.IsParseTreeNode(parent) && operand.Kind == ast.KindTypeQuery { + p.emitTypeNode(operand, ast.TypePrecedenceTypeOperator) + return + } + p.emitTypeNode(operand, ast.TypePrecedencePostfix) +} + func (p *Printer) emitTupleElementType(node *ast.Node) { p.emitTypeNodeOutsideExtends(node) } @@ -1991,7 +2006,7 @@ func (p *Printer) emitRestType(node *ast.RestTypeNode) { func (p *Printer) emitOptionalType(node *ast.OptionalTypeNode) { state := p.enterNode(node.AsNode()) // !!! May need extra parenthesization if we also have JSDocNullableType - p.emitTypeNode(node.Type, ast.TypePrecedencePostfix) + p.emitPostfixTypeOperand(node.Type, node.AsNode()) p.writePunctuation("?") p.exitNode(node.AsNode(), state) } @@ -2089,7 +2104,7 @@ func (p *Printer) emitTypeOperator(node *ast.TypeOperatorNode) { func (p *Printer) emitIndexedAccessType(node *ast.IndexedAccessTypeNode) { state := p.enterNode(node.AsNode()) - p.emitTypeNode(node.ObjectType, ast.TypePrecedencePostfix) + p.emitPostfixTypeOperand(node.ObjectType, node.AsNode()) p.writePunctuation("[") p.emitTypeNodeOutsideExtends(node.IndexType) p.writePunctuation("]") @@ -4390,7 +4405,7 @@ func (p *Printer) emitJsxAttributeValue(node *ast.JsxAttributeValue) { case ast.KindJsxFragment: p.emitJsxFragment(node.AsJsxFragment()) default: - panic(fmt.Sprintf("unhandled JsxAttributeValue: %v", node.Kind)) + p.emitExpression(node, ast.OperatorPrecedenceLowest) } } diff --git a/pkg/printer/utilities.go b/pkg/printer/utilities.go index 2eef38de4..cde061c0a 100644 --- a/pkg/printer/utilities.go +++ b/pkg/printer/utilities.go @@ -408,14 +408,13 @@ func getPreviousNonWhitespacePosition(pos int, stopPos int, sourceFile *ast.Sour return -1 } -func siblingNodePositionsAreComparable(previousNode *ast.Node, nextNode *ast.Node) bool { +func siblingNodePositionsAreComparable(emitContext *EmitContext, previousNode *ast.Node, nextNode *ast.Node) bool { if nextNode.Pos() < previousNode.End() { return false } - // TODO(rbuckton) - // previousNode = getOriginalNode(previousNode); - // nextNode = getOriginalNode(nextNode); + previousNode = emitContext.MostOriginal(previousNode) + nextNode = emitContext.MostOriginal(nextNode) parent := previousNode.Parent if parent == nil || parent != nextNode.Parent { return false @@ -554,12 +553,12 @@ func canHaveDecorators(node *ast.Node) bool { return false } -func originalNodesHaveSameParent(nodeA *ast.Node, nodeB *ast.Node) bool { - // TODO(rbuckton): nodeA = getOriginalNode(nodeA) +func originalNodesHaveSameParent(emitContext *EmitContext, nodeA *ast.Node, nodeB *ast.Node) bool { + nodeA = emitContext.MostOriginal(nodeA) if nodeA.Parent != nil { - // For performance, do not call `getOriginalNode` for `nodeB` if `nodeA` doesn't even + // For performance, do not call `MostOriginal` for `nodeB` if `nodeA` doesn't even // have a parent node. - // TODO(rbuckton): nodeB = getOriginalNode(nodeB) + nodeB = emitContext.MostOriginal(nodeB) return nodeA.Parent == nodeB.Parent } return false diff --git a/pkg/project/configfileregistrybuilder.go b/pkg/project/configfileregistrybuilder.go index ba9a9ecac..4cd8f88f4 100644 --- a/pkg/project/configfileregistrybuilder.go +++ b/pkg/project/configfileregistrybuilder.go @@ -706,7 +706,7 @@ func (c *configFileRegistryBuilder) GetCurrentDirectory() string { } // GetExtendedConfig implements tsoptions.ExtendedConfigCache. -func (c *configFileRegistryBuilder) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { +func (c *configFileRegistryBuilder) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []tspath.Path, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { var content string fh := c.fs.GetFileByPath(fileName, path) if fh != nil { diff --git a/pkg/project/extendedconfigcache.go b/pkg/project/extendedconfigcache.go index 774371f05..c6f09bb21 100644 --- a/pkg/project/extendedconfigcache.go +++ b/pkg/project/extendedconfigcache.go @@ -10,7 +10,7 @@ type ExtendedConfigParseArgs struct { FileName string Content string FS FileSource - ResolutionStack []string + ResolutionStack []tspath.Path Host tsoptions.ParseConfigHost Cache tsoptions.ExtendedConfigCache } diff --git a/pkg/scanner/scanner.go b/pkg/scanner/scanner.go index 750de375f..c1edac711 100644 --- a/pkg/scanner/scanner.go +++ b/pkg/scanner/scanner.go @@ -1796,12 +1796,23 @@ func (s *Scanner) scanEscapeSequence(flags EscapeSequenceScanningFlags) string { } fallthrough case '\n': - // case CharacterCodes.lineSeparator !!! - // case CharacterCodes.paragraphSeparator !!! return "" default: + // ch was read as a single byte; for multi-byte UTF-8 characters, + // we need to decode the full rune and advance past all its bytes. + if ch >= utf8.RuneSelf { + s.pos-- // back up past the single-byte advance + var size int + ch, size = utf8.DecodeRuneInString(s.text[s.pos:]) + s.pos += size + s.containsNonASCII = true + } + // LineContinuation: a backslash followed by a line terminator is "the empty code unit sequence". + if ch == '\u2028' || ch == '\u2029' { + return "" + } if flags&EscapeSequenceScanningFlagsAnyUnicodeMode != 0 || flags&EscapeSequenceScanningFlagsRegularExpression != 0 && flags&EscapeSequenceScanningFlagsAnnexB == 0 && IsIdentifierPart(ch) { - s.errorAt(diagnostics.This_character_cannot_be_escaped_in_a_regular_expression, s.pos-2, 2) + s.errorAt(diagnostics.This_character_cannot_be_escaped_in_a_regular_expression, start, s.pos-start) } return string(ch) } @@ -2278,6 +2289,9 @@ func SkipTriviaEx(text string, pos int, options *SkipTriviaOptions) int { canConsumeStar := false // Keep in sync with couldStartTrivia for { + if pos >= textLen { + return pos + } ch, size := utf8.DecodeRuneInString(text[pos:]) switch ch { case '\r': diff --git a/pkg/transformers/declarations/transform.go b/pkg/transformers/declarations/transform.go index 6bfe61feb..bff2d3578 100644 --- a/pkg/transformers/declarations/transform.go +++ b/pkg/transformers/declarations/transform.go @@ -988,15 +988,16 @@ func (tx *DeclarationTransformer) transformConstructSignatureDeclaration(input * func (tx *DeclarationTransformer) omitPrivateMethodType(input *ast.Node) *ast.Node { if input.Symbol() != nil && len(input.Symbol().Declarations) > 0 && input.Symbol().Declarations[0] != input { return nil - } else { - return tx.Factory().NewPropertyDeclaration( - tx.ensureModifiers(input), - input.Name(), - nil, - nil, - nil, - ) } + result := tx.Factory().NewPropertyDeclaration( + tx.ensureModifiers(input), + input.Name(), + nil, + nil, + nil, + ) + tx.preserveJsDoc(result, input) + return result } func (tx *DeclarationTransformer) transformMethodSignatureDeclaration(input *ast.MethodSignatureDeclaration) *ast.Node { @@ -2173,6 +2174,10 @@ func (tx *DeclarationTransformer) transformJSDocOptionalType(input *ast.JSDocOpt } func (tx *DeclarationTransformer) getNameExpressionPreferringIdentifier(nameExpr *ast.Node) *ast.Node { + if ast.IsNumericLiteral(nameExpr) { + // Numeric property names are string properties in JS; convert to string literal + nameExpr = tx.Factory().NewStringLiteral(nameExpr.Text(), ast.TokenFlagsNone) + } if ast.IsStringLiteralLike(nameExpr) && scanner.IsIdentifierText(nameExpr.Text(), core.LanguageVariantStandard) { result := tx.Factory().NewIdentifier(nameExpr.Text()) // prefer non-string literal names where possible kwKind := scanner.IdentifierToKeywordKind(result.AsIdentifier()) diff --git a/pkg/transformers/destructuring.go b/pkg/transformers/destructuring.go index 46e7077f9..b0e85a0a0 100644 --- a/pkg/transformers/destructuring.go +++ b/pkg/transformers/destructuring.go @@ -257,11 +257,17 @@ func (f *flattener) flattenDestructuringBinding(node *ast.Node, rval *ast.Node, if len(f.expressions) > 0 { temp := f.tx.Factory().NewTempVariable() - f.tx.EmitContext().AddVariableDeclaration(temp) - last := &f.declarations[len(f.declarations)-1] - last.pendingExpressions = append(last.pendingExpressions, f.tx.Factory().NewAssignmentExpression(temp, last.value)) - last.pendingExpressions = append(last.pendingExpressions, f.expressions...) - last.value = temp + if f.hoistTempVariables { + value := f.tx.Factory().InlineExpressions(f.expressions) + f.expressions = nil + f.emitBindingOrAssignment(f, temp, value, core.TextRange{}, nil) + } else { + f.tx.EmitContext().AddVariableDeclaration(temp) + last := &f.declarations[len(f.declarations)-1] + last.pendingExpressions = append(last.pendingExpressions, f.tx.Factory().NewAssignmentExpression(temp, last.value)) + last.pendingExpressions = append(last.pendingExpressions, f.expressions...) + last.value = temp + } } decls := make([]*ast.Node, 0, len(f.declarations)) diff --git a/pkg/transformers/estransforms/objectrestspread.go b/pkg/transformers/estransforms/objectrestspread.go index 6f40a00c8..c52f6d689 100644 --- a/pkg/transformers/estransforms/objectrestspread.go +++ b/pkg/transformers/estransforms/objectrestspread.go @@ -387,7 +387,7 @@ func (ch *objectRestSpreadTransformer) visitCatchClause(node *ast.CatchClause) * block := ch.Visitor().VisitNode(node.Block) if visitedBindings != nil { var decls []*ast.Node - if visitedBindings.Kind&ast.KindSyntaxList != 0 { + if visitedBindings.Kind == ast.KindSyntaxList { decls = visitedBindings.AsSyntaxList().Children } else { decls = []*ast.Node{visitedBindings} diff --git a/pkg/transformers/jsxtransforms/jsx.go b/pkg/transformers/jsxtransforms/jsx.go index b83eeac84..390a0eac9 100644 --- a/pkg/transformers/jsxtransforms/jsx.go +++ b/pkg/transformers/jsxtransforms/jsx.go @@ -877,6 +877,19 @@ func decodeEntities(text string) string { break } + // Skip past any intervening '&' characters between the current '&' + // and the ';'. Each such '&' is not part of a valid entity, so emit + // it (and any text before the next '&') as literals. + for { + nextAmp := strings.IndexByte(text[1:semi], '&') + if nextAmp < 0 { + break + } + result.WriteString(text[:nextAmp+1]) + text = text[nextAmp+1:] + semi -= nextAmp + 1 + } + entity := text[1:semi] decoded, ok := decodeEntity(entity) if ok { diff --git a/pkg/transformers/tstransforms/runtimesyntax.go b/pkg/transformers/tstransforms/runtimesyntax.go index 83ee5656f..5fb6bd9d1 100644 --- a/pkg/transformers/tstransforms/runtimesyntax.go +++ b/pkg/transformers/tstransforms/runtimesyntax.go @@ -676,7 +676,7 @@ func (tx *RuntimeSyntaxTransformer) visitClassDeclaration(node *ast.ClassDeclara } name := tx.Visitor().VisitNode(node.Name()) - if exported && name == nil { + if name == nil && (exported || ast.ChildIsDecorated(tx.compilerOptions.ExperimentalDecorators.IsTrue(), node.AsNode(), nil)) { name = tx.Factory().NewGeneratedNameForNode(node.AsNode()) } heritageClauses := tx.Visitor().VisitNodes(node.HeritageClauses) diff --git a/pkg/tsoptions/commandlineparser_test.go b/pkg/tsoptions/commandlineparser_test.go index 82885b7a8..fe0099d6c 100644 --- a/pkg/tsoptions/commandlineparser_test.go +++ b/pkg/tsoptions/commandlineparser_test.go @@ -87,6 +87,22 @@ func TestCommandLineParseResult(t *testing.T) { } } +func TestParseCommandLineTypeRootsRelativePath(t *testing.T) { + t.Parallel() + + host := tsoptionstest.NewVFSParseConfigHost(map[string]string{ + "/home/project/bug.ts": `let x = 1;`, + }, "/home/project", true) + + cmdLine := tsoptions.ParseCommandLine([]string{"--typeRoots", "t", "bug.ts"}, host) + + typeRoots := cmdLine.CompilerOptions().TypeRoots + assert.Assert(t, typeRoots != nil, "typeRoots should not be nil") + assert.Equal(t, len(typeRoots), 1) + assert.Assert(t, tspath.IsRootedDiskPath(typeRoots[0]), "typeRoots entry should be an absolute path, got: %s", typeRoots[0]) + assert.Assert(t, strings.HasSuffix(typeRoots[0], "/t"), "typeRoots entry should end with '/t', got: %s", typeRoots[0]) +} + func TestCustomConditionsNullOverride(t *testing.T) { t.Parallel() diff --git a/pkg/tsoptions/parsinghelpers.go b/pkg/tsoptions/parsinghelpers.go index 7d4031ec6..107780b5e 100644 --- a/pkg/tsoptions/parsinghelpers.go +++ b/pkg/tsoptions/parsinghelpers.go @@ -642,6 +642,14 @@ func ConvertOptionToAbsolutePath(o string, v any, optionMap CommandLineOptionNam return tspath.GetNormalizedAbsolutePath(item, cwd) }), true } + if arr, ok := v.([]any); ok { + return core.Map(arr, func(item any) any { + if s, isStr := item.(string); isStr { + return tspath.GetNormalizedAbsolutePath(s, cwd) + } + return item + }), true + } } } else if option.IsFilePath { if value, ok := v.(string); ok { diff --git a/pkg/tsoptions/tsconfigparsing.go b/pkg/tsoptions/tsconfigparsing.go index 4134c6db2..366063917 100644 --- a/pkg/tsoptions/tsconfigparsing.go +++ b/pkg/tsoptions/tsconfigparsing.go @@ -152,7 +152,7 @@ type FileExtensionInfo struct { } type ExtendedConfigCache interface { - GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host ParseConfigHost) *ExtendedConfigCacheEntry + GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []tspath.Path, host ParseConfigHost) *ExtendedConfigCacheEntry } type ExtendedConfigCacheEntry struct { @@ -963,7 +963,7 @@ func getExtendedConfig( sourceFile *TsConfigSourceFile, extendedConfigFileName string, host ParseConfigHost, - resolutionStack []string, + resolutionStack []tspath.Path, extendedConfigCache ExtendedConfigCache, result *extendsResult, ) (*parsedTsconfig, []*ast.Diagnostic) { @@ -971,7 +971,11 @@ func getExtendedConfig( extendedConfigPath := tspath.ToPath(extendedConfigFileName, host.GetCurrentDirectory(), host.FS().UseCaseSensitiveFileNames()) var cacheEntry *ExtendedConfigCacheEntry - if extendedConfigCache != nil { + // Bypass the cache when we detect a cycle in the resolution stack. + // The cache locks entries during parsing, and a cycle would cause the same goroutine + // to re-lock the same entry, resulting in a deadlock. Let parseConfig handle the + // circularity error via its own resolution stack check. + if extendedConfigCache != nil && !slices.Contains(resolutionStack, extendedConfigPath) { cacheEntry = extendedConfigCache.GetExtendedConfig(extendedConfigFileName, extendedConfigPath, resolutionStack, host) } else { cacheEntry = ParseExtendedConfig(extendedConfigFileName, extendedConfigPath, resolutionStack, host, extendedConfigCache) @@ -995,7 +999,7 @@ func getExtendedConfig( func ParseExtendedConfig( fileName string, path tspath.Path, - resolutionStack []string, + resolutionStack []tspath.Path, host ParseConfigHost, extendedConfigCache ExtendedConfigCache, ) *ExtendedConfigCacheEntry { @@ -1022,11 +1026,11 @@ func parseConfig( host ParseConfigHost, basePath string, configFileName string, - resolutionStack []string, + resolutionStack []tspath.Path, extendedConfigCache ExtendedConfigCache, ) (*parsedTsconfig, []*ast.Diagnostic) { basePath = tspath.NormalizeSlashes(basePath) - resolvedPath := tspath.GetNormalizedAbsolutePath(configFileName, basePath) + resolvedPath := tspath.ToPath(configFileName, basePath, host.FS().UseCaseSensitiveFileNames()) var errors []*ast.Diagnostic if slices.Contains(resolutionStack, resolvedPath) { var result *parsedTsconfig @@ -1181,8 +1185,7 @@ func parseJsonConfigFileContentWorker( } var errors []*ast.Diagnostic - resolutionStackString := []string{} - parsedConfig, errors := parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStackString, extendedConfigCache) + parsedConfig, errors := parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, extendedConfigCache) mergeCompilerOptions(parsedConfig.options, existingOptions, existingOptionsRaw) handleOptionConfigDirTemplateSubstitution(parsedConfig.options, basePathForFileNames) rawConfig := parseJsonToStringKey(parsedConfig.raw) @@ -1502,7 +1505,9 @@ func ForEachPropertyAssignment[T any](objectLiteral *ast.ObjectLiteralExpression func getTsConfigObjectLiteralExpression(tsConfigSourceFile *ast.SourceFile) *ast.ObjectLiteralExpression { if tsConfigSourceFile != nil && tsConfigSourceFile.Statements != nil && len(tsConfigSourceFile.Statements.Nodes) > 0 { expression := tsConfigSourceFile.Statements.Nodes[0].Expression() - return expression.AsObjectLiteralExpression() + if ast.IsObjectLiteralExpression(expression) { + return expression.AsObjectLiteralExpression() + } } return nil } diff --git a/pkg/tsoptions/tsconfigparsing_test.go b/pkg/tsoptions/tsconfigparsing_test.go index bd73dda3e..82470401e 100644 --- a/pkg/tsoptions/tsconfigparsing_test.go +++ b/pkg/tsoptions/tsconfigparsing_test.go @@ -1248,7 +1248,7 @@ type memoCache struct { m map[tspath.Path]*tsoptions.ExtendedConfigCacheEntry } -func (mc *memoCache) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { +func (mc *memoCache) GetExtendedConfig(fileName string, path tspath.Path, resolutionStack []tspath.Path, host tsoptions.ParseConfigHost) *tsoptions.ExtendedConfigCacheEntry { if mc.m == nil { mc.m = make(map[tspath.Path]*tsoptions.ExtendedConfigCacheEntry) } diff --git a/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.errors.txt b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.errors.txt new file mode 100644 index 000000000..3e1fcdc4b --- /dev/null +++ b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.errors.txt @@ -0,0 +1,16 @@ +anonymousClassDecoratorEs2022.ts(1,1): error TS1211: A class declaration without the 'default' modifier must have a name. +anonymousClassDecoratorEs2022.ts(2,4): error TS2304: Cannot find name 'x'. + + +==== anonymousClassDecoratorEs2022.ts (2 errors) ==== + class { + ~~~~~ +!!! error TS1211: A class declaration without the 'default' modifier must have a name. + @x + ~ +!!! error TS2304: Cannot find name 'x'. + m() { + // ... + } + }; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.js b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.js new file mode 100644 index 000000000..748b313ff --- /dev/null +++ b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.js @@ -0,0 +1,66 @@ +//// [tests/cases/compiler/anonymousClassDecoratorEs2022.ts] //// + +//// [anonymousClassDecoratorEs2022.ts] +class { + @x + m() { + // ... + } +}; + + +//// [anonymousClassDecoratorEs2022.js] +"use strict"; +var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; +var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +let default_1 = (() => { + let _instanceExtraInitializers = []; + let _m_decorators; + return class default_1 { + static { + const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0; + _m_decorators = [x]; + __esDecorate(this, null, _m_decorators, { kind: "method", name: "m", static: false, private: false, access: { has: obj => "m" in obj, get: obj => obj.m }, metadata: _metadata }, null, _instanceExtraInitializers); + if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata }); + } + m() { + // ... + } + constructor() { + __runInitializers(this, _instanceExtraInitializers); + } + }; +})(); +; diff --git a/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.symbols b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.symbols new file mode 100644 index 000000000..aa0c1181e --- /dev/null +++ b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.symbols @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/anonymousClassDecoratorEs2022.ts] //// + +=== anonymousClassDecoratorEs2022.ts === +class { + @x + m() { +>m : Symbol(__missing.m, Decl(anonymousClassDecoratorEs2022.ts, 0, 7)) + + // ... + } +}; + diff --git a/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.types b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.types new file mode 100644 index 000000000..20e336c4c --- /dev/null +++ b/testdata/baselines/reference/compiler/anonymousClassDecoratorEs2022.types @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/anonymousClassDecoratorEs2022.ts] //// + +=== anonymousClassDecoratorEs2022.ts === +class { + @x +>x : any + + m() { +>m : () => void + + // ... + } +}; + diff --git a/testdata/baselines/reference/compiler/awaitObjectLiteral.js b/testdata/baselines/reference/compiler/awaitObjectLiteral.js new file mode 100644 index 000000000..4a9955804 --- /dev/null +++ b/testdata/baselines/reference/compiler/awaitObjectLiteral.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/awaitObjectLiteral.ts] //// + +//// [fileA.ts] +export {} +const foo = await { bar: 42 } + +//// [fileB.ts] +export const baz = await { x: 1, y: "hello" } + + +//// [fileA.js] +const foo = await { bar: 42 }; +export {}; +//// [fileB.js] +export const baz = await { x: 1, y: "hello" }; diff --git a/testdata/baselines/reference/compiler/awaitObjectLiteral.symbols b/testdata/baselines/reference/compiler/awaitObjectLiteral.symbols new file mode 100644 index 000000000..c2e84e4be --- /dev/null +++ b/testdata/baselines/reference/compiler/awaitObjectLiteral.symbols @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/awaitObjectLiteral.ts] //// + +=== fileA.ts === +export {} +const foo = await { bar: 42 } +>foo : Symbol(foo, Decl(fileA.ts, 1, 5)) +>bar : Symbol(bar, Decl(fileA.ts, 1, 19)) + +=== fileB.ts === +export const baz = await { x: 1, y: "hello" } +>baz : Symbol(baz, Decl(fileB.ts, 0, 12)) +>x : Symbol(x, Decl(fileB.ts, 0, 26)) +>y : Symbol(y, Decl(fileB.ts, 0, 32)) + diff --git a/testdata/baselines/reference/compiler/awaitObjectLiteral.types b/testdata/baselines/reference/compiler/awaitObjectLiteral.types new file mode 100644 index 000000000..a25e8f321 --- /dev/null +++ b/testdata/baselines/reference/compiler/awaitObjectLiteral.types @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/awaitObjectLiteral.ts] //// + +=== fileA.ts === +export {} +const foo = await { bar: 42 } +>foo : { bar: number; } +>await { bar: 42 } : { bar: number; } +>{ bar: 42 } : { bar: number; } +>bar : number +>42 : 42 + +=== fileB.ts === +export const baz = await { x: 1, y: "hello" } +>baz : { x: number; y: string; } +>await { x: 1, y: "hello" } : { x: number; y: string; } +>{ x: 1, y: "hello" } : { x: number; y: string; } +>x : number +>1 : 1 +>y : string +>"hello" : "hello" + diff --git a/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.js b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.js new file mode 100644 index 000000000..27e562651 --- /dev/null +++ b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/backslashBeforeNonSpecialChar.ts] //// + +//// [backslashBeforeNonSpecialChar.ts] +const enum Currency { + Euro = "\€", +} + +const currency = Currency.Euro; + + +//// [backslashBeforeNonSpecialChar.js] +"use strict"; +const currency = "\u20AC" /* Currency.Euro */; diff --git a/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.symbols b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.symbols new file mode 100644 index 000000000..314aaee64 --- /dev/null +++ b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.symbols @@ -0,0 +1,16 @@ +//// [tests/cases/compiler/backslashBeforeNonSpecialChar.ts] //// + +=== backslashBeforeNonSpecialChar.ts === +const enum Currency { +>Currency : Symbol(Currency, Decl(backslashBeforeNonSpecialChar.ts, 0, 0)) + + Euro = "\€", +>Euro : Symbol(Currency.Euro, Decl(backslashBeforeNonSpecialChar.ts, 0, 21)) +} + +const currency = Currency.Euro; +>currency : Symbol(currency, Decl(backslashBeforeNonSpecialChar.ts, 4, 5)) +>Currency.Euro : Symbol(Currency.Euro, Decl(backslashBeforeNonSpecialChar.ts, 0, 21)) +>Currency : Symbol(Currency, Decl(backslashBeforeNonSpecialChar.ts, 0, 0)) +>Euro : Symbol(Currency.Euro, Decl(backslashBeforeNonSpecialChar.ts, 0, 21)) + diff --git a/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.types b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.types new file mode 100644 index 000000000..d1670b0ab --- /dev/null +++ b/testdata/baselines/reference/compiler/backslashBeforeNonSpecialChar.types @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/backslashBeforeNonSpecialChar.ts] //// + +=== backslashBeforeNonSpecialChar.ts === +const enum Currency { +>Currency : Currency + + Euro = "\€", +>Euro : Currency.Euro +>"\€" : "€" +} + +const currency = Currency.Euro; +>currency : Currency.Euro +>Currency.Euro : Currency +>Currency : typeof Currency +>Euro : Currency + diff --git a/testdata/baselines/reference/compiler/catchClauseRestProperties.errors.txt b/testdata/baselines/reference/compiler/catchClauseRestProperties.errors.txt new file mode 100644 index 000000000..0200d12e2 --- /dev/null +++ b/testdata/baselines/reference/compiler/catchClauseRestProperties.errors.txt @@ -0,0 +1,12 @@ +catchClauseRestProperties.ts(3,15): error TS2700: Rest types may only be created from object types. + + +==== catchClauseRestProperties.ts (1 errors) ==== + try { + // ... + } catch ({ ...rest }) { + ~~~~ +!!! error TS2700: Rest types may only be created from object types. + // ... + } + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/catchClauseRestProperties.js b/testdata/baselines/reference/compiler/catchClauseRestProperties.js new file mode 100644 index 000000000..bd2cb94e9 --- /dev/null +++ b/testdata/baselines/reference/compiler/catchClauseRestProperties.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/catchClauseRestProperties.ts] //// + +//// [catchClauseRestProperties.ts] +try { + // ... +} catch ({ ...rest }) { + // ... +} + + +//// [catchClauseRestProperties.js] +"use strict"; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +try { + // ... +} +catch (_a) { + var rest = __rest(_a, []); + // ... +} diff --git a/testdata/baselines/reference/compiler/catchClauseRestProperties.symbols b/testdata/baselines/reference/compiler/catchClauseRestProperties.symbols new file mode 100644 index 000000000..ef10d9cf4 --- /dev/null +++ b/testdata/baselines/reference/compiler/catchClauseRestProperties.symbols @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/catchClauseRestProperties.ts] //// + +=== catchClauseRestProperties.ts === +try { + // ... +} catch ({ ...rest }) { +>rest : Symbol(rest, Decl(catchClauseRestProperties.ts, 2, 10)) + + // ... +} + diff --git a/testdata/baselines/reference/compiler/catchClauseRestProperties.types b/testdata/baselines/reference/compiler/catchClauseRestProperties.types new file mode 100644 index 000000000..c2ede39cf --- /dev/null +++ b/testdata/baselines/reference/compiler/catchClauseRestProperties.types @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/catchClauseRestProperties.ts] //// + +=== catchClauseRestProperties.ts === +try { + // ... +} catch ({ ...rest }) { +>rest : any + + // ... +} + diff --git a/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.errors.txt b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.errors.txt new file mode 100644 index 000000000..7a7e104eb --- /dev/null +++ b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.errors.txt @@ -0,0 +1,8 @@ +contextuallyTypedFunctionOptionalAndRest.ts(1,24): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== contextuallyTypedFunctionOptionalAndRest.ts (1 errors) ==== + const f: () => void = (a?, ...b) => {}; + ~~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.js b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.js new file mode 100644 index 000000000..dc9cf7884 --- /dev/null +++ b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.js @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts] //// + +//// [contextuallyTypedFunctionOptionalAndRest.ts] +const f: () => void = (a?, ...b) => {}; + + +//// [contextuallyTypedFunctionOptionalAndRest.js] +"use strict"; +const f = (a, ...b) => { }; diff --git a/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.symbols b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.symbols new file mode 100644 index 000000000..ccf2fa5b1 --- /dev/null +++ b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.symbols @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts] //// + +=== contextuallyTypedFunctionOptionalAndRest.ts === +const f: () => void = (a?, ...b) => {}; +>f : Symbol(f, Decl(contextuallyTypedFunctionOptionalAndRest.ts, 0, 5)) +>a : Symbol(a, Decl(contextuallyTypedFunctionOptionalAndRest.ts, 0, 23)) +>b : Symbol(b, Decl(contextuallyTypedFunctionOptionalAndRest.ts, 0, 26)) + diff --git a/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.types b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.types new file mode 100644 index 000000000..8e1389964 --- /dev/null +++ b/testdata/baselines/reference/compiler/contextuallyTypedFunctionOptionalAndRest.types @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts] //// + +=== contextuallyTypedFunctionOptionalAndRest.ts === +const f: () => void = (a?, ...b) => {}; +>f : () => void +>(a?, ...b) => {} : (a?: any) => void +>a : any +>b : [] + diff --git a/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.js b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.js new file mode 100644 index 000000000..7393147ef --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.js @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts] //// + +//// [declarationEmitNonAsciiStringLiteralType.ts] +export const IconEmojis = { + alert_low: "⚠️", +} as const; + +export const singleEmoji = "⚠️" as const; + +export const tuple = ["⚠️", "日本語"] as const; + +export function returnsEmoji(): "⚠️" { + return "⚠️"; +} + +export const templateEmoji = `⚠️` as const; + +export const templateObj = { + alert: `⚠️`, + greet: `日本語`, +} as const; + + + + +//// [declarationEmitNonAsciiStringLiteralType.d.ts] +export declare const IconEmojis: { + readonly alert_low: "⚠️"; +}; +export declare const singleEmoji: "⚠️"; +export declare const tuple: readonly ["⚠️", "日本語"]; +export declare function returnsEmoji(): "⚠️"; +export declare const templateEmoji: `⚠️`; +export declare const templateObj: { + readonly alert: `⚠️`; + readonly greet: `日本語`; +}; diff --git a/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.symbols b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.symbols new file mode 100644 index 000000000..44e482057 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.symbols @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts] //// + +=== declarationEmitNonAsciiStringLiteralType.ts === +export const IconEmojis = { +>IconEmojis : Symbol(IconEmojis, Decl(declarationEmitNonAsciiStringLiteralType.ts, 0, 12)) + + alert_low: "⚠️", +>alert_low : Symbol(alert_low, Decl(declarationEmitNonAsciiStringLiteralType.ts, 0, 27)) + +} as const; +>const : Symbol(const) + +export const singleEmoji = "⚠️" as const; +>singleEmoji : Symbol(singleEmoji, Decl(declarationEmitNonAsciiStringLiteralType.ts, 4, 12)) +>const : Symbol(const) + +export const tuple = ["⚠️", "日本語"] as const; +>tuple : Symbol(tuple, Decl(declarationEmitNonAsciiStringLiteralType.ts, 6, 12)) +>const : Symbol(const) + +export function returnsEmoji(): "⚠️" { +>returnsEmoji : Symbol(returnsEmoji, Decl(declarationEmitNonAsciiStringLiteralType.ts, 6, 44)) + + return "⚠️"; +} + +export const templateEmoji = `⚠️` as const; +>templateEmoji : Symbol(templateEmoji, Decl(declarationEmitNonAsciiStringLiteralType.ts, 12, 12)) +>const : Symbol(const) + +export const templateObj = { +>templateObj : Symbol(templateObj, Decl(declarationEmitNonAsciiStringLiteralType.ts, 14, 12)) + + alert: `⚠️`, +>alert : Symbol(alert, Decl(declarationEmitNonAsciiStringLiteralType.ts, 14, 28)) + + greet: `日本語`, +>greet : Symbol(greet, Decl(declarationEmitNonAsciiStringLiteralType.ts, 15, 16)) + +} as const; +>const : Symbol(const) + diff --git a/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.types b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.types new file mode 100644 index 000000000..611a03e57 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitNonAsciiStringLiteralType.types @@ -0,0 +1,53 @@ +//// [tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts] //// + +=== declarationEmitNonAsciiStringLiteralType.ts === +export const IconEmojis = { +>IconEmojis : { readonly alert_low: "⚠️"; } +>{ alert_low: "⚠️",} as const : { readonly alert_low: "⚠️"; } +>{ alert_low: "⚠️",} : { readonly alert_low: "⚠️"; } + + alert_low: "⚠️", +>alert_low : "⚠️" +>"⚠️" : "⚠️" + +} as const; + +export const singleEmoji = "⚠️" as const; +>singleEmoji : "⚠️" +>"⚠️" as const : "⚠️" +>"⚠️" : "⚠️" + +export const tuple = ["⚠️", "日本語"] as const; +>tuple : readonly ["⚠️", "日本語"] +>["⚠️", "日本語"] as const : readonly ["⚠️", "日本語"] +>["⚠️", "日本語"] : readonly ["⚠️", "日本語"] +>"⚠️" : "⚠️" +>"日本語" : "日本語" + +export function returnsEmoji(): "⚠️" { +>returnsEmoji : () => "⚠️" + + return "⚠️"; +>"⚠️" : "⚠️" +} + +export const templateEmoji = `⚠️` as const; +>templateEmoji : "⚠️" +>`⚠️` as const : "⚠️" +>`⚠️` : "⚠️" + +export const templateObj = { +>templateObj : { readonly alert: `⚠️`; readonly greet: `日本語`; } +>{ alert: `⚠️`, greet: `日本語`,} as const : { readonly alert: `⚠️`; readonly greet: `日本語`; } +>{ alert: `⚠️`, greet: `日本語`,} : { readonly alert: `⚠️`; readonly greet: `日本語`; } + + alert: `⚠️`, +>alert : "⚠️" +>`⚠️` : "⚠️" + + greet: `日本語`, +>greet : "日本語" +>`日本語` : "日本語" + +} as const; + diff --git a/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.js b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.js new file mode 100644 index 000000000..797cefbe4 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.js @@ -0,0 +1,44 @@ +//// [tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts] //// + +//// [a.ts] +export class C { + /** + * Non Async function + */ + private a(): void { + } + + /** + * Async function + */ + private async b(): Promise { + } +} + + +//// [a.js] +export class C { + /** + * Non Async function + */ + a() { + } + /** + * Async function + */ + async b() { + } +} + + +//// [a.d.ts] +export declare class C { + /** + * Non Async function + */ + private a; + /** + * Async function + */ + private b; +} diff --git a/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.symbols b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.symbols new file mode 100644 index 000000000..0e1266ff1 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.symbols @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts] //// + +=== a.ts === +export class C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + /** + * Non Async function + */ + private a(): void { +>a : Symbol(C.a, Decl(a.ts, 0, 16)) + } + + /** + * Async function + */ + private async b(): Promise { +>b : Symbol(C.b, Decl(a.ts, 5, 5)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) + } +} + diff --git a/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.types b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.types new file mode 100644 index 000000000..57df28914 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitPrivateAsyncMethod.types @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts] //// + +=== a.ts === +export class C { +>C : C + + /** + * Non Async function + */ + private a(): void { +>a : () => void + } + + /** + * Async function + */ + private async b(): Promise { +>b : () => Promise + } +} + diff --git a/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.js b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.js new file mode 100644 index 000000000..12450360f --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.js @@ -0,0 +1,41 @@ +//// [tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts] //// + +//// [declarationEmitTypeofIndexedAccessNoParens.ts] +export const C = { A: 1 }; +export type C = typeof C[keyof typeof C]; + +// Parenthesized form should also round-trip +export type C2 = (typeof C)[keyof typeof C]; + +// IndexedAccessType: index access of a parsed typeof should preserve source +export const arr = [C]; +export type ArrAlias = typeof arr[number]; + +// ArrayType: array of a parsed typeof should preserve source +export type CArr = typeof C[]; +// Parenthesized array form should also round-trip +export type CArr2 = (typeof C)[]; + +// OptionalType (tuple element): optional of a parsed typeof should preserve source +export type CTuple = [typeof C?]; +// Parenthesized optional form should also round-trip +export type CTuple2 = [(typeof C)?]; + + + + + +//// [declarationEmitTypeofIndexedAccessNoParens.d.ts] +export declare const C: { + A: number; +}; +export type C = typeof C[keyof typeof C]; +export type C2 = (typeof C)[keyof typeof C]; +export declare const arr: { + A: number; +}[]; +export type ArrAlias = typeof arr[number]; +export type CArr = typeof C[]; +export type CArr2 = (typeof C)[]; +export type CTuple = [typeof C?]; +export type CTuple2 = [(typeof C)?]; diff --git a/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.symbols b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.symbols new file mode 100644 index 000000000..366f5b184 --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.symbols @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts] //// + +=== declarationEmitTypeofIndexedAccessNoParens.ts === +export const C = { A: 1 }; +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) +>A : Symbol(A, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 18)) + +export type C = typeof C[keyof typeof C]; +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +// Parenthesized form should also round-trip +export type C2 = (typeof C)[keyof typeof C]; +>C2 : Symbol(C2, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 1, 41)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +// IndexedAccessType: index access of a parsed typeof should preserve source +export const arr = [C]; +>arr : Symbol(arr, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 7, 12)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +export type ArrAlias = typeof arr[number]; +>ArrAlias : Symbol(ArrAlias, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 7, 23)) +>arr : Symbol(arr, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 7, 12)) + +// ArrayType: array of a parsed typeof should preserve source +export type CArr = typeof C[]; +>CArr : Symbol(CArr, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 8, 42)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +// Parenthesized array form should also round-trip +export type CArr2 = (typeof C)[]; +>CArr2 : Symbol(CArr2, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 11, 30)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +// OptionalType (tuple element): optional of a parsed typeof should preserve source +export type CTuple = [typeof C?]; +>CTuple : Symbol(CTuple, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 13, 33)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + +// Parenthesized optional form should also round-trip +export type CTuple2 = [(typeof C)?]; +>CTuple2 : Symbol(CTuple2, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 16, 33)) +>C : Symbol(C, Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 12), Decl(declarationEmitTypeofIndexedAccessNoParens.ts, 0, 26)) + + diff --git a/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.types b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.types new file mode 100644 index 000000000..783e3989d --- /dev/null +++ b/testdata/baselines/reference/compiler/declarationEmitTypeofIndexedAccessNoParens.types @@ -0,0 +1,51 @@ +//// [tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts] //// + +=== declarationEmitTypeofIndexedAccessNoParens.ts === +export const C = { A: 1 }; +>C : { A: number; } +>{ A: 1 } : { A: number; } +>A : number +>1 : 1 + +export type C = typeof C[keyof typeof C]; +>C : number +>C : { A: number; } +>C : { A: number; } + +// Parenthesized form should also round-trip +export type C2 = (typeof C)[keyof typeof C]; +>C2 : number +>C : { A: number; } +>C : { A: number; } + +// IndexedAccessType: index access of a parsed typeof should preserve source +export const arr = [C]; +>arr : { A: number; }[] +>[C] : { A: number; }[] +>C : { A: number; } + +export type ArrAlias = typeof arr[number]; +>ArrAlias : { A: number; } +>arr : { A: number; }[] + +// ArrayType: array of a parsed typeof should preserve source +export type CArr = typeof C[]; +>CArr : CArr +>C : { A: number; } + +// Parenthesized array form should also round-trip +export type CArr2 = (typeof C)[]; +>CArr2 : CArr2 +>C : { A: number; } + +// OptionalType (tuple element): optional of a parsed typeof should preserve source +export type CTuple = [typeof C?]; +>CTuple : CTuple +>C : { A: number; } + +// Parenthesized optional form should also round-trip +export type CTuple2 = [(typeof C)?]; +>CTuple2 : CTuple2 +>C : { A: number; } + + diff --git a/testdata/baselines/reference/compiler/destructuringEmptyBinding.errors.txt b/testdata/baselines/reference/compiler/destructuringEmptyBinding.errors.txt new file mode 100644 index 000000000..790e81d4c --- /dev/null +++ b/testdata/baselines/reference/compiler/destructuringEmptyBinding.errors.txt @@ -0,0 +1,11 @@ +a.ts(1,16): error TS1003: Identifier expected. +a.ts(1,23): error TS2304: Cannot find name 'x'. + + +==== a.ts (2 errors) ==== + export var {...{ }} = x; + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS2304: Cannot find name 'x'. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/destructuringEmptyBinding.js b/testdata/baselines/reference/compiler/destructuringEmptyBinding.js new file mode 100644 index 000000000..bcc83b95f --- /dev/null +++ b/testdata/baselines/reference/compiler/destructuringEmptyBinding.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/destructuringEmptyBinding.ts] //// + +//// [a.ts] +export var {...{ }} = x; + + +//// [a.js] +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +var _a; +export var _b = _a = __rest(x, []); diff --git a/testdata/baselines/reference/compiler/destructuringEmptyBinding.symbols b/testdata/baselines/reference/compiler/destructuringEmptyBinding.symbols new file mode 100644 index 000000000..00fe2c582 --- /dev/null +++ b/testdata/baselines/reference/compiler/destructuringEmptyBinding.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/destructuringEmptyBinding.ts] //// + +=== a.ts === + +export var {...{ }} = x; + diff --git a/testdata/baselines/reference/compiler/destructuringEmptyBinding.types b/testdata/baselines/reference/compiler/destructuringEmptyBinding.types new file mode 100644 index 000000000..c85c3f469 --- /dev/null +++ b/testdata/baselines/reference/compiler/destructuringEmptyBinding.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/destructuringEmptyBinding.ts] //// + +=== a.ts === +export var {...{ }} = x; +> : any +>x : any + diff --git a/testdata/baselines/reference/compiler/emitIncompleteDoStatement.errors.txt b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.errors.txt new file mode 100644 index 000000000..34b13d426 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.errors.txt @@ -0,0 +1,7 @@ +a.ts(1,3): error TS1109: Expression expected. + + +==== a.ts (1 errors) ==== + do + +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/emitIncompleteDoStatement.js b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.js new file mode 100644 index 000000000..205fd279c --- /dev/null +++ b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.js @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/emitIncompleteDoStatement.ts] //// + +//// [a.ts] +do + +//// [a.js] +"use strict"; +do + ; +while (); diff --git a/testdata/baselines/reference/compiler/emitIncompleteDoStatement.symbols b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.symbols new file mode 100644 index 000000000..004ff95e5 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.symbols @@ -0,0 +1,5 @@ +//// [tests/cases/compiler/emitIncompleteDoStatement.ts] //// + +=== a.ts === + +do diff --git a/testdata/baselines/reference/compiler/emitIncompleteDoStatement.types b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.types new file mode 100644 index 000000000..0e1e8c092 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitIncompleteDoStatement.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/emitIncompleteDoStatement.ts] //// + +=== a.ts === +do +> : any +> : any + diff --git a/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.errors.txt b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.errors.txt new file mode 100644 index 000000000..dd34ccda3 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.errors.txt @@ -0,0 +1,12 @@ +a.tsx(1,13): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +a.tsx(1,14): error TS2552: Cannot find name 'App'. Did you mean 'app'? + + +==== a.tsx (2 errors) ==== + const app = ; + ~~~~~~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~ +!!! error TS2552: Cannot find name 'App'. Did you mean 'app'? +!!! related TS2728 a.tsx:1:7: 'app' is declared here. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.js b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.js new file mode 100644 index 000000000..b9c3cea22 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.js @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/emitReactJsxSelfClosingElement.tsx] //// + +//// [a.tsx] +const app = ; + + +//// [a.js] +import { jsx as _jsx } from "react/jsx-runtime"; +const app = _jsx(App, {}); diff --git a/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.symbols b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.symbols new file mode 100644 index 000000000..377f6230e --- /dev/null +++ b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/emitReactJsxSelfClosingElement.tsx] //// + +=== a.tsx === +const app = ; +>app : Symbol(app, Decl(a.tsx, 0, 5)) + diff --git a/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.types b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.types new file mode 100644 index 000000000..efde73881 --- /dev/null +++ b/testdata/baselines/reference/compiler/emitReactJsxSelfClosingElement.types @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/emitReactJsxSelfClosingElement.tsx] //// + +=== a.tsx === +const app = ; +>app : any +> : any +>App : any + diff --git a/testdata/baselines/reference/compiler/enumAutoIncrementValue.types b/testdata/baselines/reference/compiler/enumAutoIncrementValue.types index 900cfc8b8..dd23ea445 100644 --- a/testdata/baselines/reference/compiler/enumAutoIncrementValue.types +++ b/testdata/baselines/reference/compiler/enumAutoIncrementValue.types @@ -11,6 +11,6 @@ enum E { >0 : 0 B, ->B : E.B +>B : E.A } diff --git a/testdata/baselines/reference/compiler/enumNaNValues.errors.txt b/testdata/baselines/reference/compiler/enumNaNValues.errors.txt new file mode 100644 index 000000000..10d8b638b --- /dev/null +++ b/testdata/baselines/reference/compiler/enumNaNValues.errors.txt @@ -0,0 +1,20 @@ +enumNaNValues.ts(13,7): error TS2322: Type 'F' is not assignable to type 'E'. + + +==== enumNaNValues.ts (1 errors) ==== + enum E { + A = NaN, + B = NaN, + } + + const a: E.A = E.B; + const b: E.B = E.A; + + enum F { + X = NaN, + } + + const c: E.A = F.X; // Error expected - different enums + ~ +!!! error TS2322: Type 'F' is not assignable to type 'E'. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/enumNaNValues.js b/testdata/baselines/reference/compiler/enumNaNValues.js new file mode 100644 index 000000000..88ba034c4 --- /dev/null +++ b/testdata/baselines/reference/compiler/enumNaNValues.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/enumNaNValues.ts] //// + +//// [enumNaNValues.ts] +enum E { + A = NaN, + B = NaN, +} + +const a: E.A = E.B; +const b: E.B = E.A; + +enum F { + X = NaN, +} + +const c: E.A = F.X; // Error expected - different enums + + +//// [enumNaNValues.js] +"use strict"; +var E; +(function (E) { + E[E["A"] = NaN] = "A"; + E[E["B"] = NaN] = "B"; +})(E || (E = {})); +const a = E.B; +const b = E.A; +var F; +(function (F) { + F[F["X"] = NaN] = "X"; +})(F || (F = {})); +const c = F.X; // Error expected - different enums diff --git a/testdata/baselines/reference/compiler/enumNaNValues.symbols b/testdata/baselines/reference/compiler/enumNaNValues.symbols new file mode 100644 index 000000000..0d3125bbb --- /dev/null +++ b/testdata/baselines/reference/compiler/enumNaNValues.symbols @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/enumNaNValues.ts] //// + +=== enumNaNValues.ts === +enum E { +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) + + A = NaN, +>A : Symbol(E.A, Decl(enumNaNValues.ts, 0, 8)) +>NaN : Symbol(NaN, Decl(lib.es5.d.ts, --, --)) + + B = NaN, +>B : Symbol(E.B, Decl(enumNaNValues.ts, 1, 10)) +>NaN : Symbol(NaN, Decl(lib.es5.d.ts, --, --)) +} + +const a: E.A = E.B; +>a : Symbol(a, Decl(enumNaNValues.ts, 5, 5)) +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) +>A : Symbol(E.A, Decl(enumNaNValues.ts, 0, 8)) +>E.B : Symbol(E.B, Decl(enumNaNValues.ts, 1, 10)) +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) +>B : Symbol(E.B, Decl(enumNaNValues.ts, 1, 10)) + +const b: E.B = E.A; +>b : Symbol(b, Decl(enumNaNValues.ts, 6, 5)) +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) +>B : Symbol(E.B, Decl(enumNaNValues.ts, 1, 10)) +>E.A : Symbol(E.A, Decl(enumNaNValues.ts, 0, 8)) +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) +>A : Symbol(E.A, Decl(enumNaNValues.ts, 0, 8)) + +enum F { +>F : Symbol(F, Decl(enumNaNValues.ts, 6, 19)) + + X = NaN, +>X : Symbol(F.X, Decl(enumNaNValues.ts, 8, 8)) +>NaN : Symbol(NaN, Decl(lib.es5.d.ts, --, --)) +} + +const c: E.A = F.X; // Error expected - different enums +>c : Symbol(c, Decl(enumNaNValues.ts, 12, 5)) +>E : Symbol(E, Decl(enumNaNValues.ts, 0, 0)) +>A : Symbol(E.A, Decl(enumNaNValues.ts, 0, 8)) +>F.X : Symbol(F.X, Decl(enumNaNValues.ts, 8, 8)) +>F : Symbol(F, Decl(enumNaNValues.ts, 6, 19)) +>X : Symbol(F.X, Decl(enumNaNValues.ts, 8, 8)) + diff --git a/testdata/baselines/reference/compiler/enumNaNValues.types b/testdata/baselines/reference/compiler/enumNaNValues.types new file mode 100644 index 000000000..5417c190e --- /dev/null +++ b/testdata/baselines/reference/compiler/enumNaNValues.types @@ -0,0 +1,44 @@ +//// [tests/cases/compiler/enumNaNValues.ts] //// + +=== enumNaNValues.ts === +enum E { +>E : E + + A = NaN, +>A : E.A +>NaN : number + + B = NaN, +>B : E.A +>NaN : number +} + +const a: E.A = E.B; +>a : E +>E : any +>E.B : E +>E : typeof E +>B : E + +const b: E.B = E.A; +>b : E +>E : any +>E.A : E +>E : typeof E +>A : E + +enum F { +>F : F + + X = NaN, +>X : F.X +>NaN : number +} + +const c: E.A = F.X; // Error expected - different enums +>c : E +>E : any +>F.X : F +>F : typeof F +>X : F + diff --git a/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.errors.txt b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.errors.txt new file mode 100644 index 000000000..df6052c8c --- /dev/null +++ b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.errors.txt @@ -0,0 +1,20 @@ +a.ts(2,5): error TS1042: 'async' modifier cannot be used here. +a.ts(2,15): error TS2378: A 'get' accessor must return a value. +a.ts(3,13): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. + + +==== a.ts (3 errors) ==== + class C { + async get x() { + ~~~~~ +!!! error TS1042: 'async' modifier cannot be used here. + ~ +!!! error TS2378: A 'get' accessor must return a value. + for await (const y of []) { + ~~~~~ +!!! error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. +!!! related TS1356 a.ts:2:15: Did you mean to mark this function as 'async'? + } + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.js b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.js new file mode 100644 index 000000000..2f3a28461 --- /dev/null +++ b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/forAwaitInAsyncAccessor.ts] //// + +//// [a.ts] +class C { + async get x() { + for await (const y of []) { + } + } +} + + +//// [a.js] +"use strict"; +class C { + async get x() { + for await (const y of []) { + } + } +} diff --git a/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.symbols b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.symbols new file mode 100644 index 000000000..5f057e268 --- /dev/null +++ b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.symbols @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/forAwaitInAsyncAccessor.ts] //// + +=== a.ts === +class C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + async get x() { +>x : Symbol(C.x, Decl(a.ts, 0, 9)) + + for await (const y of []) { +>y : Symbol(y, Decl(a.ts, 2, 24)) + } + } +} + diff --git a/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.types b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.types new file mode 100644 index 000000000..d965c9dc4 --- /dev/null +++ b/testdata/baselines/reference/compiler/forAwaitInAsyncAccessor.types @@ -0,0 +1,16 @@ +//// [tests/cases/compiler/forAwaitInAsyncAccessor.ts] //// + +=== a.ts === +class C { +>C : C + + async get x() { +>x : void + + for await (const y of []) { +>y : never +>[] : never[] + } + } +} + diff --git a/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.js b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.js new file mode 100644 index 000000000..37efd533f --- /dev/null +++ b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/inferFromTupleRestAndVariadic.ts] //// + +//// [inferFromTupleRestAndVariadic.ts] +// Crash when inferring from tuple types with rest and variadic elements +// where the variadic element's constraint consumes all source tuple elements. +// The pattern [...rest, ...T] where T is constrained by a fixed-size tuple +// calls getElementTypeOfSliceOfTupleType which can return nil when the +// source tuple is entirely consumed by T's implied arity. + +type SubTup = T extends [ + ...(infer C)[], + ...infer B extends [any, any] +] ? B : never; +type Trigger = SubTup<[1, 2]>; + +// Also test the [...T, ...rest] pattern +type SubTup2 = T extends [ + ...infer A extends [any, any], + ...(infer D)[], +] ? A : never; +type Trigger2 = SubTup2<[1, 2]>; + +// Test with more elements than implied arity (should work fine) +type Trigger3 = SubTup<[1, 2, 3, 4]>; +type Trigger4 = SubTup2<[1, 2, 3, 4]>; + + +//// [inferFromTupleRestAndVariadic.js] +"use strict"; +// Crash when inferring from tuple types with rest and variadic elements +// where the variadic element's constraint consumes all source tuple elements. +// The pattern [...rest, ...T] where T is constrained by a fixed-size tuple +// calls getElementTypeOfSliceOfTupleType which can return nil when the +// source tuple is entirely consumed by T's implied arity. diff --git a/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.symbols b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.symbols new file mode 100644 index 000000000..6eddac1fc --- /dev/null +++ b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.symbols @@ -0,0 +1,55 @@ +//// [tests/cases/compiler/inferFromTupleRestAndVariadic.ts] //// + +=== inferFromTupleRestAndVariadic.ts === +// Crash when inferring from tuple types with rest and variadic elements +// where the variadic element's constraint consumes all source tuple elements. +// The pattern [...rest, ...T] where T is constrained by a fixed-size tuple +// calls getElementTypeOfSliceOfTupleType which can return nil when the +// source tuple is entirely consumed by T's implied arity. + +type SubTup = T extends [ +>SubTup : Symbol(SubTup, Decl(inferFromTupleRestAndVariadic.ts, 0, 0)) +>T : Symbol(T, Decl(inferFromTupleRestAndVariadic.ts, 6, 12)) +>T : Symbol(T, Decl(inferFromTupleRestAndVariadic.ts, 6, 12)) + + ...(infer C)[], +>C : Symbol(C, Decl(inferFromTupleRestAndVariadic.ts, 7, 13)) + + ...infer B extends [any, any] +>B : Symbol(B, Decl(inferFromTupleRestAndVariadic.ts, 8, 12)) + +] ? B : never; +>B : Symbol(B, Decl(inferFromTupleRestAndVariadic.ts, 8, 12)) + +type Trigger = SubTup<[1, 2]>; +>Trigger : Symbol(Trigger, Decl(inferFromTupleRestAndVariadic.ts, 9, 14)) +>SubTup : Symbol(SubTup, Decl(inferFromTupleRestAndVariadic.ts, 0, 0)) + +// Also test the [...T, ...rest] pattern +type SubTup2 = T extends [ +>SubTup2 : Symbol(SubTup2, Decl(inferFromTupleRestAndVariadic.ts, 10, 30)) +>T : Symbol(T, Decl(inferFromTupleRestAndVariadic.ts, 13, 13)) +>T : Symbol(T, Decl(inferFromTupleRestAndVariadic.ts, 13, 13)) + + ...infer A extends [any, any], +>A : Symbol(A, Decl(inferFromTupleRestAndVariadic.ts, 14, 12)) + + ...(infer D)[], +>D : Symbol(D, Decl(inferFromTupleRestAndVariadic.ts, 15, 13)) + +] ? A : never; +>A : Symbol(A, Decl(inferFromTupleRestAndVariadic.ts, 14, 12)) + +type Trigger2 = SubTup2<[1, 2]>; +>Trigger2 : Symbol(Trigger2, Decl(inferFromTupleRestAndVariadic.ts, 16, 14)) +>SubTup2 : Symbol(SubTup2, Decl(inferFromTupleRestAndVariadic.ts, 10, 30)) + +// Test with more elements than implied arity (should work fine) +type Trigger3 = SubTup<[1, 2, 3, 4]>; +>Trigger3 : Symbol(Trigger3, Decl(inferFromTupleRestAndVariadic.ts, 17, 32)) +>SubTup : Symbol(SubTup, Decl(inferFromTupleRestAndVariadic.ts, 0, 0)) + +type Trigger4 = SubTup2<[1, 2, 3, 4]>; +>Trigger4 : Symbol(Trigger4, Decl(inferFromTupleRestAndVariadic.ts, 20, 37)) +>SubTup2 : Symbol(SubTup2, Decl(inferFromTupleRestAndVariadic.ts, 10, 30)) + diff --git a/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.types b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.types new file mode 100644 index 000000000..ba27b37ab --- /dev/null +++ b/testdata/baselines/reference/compiler/inferFromTupleRestAndVariadic.types @@ -0,0 +1,35 @@ +//// [tests/cases/compiler/inferFromTupleRestAndVariadic.ts] //// + +=== inferFromTupleRestAndVariadic.ts === +// Crash when inferring from tuple types with rest and variadic elements +// where the variadic element's constraint consumes all source tuple elements. +// The pattern [...rest, ...T] where T is constrained by a fixed-size tuple +// calls getElementTypeOfSliceOfTupleType which can return nil when the +// source tuple is entirely consumed by T's implied arity. + +type SubTup = T extends [ +>SubTup : SubTup + + ...(infer C)[], + ...infer B extends [any, any] +] ? B : never; +type Trigger = SubTup<[1, 2]>; +>Trigger : [1, 2] + +// Also test the [...T, ...rest] pattern +type SubTup2 = T extends [ +>SubTup2 : SubTup2 + + ...infer A extends [any, any], + ...(infer D)[], +] ? A : never; +type Trigger2 = SubTup2<[1, 2]>; +>Trigger2 : [1, 2] + +// Test with more elements than implied arity (should work fine) +type Trigger3 = SubTup<[1, 2, 3, 4]>; +>Trigger3 : [3, 4] + +type Trigger4 = SubTup2<[1, 2, 3, 4]>; +>Trigger4 : [1, 2] + diff --git a/testdata/baselines/reference/compiler/inferRestTupleShortSource.errors.txt b/testdata/baselines/reference/compiler/inferRestTupleShortSource.errors.txt new file mode 100644 index 000000000..7f4e5677d --- /dev/null +++ b/testdata/baselines/reference/compiler/inferRestTupleShortSource.errors.txt @@ -0,0 +1,16 @@ +inferRestTupleShortSource.ts(7,3): error TS2345: Argument of type '[]' is not assignable to parameter of type '[...string[], string]'. + Source has 0 element(s) but target requires 1. + + +==== inferRestTupleShortSource.ts (1 errors) ==== + // Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint + + function f(args: [...string[], ...T]) { + // ... + } + + f([]) + ~~ +!!! error TS2345: Argument of type '[]' is not assignable to parameter of type '[...string[], string]'. +!!! error TS2345: Source has 0 element(s) but target requires 1. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/inferRestTupleShortSource.js b/testdata/baselines/reference/compiler/inferRestTupleShortSource.js new file mode 100644 index 000000000..d0dd4d3f3 --- /dev/null +++ b/testdata/baselines/reference/compiler/inferRestTupleShortSource.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/inferRestTupleShortSource.ts] //// + +//// [inferRestTupleShortSource.ts] +// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint + +function f(args: [...string[], ...T]) { + // ... +} + +f([]) + + +//// [inferRestTupleShortSource.js] +"use strict"; +// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint +function f(args) { + // ... +} +f([]); diff --git a/testdata/baselines/reference/compiler/inferRestTupleShortSource.symbols b/testdata/baselines/reference/compiler/inferRestTupleShortSource.symbols new file mode 100644 index 000000000..fb7d8a1aa --- /dev/null +++ b/testdata/baselines/reference/compiler/inferRestTupleShortSource.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/inferRestTupleShortSource.ts] //// + +=== inferRestTupleShortSource.ts === +// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint + +function f(args: [...string[], ...T]) { +>f : Symbol(f, Decl(inferRestTupleShortSource.ts, 0, 0)) +>T : Symbol(T, Decl(inferRestTupleShortSource.ts, 2, 11)) +>args : Symbol(args, Decl(inferRestTupleShortSource.ts, 2, 31)) +>T : Symbol(T, Decl(inferRestTupleShortSource.ts, 2, 11)) + + // ... +} + +f([]) +>f : Symbol(f, Decl(inferRestTupleShortSource.ts, 0, 0)) + diff --git a/testdata/baselines/reference/compiler/inferRestTupleShortSource.types b/testdata/baselines/reference/compiler/inferRestTupleShortSource.types new file mode 100644 index 000000000..65ad16c16 --- /dev/null +++ b/testdata/baselines/reference/compiler/inferRestTupleShortSource.types @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/inferRestTupleShortSource.ts] //// + +=== inferRestTupleShortSource.ts === +// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint + +function f(args: [...string[], ...T]) { +>f : (args: [...string[], ...T]) => void +>args : [...string[], ...T] + + // ... +} + +f([]) +>f([]) : void +>f : (args: [...string[], ...T]) => void +>[] : [] + diff --git a/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.errors.txt b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.errors.txt new file mode 100644 index 000000000..5d7c484f3 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.errors.txt @@ -0,0 +1,15 @@ +file.js(2,16): error TS1097: 'extends' list cannot be empty. +file.js(5,16): error TS1097: 'extends' list cannot be empty. + + +==== file.js (2 errors) ==== + /** @augments X */ + class C extends {} + +!!! error TS1097: 'extends' list cannot be empty. + + /** @extends X */ + class D extends {} + +!!! error TS1097: 'extends' list cannot be empty. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.symbols b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.symbols new file mode 100644 index 000000000..a4de41c75 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.symbols @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/jsDocAugmentsEmptyExtends.ts] //// + +=== file.js === +/** @augments X */ +class C extends {} +>C : Symbol(C, Decl(file.js, 0, 0)) + +/** @extends X */ +class D extends {} +>D : Symbol(D, Decl(file.js, 1, 18)) + diff --git a/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.types b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.types new file mode 100644 index 000000000..82a59b86a --- /dev/null +++ b/testdata/baselines/reference/compiler/jsDocAugmentsEmptyExtends.types @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/jsDocAugmentsEmptyExtends.ts] //// + +=== file.js === +/** @augments X */ +class C extends {} +>C : C + +/** @extends X */ +class D extends {} +>D : D + diff --git a/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.symbols b/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.symbols new file mode 100644 index 000000000..2e173f24e --- /dev/null +++ b/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.symbols @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/jsDocTypedefWithThisTag.ts] //// + +=== bug.js === +/** @typedef T @this {object} */ +const x = 1; +>x : Symbol(x, Decl(bug.js, 1, 5)) + diff --git a/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.types b/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.types new file mode 100644 index 000000000..7d80abcb2 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsDocTypedefWithThisTag.types @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/jsDocTypedefWithThisTag.ts] //// + +=== bug.js === +/** @typedef T @this {object} */ +const x = 1; +>x : 1 +>1 : 1 + diff --git a/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.errors.txt b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.errors.txt new file mode 100644 index 000000000..487c98d50 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.errors.txt @@ -0,0 +1,31 @@ +bug.js(23,14): error TS2339: Property 'y' does not exist on type 'object'. + + +==== bug.js (1 errors) ==== + /** + * @callback cb + * @param x.y + */ + + /** + * @callback cb2 + * @param {object} x + * @param {string} x.y + */ + + /** + * @overload + * @param {object} x + * @param {string} x.y + * @returns {string} + */ + /** + * @param {object} x + * @returns {string} + */ + function foo(x) { + return x.y; + ~ +!!! error TS2339: Property 'y' does not exist on type 'object'. + } + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.symbols b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.symbols new file mode 100644 index 000000000..af3105570 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.symbols @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/jsdocCallbackParamQualifiedName.ts] //// + +=== bug.js === +/** + * @callback cb + * @param x.y + */ + +/** + * @callback cb2 + * @param {object} x + * @param {string} x.y + */ + +/** + * @overload + * @param {object} x + * @param {string} x.y + * @returns {string} + */ +/** + * @param {object} x + * @returns {string} + */ +function foo(x) { +>foo : Symbol(foo, Decl(bug.js, 12, 4), Decl(bug.js, 0, 0)) +>x : Symbol(x, Decl(bug.js, 21, 13)) + + return x.y; +>x : Symbol(x, Decl(bug.js, 21, 13)) +} + diff --git a/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.types b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.types new file mode 100644 index 000000000..5c2595bf0 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocCallbackParamQualifiedName.types @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/jsdocCallbackParamQualifiedName.ts] //// + +=== bug.js === +/** + * @callback cb + * @param x.y + */ + +/** + * @callback cb2 + * @param {object} x + * @param {string} x.y + */ + +/** + * @overload + * @param {object} x + * @param {string} x.y + * @returns {string} + */ +/** + * @param {object} x + * @returns {string} + */ +function foo(x) { +>foo : (x: { y: string; }) => string +>x : object + + return x.y; +>x.y : any +>x : object +>y : any +} + diff --git a/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.errors.txt b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.errors.txt new file mode 100644 index 000000000..cefbf0f9f --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.errors.txt @@ -0,0 +1,9 @@ +bug.js(2,12): error TS7006: Parameter 'this' implicitly has an 'any' type. + + +==== bug.js (1 errors) ==== + /** @this {object} */ + function f(this) {} + ~~~~ +!!! error TS7006: Parameter 'this' implicitly has an 'any' type. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.symbols b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.symbols new file mode 100644 index 000000000..50dcdcdb3 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.symbols @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/jsdocThisTagWithThisParameter.ts] //// + +=== bug.js === +/** @this {object} */ +function f(this) {} +>f : Symbol(f, Decl(bug.js, 0, 0)) +>this : Symbol(this, Decl(bug.js, 1, 11)) + diff --git a/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.types b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.types new file mode 100644 index 000000000..5348391d2 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsdocThisTagWithThisParameter.types @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/jsdocThisTagWithThisParameter.ts] //// + +=== bug.js === +/** @this {object} */ +function f(this) {} +>f : (this: any) => void +>this : any + diff --git a/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.errors.txt b/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.errors.txt new file mode 100644 index 000000000..c6524a1a9 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.errors.txt @@ -0,0 +1,17 @@ +jsxAttributeValueBinaryExpression.tsx(1,2): error TS2304: Cannot find name 'X'. +jsxAttributeValueBinaryExpression.tsx(1,6): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxAttributeValueBinaryExpression.tsx(1,6): error TS2657: JSX expressions must have one parent element. +jsxAttributeValueBinaryExpression.tsx(1,10): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + + +==== jsxAttributeValueBinaryExpression.tsx (4 errors) ==== + /> + ~ +!!! error TS2304: Cannot find name 'X'. + ~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~~~~ +!!! error TS2657: JSX expressions must have one parent element. + ~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.js b/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.js new file mode 100644 index 000000000..c15b7090c --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxAttributeValueBinaryExpression.js @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/jsxAttributeValueBinaryExpression.tsx] //// + +//// [jsxAttributeValueBinaryExpression.tsx] + /> + + +//// [jsxAttributeValueBinaryExpression.jsx] +"use strict"; +, />; diff --git a/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.errors.txt b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.errors.txt new file mode 100644 index 000000000..91dbdd609 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.errors.txt @@ -0,0 +1,14 @@ +jsxElementTypeUnexpectedType.tsx(7,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + + +==== jsxElementTypeUnexpectedType.tsx (1 errors) ==== + declare namespace JSX { + enum ElementType {} + } + + declare const C: () => any; + + const x = ; + ~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.js b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.js new file mode 100644 index 000000000..4fd414bcf --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsxElementTypeUnexpectedType.tsx] //// + +//// [jsxElementTypeUnexpectedType.tsx] +declare namespace JSX { + enum ElementType {} +} + +declare const C: () => any; + +const x = ; + + +//// [jsxElementTypeUnexpectedType.js] +"use strict"; +const x = React.createElement(C, null); diff --git a/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.symbols b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.symbols new file mode 100644 index 000000000..8c2998734 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/jsxElementTypeUnexpectedType.tsx] //// + +=== jsxElementTypeUnexpectedType.tsx === +declare namespace JSX { +>JSX : Symbol(JSX, Decl(jsxElementTypeUnexpectedType.tsx, 0, 0)) + + enum ElementType {} +>ElementType : Symbol(ElementType, Decl(jsxElementTypeUnexpectedType.tsx, 0, 23)) +} + +declare const C: () => any; +>C : Symbol(C, Decl(jsxElementTypeUnexpectedType.tsx, 4, 13)) + +const x = ; +>x : Symbol(x, Decl(jsxElementTypeUnexpectedType.tsx, 6, 5)) +>C : Symbol(C, Decl(jsxElementTypeUnexpectedType.tsx, 4, 13)) + diff --git a/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.types b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.types new file mode 100644 index 000000000..8b0a75440 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxElementTypeUnexpectedType.types @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/jsxElementTypeUnexpectedType.tsx] //// + +=== jsxElementTypeUnexpectedType.tsx === +declare namespace JSX { +>JSX : typeof JSX + + enum ElementType {} +>ElementType : ElementType +} + +declare const C: () => any; +>C : () => any + +const x = ; +>x : any +> : any +>C : () => any + diff --git a/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.errors.txt b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.errors.txt new file mode 100644 index 000000000..d13b9c16c --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.errors.txt @@ -0,0 +1,54 @@ +jsxEntityDecoderAfterNonEntityAmpersand.tsx(1,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(1,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(1,22): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(2,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(2,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(2,32): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(3,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(3,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(3,26): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(4,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(4,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(4,27): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(5,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(5,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxEntityDecoderAfterNonEntityAmpersand.tsx(5,26): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + + +==== jsxEntityDecoderAfterNonEntityAmpersand.tsx (15 errors) ==== + const a =
&&
; + ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + const b =
a&b&c&d<e
; + ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + const c =
&&
; + ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + const d =
&&&
; + ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + const e =
a&b&c&
; + ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.js b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.js new file mode 100644 index 000000000..1b150952a --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx] //// + +//// [jsxEntityDecoderAfterNonEntityAmpersand.tsx] +const a =
&&
; +const b =
a&b&c&d<e
; +const c =
&&
; +const d =
&&&
; +const e =
a&b&c&
; + + +//// [jsxEntityDecoderAfterNonEntityAmpersand.js] +"use strict"; +const a = React.createElement("div", null, "&&"); +const b = React.createElement("div", null, "a&b&c&d&&; +>a : Symbol(a, Decl(jsxEntityDecoderAfterNonEntityAmpersand.tsx, 0, 5)) + +const b =
a&b&c&d<e
; +>b : Symbol(b, Decl(jsxEntityDecoderAfterNonEntityAmpersand.tsx, 1, 5)) + +const c =
&&
; +>c : Symbol(c, Decl(jsxEntityDecoderAfterNonEntityAmpersand.tsx, 2, 5)) + +const d =
&&&
; +>d : Symbol(d, Decl(jsxEntityDecoderAfterNonEntityAmpersand.tsx, 3, 5)) + +const e =
a&b&c&
; +>e : Symbol(e, Decl(jsxEntityDecoderAfterNonEntityAmpersand.tsx, 4, 5)) + diff --git a/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.types b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.types new file mode 100644 index 000000000..e5c535898 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxEntityDecoderAfterNonEntityAmpersand.types @@ -0,0 +1,33 @@ +//// [tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx] //// + +=== jsxEntityDecoderAfterNonEntityAmpersand.tsx === +const a =
&&
; +>a : any +>
&&
: any +>div : any +>div : any + +const b =
a&b&c&d<e
; +>b : any +>
a&b&c&d<e
: any +>div : any +>div : any + +const c =
&&
; +>c : any +>
&&
: any +>div : any +>div : any + +const d =
&&&
; +>d : any +>
&&&
: any +>div : any +>div : any + +const e =
a&b&c&
; +>e : any +>
a&b&c&
: any +>div : any +>div : any + diff --git a/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.errors.txt b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.errors.txt new file mode 100644 index 000000000..afc278026 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.errors.txt @@ -0,0 +1,14 @@ +jsxLibraryManagedAttributesUnexpectedType.tsx(7,12): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + + +==== jsxLibraryManagedAttributesUnexpectedType.tsx (1 errors) ==== + declare namespace JSX { + enum LibraryManagedAttributes {} + } + + declare const C: () => any; + + const x = ; + ~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.js b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.js new file mode 100644 index 000000000..3f8e5308b --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx] //// + +//// [jsxLibraryManagedAttributesUnexpectedType.tsx] +declare namespace JSX { + enum LibraryManagedAttributes {} +} + +declare const C: () => any; + +const x = ; + + +//// [jsxLibraryManagedAttributesUnexpectedType.js] +"use strict"; +const x = React.createElement(C, null); diff --git a/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.symbols b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.symbols new file mode 100644 index 000000000..c5ec4576d --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx] //// + +=== jsxLibraryManagedAttributesUnexpectedType.tsx === +declare namespace JSX { +>JSX : Symbol(JSX, Decl(jsxLibraryManagedAttributesUnexpectedType.tsx, 0, 0)) + + enum LibraryManagedAttributes {} +>LibraryManagedAttributes : Symbol(LibraryManagedAttributes, Decl(jsxLibraryManagedAttributesUnexpectedType.tsx, 0, 23)) +} + +declare const C: () => any; +>C : Symbol(C, Decl(jsxLibraryManagedAttributesUnexpectedType.tsx, 4, 13)) + +const x = ; +>x : Symbol(x, Decl(jsxLibraryManagedAttributesUnexpectedType.tsx, 6, 5)) +>C : Symbol(C, Decl(jsxLibraryManagedAttributesUnexpectedType.tsx, 4, 13)) + diff --git a/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.types b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.types new file mode 100644 index 000000000..3c8fc52e3 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxLibraryManagedAttributesUnexpectedType.types @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx] //// + +=== jsxLibraryManagedAttributesUnexpectedType.tsx === +declare namespace JSX { +>JSX : typeof JSX + + enum LibraryManagedAttributes {} +>LibraryManagedAttributes : LibraryManagedAttributes +} + +declare const C: () => any; +>C : () => any + +const x = ; +>x : any +> : any +>C : () => any + diff --git a/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.errors.txt b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.errors.txt new file mode 100644 index 000000000..8fcaefb81 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.errors.txt @@ -0,0 +1,26 @@ +jsxSpreadWithAssertion.tsx(3,11): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + + +==== jsxSpreadWithAssertion.tsx (1 errors) ==== + declare const EntryTextDialog: any; + + const c = + ~~ +!!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.js b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.js new file mode 100644 index 000000000..8943c09c0 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/jsxSpreadWithAssertion.tsx] //// + +//// [jsxSpreadWithAssertion.tsx] +declare const EntryTextDialog: any; + +const c = + + +//// [jsxSpreadWithAssertion.js] +import { jsx as _jsx } from "react/jsx-runtime"; +const c = _jsx(EntryTextDialog, { first: 0, + foo: 1, + bar: 2, + baz: 3, + last: 4 }); diff --git a/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.symbols b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.symbols new file mode 100644 index 000000000..98d040bb5 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.symbols @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/jsxSpreadWithAssertion.tsx] //// + +=== jsxSpreadWithAssertion.tsx === +declare const EntryTextDialog: any; +>EntryTextDialog : Symbol(EntryTextDialog, Decl(jsxSpreadWithAssertion.tsx, 0, 13)) + +const c = c : Symbol(c, Decl(jsxSpreadWithAssertion.tsx, 2, 5)) +>EntryTextDialog : Symbol(EntryTextDialog, Decl(jsxSpreadWithAssertion.tsx, 0, 13)) + + {...{ + first: 0, +>first : Symbol(first, Decl(jsxSpreadWithAssertion.tsx, 3, 9)) + + foo: 1, +>foo : Symbol(foo, Decl(jsxSpreadWithAssertion.tsx, 4, 17)) + + bar: 2 as any, +>bar : Symbol(bar, Decl(jsxSpreadWithAssertion.tsx, 5, 15)) + + baz: 3, +>baz : Symbol(baz, Decl(jsxSpreadWithAssertion.tsx, 6, 22)) + + last: 4 +>last : Symbol(last, Decl(jsxSpreadWithAssertion.tsx, 7, 15)) + + }} +/> + diff --git a/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.types b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.types new file mode 100644 index 000000000..ff50150a7 --- /dev/null +++ b/testdata/baselines/reference/compiler/jsxSpreadWithAssertion.types @@ -0,0 +1,38 @@ +//// [tests/cases/compiler/jsxSpreadWithAssertion.tsx] //// + +=== jsxSpreadWithAssertion.tsx === +declare const EntryTextDialog: any; +>EntryTextDialog : any + +const c = c : any +> : any +>EntryTextDialog : any + + {...{ +>{ first: 0, foo: 1, bar: 2 as any, baz: 3, last: 4 } : { first: number; foo: number; bar: any; baz: number; last: number; } + + first: 0, +>first : number +>0 : 0 + + foo: 1, +>foo : number +>1 : 1 + + bar: 2 as any, +>bar : any +>2 as any : any +>2 : 2 + + baz: 3, +>baz : number +>3 : 3 + + last: 4 +>last : number +>4 : 4 + + }} +/> + diff --git a/testdata/baselines/reference/compiler/numericExportNameDeclaration.js b/testdata/baselines/reference/compiler/numericExportNameDeclaration.js new file mode 100644 index 000000000..c8f94b58b --- /dev/null +++ b/testdata/baselines/reference/compiler/numericExportNameDeclaration.js @@ -0,0 +1,41 @@ +//// [tests/cases/compiler/numericExportNameDeclaration.ts] //// + +//// [bug.js] +exports[1] = 2; +module.exports[1] = 2; +Object.defineProperty(exports, 1, {}); + + + + +//// [bug.d.ts] +declare const _exported: any; +export { _exported as "1" }; +declare const _exported_1: any; +export { _exported_1 as "1" }; +declare const _exported_2: any; +export { _exported_2 as "1" }; + + +//// [DtsFileErrors] + + +bug.d.ts(2,23): error TS2300: Duplicate identifier '"1"'. +bug.d.ts(4,25): error TS2300: Duplicate identifier '"1"'. +bug.d.ts(6,25): error TS2300: Duplicate identifier '"1"'. + + +==== bug.d.ts (3 errors) ==== + declare const _exported: any; + export { _exported as "1" }; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. + declare const _exported_1: any; + export { _exported_1 as "1" }; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. + declare const _exported_2: any; + export { _exported_2 as "1" }; + ~~~ +!!! error TS2300: Duplicate identifier '"1"'. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/numericExportNameDeclaration.symbols b/testdata/baselines/reference/compiler/numericExportNameDeclaration.symbols new file mode 100644 index 000000000..4d1b3998f --- /dev/null +++ b/testdata/baselines/reference/compiler/numericExportNameDeclaration.symbols @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/numericExportNameDeclaration.ts] //// + +=== bug.js === +exports[1] = 2; +>exports : Symbol(exports, Decl(bug.js, 0, 0)) +>1 : Symbol(1, Decl(bug.js, 0, 0), Decl(bug.js, 0, 15), Decl(bug.js, 1, 22)) + +module.exports[1] = 2; +>module.exports : Symbol(exports, Decl(bug.js, 0, 0)) +>module : Symbol(module, Decl(bug.js, 0, 0)) +>exports : Symbol(exports, Decl(bug.js, 0, 0)) +>1 : Symbol(1, Decl(bug.js, 0, 0), Decl(bug.js, 0, 15), Decl(bug.js, 1, 22)) + +Object.defineProperty(exports, 1, {}); +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>exports : Symbol(exports, Decl(bug.js, 0, 0)) + diff --git a/testdata/baselines/reference/compiler/numericExportNameDeclaration.types b/testdata/baselines/reference/compiler/numericExportNameDeclaration.types new file mode 100644 index 000000000..00507e0eb --- /dev/null +++ b/testdata/baselines/reference/compiler/numericExportNameDeclaration.types @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/numericExportNameDeclaration.ts] //// + +=== bug.js === +exports[1] = 2; +>exports[1] = 2 : 2 +>exports[1] : any +>exports : typeof import("./bug") +>1 : 1 +>2 : 2 + +module.exports[1] = 2; +>module.exports[1] = 2 : 2 +>module.exports[1] : error +>module.exports : typeof import("./bug") +>module : { exports: typeof import("./bug"); } +>exports : typeof import("./bug") +>1 : 1 +>2 : 2 + +Object.defineProperty(exports, 1, {}); +>Object.defineProperty(exports, 1, {}) : typeof import("./bug") +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : typeof import("./bug") +>1 : 1 +>{} : {} + diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).errors.txt b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).errors.txt new file mode 100644 index 000000000..af25cb10c --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).errors.txt @@ -0,0 +1,9 @@ +objectNameCollisionCommonJS.ts(1,5): error TS2441: Duplicate identifier 'Object'. Compiler reserves name 'Object' in top level scope of a module. + + +==== objectNameCollisionCommonJS.ts (1 errors) ==== + let Object = 0; + ~~~~~~ +!!! error TS2441: Duplicate identifier 'Object'. Compiler reserves name 'Object' in top level scope of a module. + export const x = 1; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).js b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).js new file mode 100644 index 000000000..12b639d84 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +//// [objectNameCollisionCommonJS.ts] +let Object = 0; +export const x = 1; + + +//// [objectNameCollisionCommonJS.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +let Object = 0; +exports.x = 1; diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).symbols b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).symbols new file mode 100644 index 000000000..f0e43d194 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).symbols @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +=== objectNameCollisionCommonJS.ts === +let Object = 0; +>Object : Symbol(Object, Decl(objectNameCollisionCommonJS.ts, 0, 3)) + +export const x = 1; +>x : Symbol(x, Decl(objectNameCollisionCommonJS.ts, 1, 12)) + diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).types b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).types new file mode 100644 index 000000000..01c85bc59 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=commonjs).types @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +=== objectNameCollisionCommonJS.ts === +let Object = 0; +>Object : number +>0 : 0 + +export const x = 1; +>x : 1 +>1 : 1 + diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).js b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).js new file mode 100644 index 000000000..e80ffabc4 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).js @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +//// [objectNameCollisionCommonJS.ts] +let Object = 0; +export const x = 1; + + +//// [objectNameCollisionCommonJS.js] +let Object = 0; +export const x = 1; diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).symbols b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).symbols new file mode 100644 index 000000000..f0e43d194 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).symbols @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +=== objectNameCollisionCommonJS.ts === +let Object = 0; +>Object : Symbol(Object, Decl(objectNameCollisionCommonJS.ts, 0, 3)) + +export const x = 1; +>x : Symbol(x, Decl(objectNameCollisionCommonJS.ts, 1, 12)) + diff --git a/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).types b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).types new file mode 100644 index 000000000..01c85bc59 --- /dev/null +++ b/testdata/baselines/reference/compiler/objectNameCollisionCommonJS(module=esnext).types @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/objectNameCollisionCommonJS.ts] //// + +=== objectNameCollisionCommonJS.ts === +let Object = 0; +>Object : number +>0 : 0 + +export const x = 1; +>x : 1 +>1 : 1 + diff --git a/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.errors.txt b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.errors.txt new file mode 100644 index 000000000..9c3f8ba28 --- /dev/null +++ b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.errors.txt @@ -0,0 +1,10 @@ +templateLiteralTypeTooComplex.ts(3,10): error TS2590: Expression produces a union type that is too complex to represent. + + +==== templateLiteralTypeTooComplex.ts (1 errors) ==== + // Large template literal types with combinatorial explosion should produce an error, not hang. + type N = 0 | 1 | 2 | 3; + type T = `${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2590: Expression produces a union type that is too complex to represent. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.js b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.js new file mode 100644 index 000000000..56d95ddb7 --- /dev/null +++ b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.js @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/templateLiteralTypeTooComplex.ts] //// + +//// [templateLiteralTypeTooComplex.ts] +// Large template literal types with combinatorial explosion should produce an error, not hang. +type N = 0 | 1 | 2 | 3; +type T = `${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}`; + + +//// [templateLiteralTypeTooComplex.js] +"use strict"; diff --git a/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.symbols b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.symbols new file mode 100644 index 000000000..6b9ef9e00 --- /dev/null +++ b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.symbols @@ -0,0 +1,59 @@ +//// [tests/cases/compiler/templateLiteralTypeTooComplex.ts] //// + +=== templateLiteralTypeTooComplex.ts === +// Large template literal types with combinatorial explosion should produce an error, not hang. +type N = 0 | 1 | 2 | 3; +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) + +type T = `${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}`; +>T : Symbol(T, Decl(templateLiteralTypeTooComplex.ts, 1, 23)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) +>N : Symbol(N, Decl(templateLiteralTypeTooComplex.ts, 0, 0)) + diff --git a/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.types b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.types new file mode 100644 index 000000000..ef8042013 --- /dev/null +++ b/testdata/baselines/reference/compiler/templateLiteralTypeTooComplex.types @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/templateLiteralTypeTooComplex.ts] //// + +=== templateLiteralTypeTooComplex.ts === +// Large template literal types with combinatorial explosion should produce an error, not hang. +type N = 0 | 1 | 2 | 3; +>N : N + +type T = `${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}`; +>T : any + diff --git a/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.errors.txt b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.errors.txt new file mode 100644 index 000000000..f6052522d --- /dev/null +++ b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.errors.txt @@ -0,0 +1,13 @@ +error TS2688: Cannot find type definition file for 'nonexistent'. + The file is in the program because: + Entry point of type library 'nonexistent' specified in compilerOptions + + +!!! error TS2688: Cannot find type definition file for 'nonexistent'. +!!! error TS2688: The file is in the program because: +!!! error TS2688: Entry point of type library 'nonexistent' specified in compilerOptions +==== tsconfig.json (0 errors) ==== + [{"compilerOptions": {"types": ["nonexistent"]}}] +==== index.ts (0 errors) ==== + export const x = 1; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.js b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.js new file mode 100644 index 000000000..6002c9957 --- /dev/null +++ b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.js @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/tsconfigMalformedNonObject.ts] //// + +//// [index.ts] +export const x = 1; + + +//// [index.js] +export const x = 1; diff --git a/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.symbols b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.symbols new file mode 100644 index 000000000..3fbdd476a --- /dev/null +++ b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/tsconfigMalformedNonObject.ts] //// + +=== index.ts === +export const x = 1; +>x : Symbol(x, Decl(index.ts, 0, 12)) + diff --git a/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.types b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.types new file mode 100644 index 000000000..4ba65763e --- /dev/null +++ b/testdata/baselines/reference/compiler/tsconfigMalformedNonObject.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/tsconfigMalformedNonObject.ts] //// + +=== index.ts === +export const x = 1; +>x : 1 +>1 : 1 + diff --git a/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.errors.txt b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.errors.txt new file mode 100644 index 000000000..2dec61a01 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.errors.txt @@ -0,0 +1,8 @@ +typeOnlyExportAsIfBody.ts(1,11): error TS1233: An export declaration can only be used at the top level of a namespace or module. + + +==== typeOnlyExportAsIfBody.ts (1 errors) ==== + if (true) export type {}; + ~~~~~~ +!!! error TS1233: An export declaration can only be used at the top level of a namespace or module. + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.js b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.js new file mode 100644 index 000000000..cabf288d5 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.js @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/typeOnlyExportAsIfBody.ts] //// + +//// [typeOnlyExportAsIfBody.ts] +if (true) export type {}; + + +//// [typeOnlyExportAsIfBody.js] +"use strict"; +if (true) + ; diff --git a/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.symbols b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.symbols new file mode 100644 index 000000000..0e5778eb1 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/typeOnlyExportAsIfBody.ts] //// + +=== typeOnlyExportAsIfBody.ts === + +if (true) export type {}; + diff --git a/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.types b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.types new file mode 100644 index 000000000..65291b44f --- /dev/null +++ b/testdata/baselines/reference/compiler/typeOnlyExportAsIfBody.types @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/typeOnlyExportAsIfBody.ts] //// + +=== typeOnlyExportAsIfBody.ts === +if (true) export type {}; +>true : true + diff --git a/testdata/baselines/reference/compiler/typeRootsRelativePath.errors.txt b/testdata/baselines/reference/compiler/typeRootsRelativePath.errors.txt new file mode 100644 index 000000000..49773c775 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeRootsRelativePath.errors.txt @@ -0,0 +1,11 @@ +error TS2688: Cannot find type definition file for 'n'. + The file is in the program because: + Entry point of type library 'n' specified in compilerOptions + + +!!! error TS2688: Cannot find type definition file for 'n'. +!!! error TS2688: The file is in the program because: +!!! error TS2688: Entry point of type library 'n' specified in compilerOptions +==== typeRootsRelativePath.ts (0 errors) ==== + let x = 1; + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/typeRootsRelativePath.symbols b/testdata/baselines/reference/compiler/typeRootsRelativePath.symbols new file mode 100644 index 000000000..eedc64cae --- /dev/null +++ b/testdata/baselines/reference/compiler/typeRootsRelativePath.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/typeRootsRelativePath.ts] //// + +=== typeRootsRelativePath.ts === +let x = 1; +>x : Symbol(x, Decl(typeRootsRelativePath.ts, 0, 3)) + diff --git a/testdata/baselines/reference/compiler/typeRootsRelativePath.types b/testdata/baselines/reference/compiler/typeRootsRelativePath.types new file mode 100644 index 000000000..75d5df198 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeRootsRelativePath.types @@ -0,0 +1,7 @@ +//// [tests/cases/compiler/typeRootsRelativePath.ts] //// + +=== typeRootsRelativePath.ts === +let x = 1; +>x : number +>1 : 1 + diff --git a/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.errors.txt b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.errors.txt new file mode 100644 index 000000000..a160a2075 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.errors.txt @@ -0,0 +1,17 @@ +typeofSwitchEmptyStringCase.ts(5,10): error TS2678: Type '""' is not comparable to type '"bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined"'. + + +==== typeofSwitchEmptyStringCase.ts (1 errors) ==== + // https://github.com/microsoft/typescript-go/issues/3909 + + function f(x: string | number) { + switch (typeof x) { + case "": + ~~ +!!! error TS2678: Type '""' is not comparable to type '"bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined"'. + case "string": + x.charAt(0); + break; + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.symbols b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.symbols new file mode 100644 index 000000000..b8f0a9ec1 --- /dev/null +++ b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.symbols @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/typeofSwitchEmptyStringCase.ts] //// + +=== typeofSwitchEmptyStringCase.ts === +// https://github.com/microsoft/typescript-go/issues/3909 + +function f(x: string | number) { +>f : Symbol(f, Decl(typeofSwitchEmptyStringCase.ts, 0, 0)) +>x : Symbol(x, Decl(typeofSwitchEmptyStringCase.ts, 2, 11)) + + switch (typeof x) { +>x : Symbol(x, Decl(typeofSwitchEmptyStringCase.ts, 2, 11)) + + case "": + case "string": + x.charAt(0); +>x.charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(typeofSwitchEmptyStringCase.ts, 2, 11)) +>charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --)) + + break; + } +} + diff --git a/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.types b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.types new file mode 100644 index 000000000..bf16eba7f --- /dev/null +++ b/testdata/baselines/reference/compiler/typeofSwitchEmptyStringCase.types @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/typeofSwitchEmptyStringCase.ts] //// + +=== typeofSwitchEmptyStringCase.ts === +// https://github.com/microsoft/typescript-go/issues/3909 + +function f(x: string | number) { +>f : (x: string | number) => void +>x : string | number + + switch (typeof x) { +>typeof x : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" +>x : string | number + + case "": +>"" : "" + + case "string": +>"string" : "string" + + x.charAt(0); +>x.charAt(0) : string +>x.charAt : (pos: number) => string +>x : string +>charAt : (pos: number) => string +>0 : 0 + + break; + } +} + diff --git a/testdata/baselines/reference/compiler/unicodeSurrogatesInStringLiterals.js b/testdata/baselines/reference/compiler/unicodeSurrogatesInStringLiterals.js index e33c23955..e7e054a68 100644 --- a/testdata/baselines/reference/compiler/unicodeSurrogatesInStringLiterals.js +++ b/testdata/baselines/reference/compiler/unicodeSurrogatesInStringLiterals.js @@ -36,9 +36,9 @@ export const lowHigh = "\ude03\ud83d"; //// [unicodeSurrogatesInStringLiterals.d.ts] -export declare const highLow: "\uD83D\uDE03"; -export declare const high: "\uFFFD"; -export declare const low: "\uFFFD"; -export declare const highHigh: "\uFFFD\uFFFD"; -export declare const lowLow: "\uFFFD\uFFFD"; -export declare const lowHigh: "\uFFFD\uFFFD"; +export declare const highLow: "😃"; +export declare const high: "�"; +export declare const low: "�"; +export declare const highHigh: "��"; +export declare const lowLow: "��"; +export declare const lowHigh: "��"; diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespacesVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespacesVS.baseline new file mode 100644 index 000000000..de0cb0081 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocDontBreakWithNamespacesVS.baseline @@ -0,0 +1,175 @@ +// === SignatureHelp === +=== /jsDocDontBreakWithNamespaces.js === +// /** +// * @returns {module:@nodefuel/web~Webserver~wsServer#hello} Websocket server object +// */ +// function foo() { } +// foo(''); +// ^ +// | ---------------------------------------------------------------------- +// | foo(): module +// | ---------------------------------------------------------------------- +// +// /** +// * @type {module:xxxxx} */ +// */ +// function bar() { } +// bar(''); +// ^ +// | ---------------------------------------------------------------------- +// | bar(): void +// | ---------------------------------------------------------------------- +// +// /** @type {function(module:xxxx, module:xxxx): module:xxxxx} */ +// function zee() { } +// zee(''); +// ^ +// | ---------------------------------------------------------------------- +// | zee(): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 117, + "LSPosition": { + "line": 4, + "character": 6 + }, + "Name": "foo", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "foo(): module", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "module" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 181, + "LSPosition": { + "line": 10, + "character": 6 + }, + "Name": "bar", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "bar(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "bar" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 274, + "LSPosition": { + "line": 14, + "character": 6 + }, + "Name": "zee", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "zee(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "zee" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5VS.baseline new file mode 100644 index 000000000..b45595499 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures5VS.baseline @@ -0,0 +1,201 @@ +// === SignatureHelp === +=== /Foo.js === +// /** +// * Filters a path based on a regexp or glob pattern. +// * @param {String} basePath The base path where the search will be performed. +// * @param {String} pattern A string defining a regexp of a glob pattern. +// * @param {String} type The search pattern type, can be a regexp or a glob. +// * @param {Object} options A object containing options to the search. +// * @return {Array} A list containing the filtered paths. +// */ +// function pathFilter(basePath, pattern, type, options){ +// //... +// } +// pathFilter('foo', 'bar', 'baz', {}); +// ^ +// | ---------------------------------------------------------------------- +// | pathFilter(**basePath: string**, pattern: string, type: string, options: Object): any[] +// | - `basePath: string`: The base path where the search will be performed. + +// | Filters a path based on a regexp or glob pattern. +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 489, + "LSPosition": { + "line": 11, + "character": 11 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "pathFilter(basePath: string, pattern: string, type: string, options: Object): any[]", + "documentation": { + "kind": "markdown", + "value": "Filters a path based on a regexp or glob pattern." + }, + "parameters": [ + { + "label": "basePath: string", + "documentation": { + "kind": "markdown", + "value": "The base path where the search will be performed.\n" + } + }, + { + "label": "pattern: string", + "documentation": { + "kind": "markdown", + "value": "A string defining a regexp of a glob pattern.\n" + } + }, + { + "label": "type: string", + "documentation": { + "kind": "markdown", + "value": "The search pattern type, can be a regexp or a glob.\n" + } + }, + { + "label": "options: Object", + "documentation": { + "kind": "markdown", + "value": "A object containing options to the search.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "pathFilter" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "basePath" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "pattern" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "options" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Object" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6VS.baseline new file mode 100644 index 000000000..8c0ca6efa --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsDocFunctionSignatures6VS.baseline @@ -0,0 +1,796 @@ +// === SignatureHelp === +=== /Foo.js === +// /** +// * @param {string} p1 - A string param +// * @param {string?} p2 - An optional param +// * @param {string} [p3] - Another optional param +// * @param {string} [p4="test"] - An optional param with a default value +// */ +// function f1(p1, p2, p3, p4){} +// f1('foo', 'bar', 'baz', 'qux'); +// ^ +// | ---------------------------------------------------------------------- +// | f1(**p1: string**, p2: string | null, p3?: string, p4?: string): void +// | - `p1: string`: - A string param + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | f1(p1: string, **p2: string | null**, p3?: string, p4?: string): void +// | - `p2: string | null`: - An optional param + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | f1(p1: string, p2: string | null, **p3?: string**, p4?: string): void +// | - `p3?: string`: - Another optional param + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | f1(p1: string, p2: string | null, p3?: string, **p4?: string**): void +// | - `p4?: string`: - An optional param with a default value + +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 244, + "LSPosition": { + "line": 7, + "character": 3 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(p1: string, p2: string | null, p3?: string, p4?: string): void", + "parameters": [ + { + "label": "p1: string", + "documentation": { + "kind": "markdown", + "value": "- A string param\n" + } + }, + { + "label": "p2: string | null", + "documentation": { + "kind": "markdown", + "value": "- An optional param\n" + } + }, + { + "label": "p3?: string", + "documentation": { + "kind": "markdown", + "value": "- Another optional param\n" + } + }, + { + "label": "p4?: string", + "documentation": { + "kind": "markdown", + "value": "- An optional param with a default value\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "null" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 251, + "LSPosition": { + "line": 7, + "character": 10 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(p1: string, p2: string | null, p3?: string, p4?: string): void", + "parameters": [ + { + "label": "p1: string", + "documentation": { + "kind": "markdown", + "value": "- A string param\n" + } + }, + { + "label": "p2: string | null", + "documentation": { + "kind": "markdown", + "value": "- An optional param\n" + } + }, + { + "label": "p3?: string", + "documentation": { + "kind": "markdown", + "value": "- Another optional param\n" + } + }, + { + "label": "p4?: string", + "documentation": { + "kind": "markdown", + "value": "- An optional param with a default value\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "null" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 258, + "LSPosition": { + "line": 7, + "character": 17 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(p1: string, p2: string | null, p3?: string, p4?: string): void", + "parameters": [ + { + "label": "p1: string", + "documentation": { + "kind": "markdown", + "value": "- A string param\n" + } + }, + { + "label": "p2: string | null", + "documentation": { + "kind": "markdown", + "value": "- An optional param\n" + } + }, + { + "label": "p3?: string", + "documentation": { + "kind": "markdown", + "value": "- Another optional param\n" + } + }, + { + "label": "p4?: string", + "documentation": { + "kind": "markdown", + "value": "- An optional param with a default value\n" + } + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "null" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 265, + "LSPosition": { + "line": 7, + "character": 24 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(p1: string, p2: string | null, p3?: string, p4?: string): void", + "parameters": [ + { + "label": "p1: string", + "documentation": { + "kind": "markdown", + "value": "- A string param\n" + } + }, + { + "label": "p2: string | null", + "documentation": { + "kind": "markdown", + "value": "- An optional param\n" + } + }, + { + "label": "p3?: string", + "documentation": { + "kind": "markdown", + "value": "- Another optional param\n" + } + }, + { + "label": "p4?: string", + "documentation": { + "kind": "markdown", + "value": "- An optional param with a default value\n" + } + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "null" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "p4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTagVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTagVS.baseline new file mode 100644 index 000000000..4ad15c9ac --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/jsdocReturnsTagVS.baseline @@ -0,0 +1,127 @@ +// === SignatureHelp === +=== /dummy.js === +// /** +// * Find an item +// * @template T +// * @param {T[]} l +// * @param {T} x +// * @returns {?T} The names of the found item(s). +// */ +// function find(l, x) { +// } +// find(''); +// ^ +// | ---------------------------------------------------------------------- +// | find(**l: any[]**, x: any): any +// | Find an item +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 154, + "LSPosition": { + "line": 9, + "character": 7 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "find(l: any[], x: any): any", + "documentation": { + "kind": "markdown", + "value": "Find an item" + }, + "parameters": [ + { + "label": "l: any[]" + }, + { + "label": "x: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "find" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "l" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTags13VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTags13VS.baseline new file mode 100644 index 000000000..2a8737abc --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTags13VS.baseline @@ -0,0 +1,278 @@ +// === SignatureHelp === +=== /a.js === +// /** +// * First overload +// * @overload +// * @param {number} a +// * @returns {void} +// */ +// +// /** +// * Second overload +// * @overload +// * @param {string} a +// * @returns {void} +// */ +// +// /** +// * @param {string | number} a +// * @returns {void} +// */ +// function f(a) {} +// +// f(1); +// ^ +// | ---------------------------------------------------------------------- +// | f(**a: number**): void +// | ---------------------------------------------------------------------- +// f(""); +// ^ +// | ---------------------------------------------------------------------- +// | f(**a: string**): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 238, + "LSPosition": { + "line": 20, + "character": 2 + }, + "Name": "a", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number): void", + "parameters": [ + { + "label": "a: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "f(a: string): void", + "parameters": [ + { + "label": "a: string" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 244, + "LSPosition": { + "line": 21, + "character": 2 + }, + "Name": "b", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number): void", + "parameters": [ + { + "label": "a: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "f(a: string): void", + "parameters": [ + { + "label": "a: string" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 1 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1VS.baseline new file mode 100644 index 000000000..f750e66c7 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/quickInfoJsDocTextFormatting1VS.baseline @@ -0,0 +1,595 @@ +// === SignatureHelp === +=== /quickInfoJsDocTextFormatting1VS.ts === +// /** +// * @param {number} var1 **Highlighted text** +// * @param {string} var2 Another **Highlighted text** +// */ +// function f1(var1, var2) { } +// +// /** +// * @param {number} var1 *Regular text with an asterisk +// * @param {string} var2 Another *Regular text with an asterisk +// */ +// function f2(var1, var2) { } +// +// /** +// * @param {number} var1 +// * *Regular text with an asterisk +// * @param {string} var2 +// * Another *Regular text with an asterisk +// */ +// function f3(var1, var2) { } +// +// /** +// * @param {number} var1 +// * **Highlighted text** +// * @param {string} var2 +// * Another **Highlighted text** +// */ +// function f4(var1, var2) { } +// +// /** +// * @param {number} var1 +// **Highlighted text** +// * @param {string} var2 +// Another **Highlighted text** +// */ +// function f5(var1, var2) { } +// +// f1(); +// ^ +// | ---------------------------------------------------------------------- +// | f1(**var1: any**, var2: any): void +// | - `var1: any`: **Highlighted text** + +// | ---------------------------------------------------------------------- +// f2(); +// ^ +// | ---------------------------------------------------------------------- +// | f2(**var1: any**, var2: any): void +// | - `var1: any`: *Regular text with an asterisk + +// | ---------------------------------------------------------------------- +// f3(); +// ^ +// | ---------------------------------------------------------------------- +// | f3(**var1: any**, var2: any): void +// | - `var1: any`: *Regular text with an asterisk + +// | ---------------------------------------------------------------------- +// f4(); +// ^ +// | ---------------------------------------------------------------------- +// | f4(**var1: any**, var2: any): void +// | - `var1: any`: **Highlighted text** + +// | ---------------------------------------------------------------------- +// f5(); +// ^ +// | ---------------------------------------------------------------------- +// | f5(**var1: any**, var2: any): void +// | - `var1: any`: **Highlighted text** + +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 737, + "LSPosition": { + "line": 36, + "character": 3 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(var1: any, var2: any): void", + "parameters": [ + { + "label": "var1: any", + "documentation": { + "kind": "markdown", + "value": "**Highlighted text**\n" + } + }, + { + "label": "var2: any", + "documentation": { + "kind": "markdown", + "value": "Another **Highlighted text**\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 743, + "LSPosition": { + "line": 37, + "character": 3 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f2(var1: any, var2: any): void", + "parameters": [ + { + "label": "var1: any", + "documentation": { + "kind": "markdown", + "value": "*Regular text with an asterisk\n" + } + }, + { + "label": "var2: any", + "documentation": { + "kind": "markdown", + "value": "Another *Regular text with an asterisk\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 749, + "LSPosition": { + "line": 38, + "character": 3 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f3(var1: any, var2: any): void", + "parameters": [ + { + "label": "var1: any", + "documentation": { + "kind": "markdown", + "value": "*Regular text with an asterisk\n" + } + }, + { + "label": "var2: any", + "documentation": { + "kind": "markdown", + "value": "Another *Regular text with an asterisk\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 755, + "LSPosition": { + "line": 39, + "character": 3 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f4(var1: any, var2: any): void", + "parameters": [ + { + "label": "var1: any", + "documentation": { + "kind": "markdown", + "value": "**Highlighted text**\n" + } + }, + { + "label": "var2: any", + "documentation": { + "kind": "markdown", + "value": "Another **Highlighted text**\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 761, + "LSPosition": { + "line": 40, + "character": 3 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f5(var1: any, var2: any): void", + "parameters": [ + { + "label": "var1: any", + "documentation": { + "kind": "markdown", + "value": "**Highlighted text**\n" + } + }, + { + "label": "var2: any", + "documentation": { + "kind": "markdown", + "value": "Another **Highlighted text**\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "var2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAfterParameterVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAfterParameterVS.baseline new file mode 100644 index 000000000..02ebb0d85 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAfterParameterVS.baseline @@ -0,0 +1,1532 @@ +// === SignatureHelp === +=== /signatureHelpAfterParameterVS.ts === +// type Type = (a, b, c) => void +// const a: Type = (a, b) => {} +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, **b: any**, c: any): void +// | ---------------------------------------------------------------------- +// const b: Type = function (a, b) {} +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, **b: any**, c: any): void +// | ---------------------------------------------------------------------- +// const c: Type = ({ a: { b }} = { }, [b], ...c) => {} +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(**a: any**, b: any, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, **b: any**, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, **b: any**, c: any): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, b: any, **c: any**): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | Type(a: any, b: any, **c: any**): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 48, + "LSPosition": { + "line": 1, + "character": 18 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 51, + "LSPosition": { + "line": 1, + "character": 21 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 86, + "LSPosition": { + "line": 2, + "character": 27 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 89, + "LSPosition": { + "line": 2, + "character": 30 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 113, + "LSPosition": { + "line": 3, + "character": 19 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 119, + "LSPosition": { + "line": 3, + "character": 25 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 122, + "LSPosition": { + "line": 3, + "character": 28 + }, + "Name": "7", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 128, + "LSPosition": { + "line": 3, + "character": 34 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 132, + "LSPosition": { + "line": 3, + "character": 38 + }, + "Name": "9", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 133, + "LSPosition": { + "line": 3, + "character": 39 + }, + "Name": "10", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 138, + "LSPosition": { + "line": 3, + "character": 44 + }, + "Name": "11", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 139, + "LSPosition": { + "line": 3, + "character": 45 + }, + "Name": "12", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Type(a: any, b: any, c: any): void", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + }, + { + "label": "c: any" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "identifier", + "Text": "Type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAnonymousTypeVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAnonymousTypeVS.baseline new file mode 100644 index 000000000..c53949589 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpAnonymousTypeVS.baseline @@ -0,0 +1,107 @@ +// === SignatureHelp === +=== /signatureHelpAnonymousTypeVS.ts === +// const comparers: Array<(a: any, b: any) => boolean> = []; +// +// comparers.push((a, b) => true); +// ^ +// | ---------------------------------------------------------------------- +// | type(a: any, **b: any**): boolean +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 77, + "LSPosition": { + "line": 2, + "character": 18 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "�type(a: any, b: any): boolean", + "parameters": [ + { + "label": "a: any" + }, + { + "label": "b: any" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "text", + "Text": "�type" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "boolean" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPattern.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPattern.baseline index c6339b438..ecddae751 100644 --- a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPattern.baseline +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPattern.baseline @@ -32,14 +32,8 @@ // nonEmptyObj() // ^ // | ---------------------------------------------------------------------- -// | nonEmptyObj(**{ a, b, }: { - a: number; - b: string; -}**): void -// | - `{ a, b, }: { - a: number; - b: string; -}`: An object with a and b properties. +// | nonEmptyObj(**{ a, b }: { a: number; b: string; }**): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. // | ---------------------------------------------------------------------- // @@ -50,14 +44,8 @@ // nonEmptyArr() // ^ // | ---------------------------------------------------------------------- -// | nonEmptyArr(**[x, y,]: [ - number, - string -]**): void -// | - `[x, y,]: [ - number, - string -]`: A tuple with two elements. +// | nonEmptyArr(**[x, y]: [number, string]**): void +// | - `[x, y]: [number, string]`: A tuple with two elements. // | ---------------------------------------------------------------------- // @@ -69,23 +57,14 @@ // idLeading(123, { a: 1, b: 2 }) // ^ // | ---------------------------------------------------------------------- -// | idLeading(**first: number**, { a, b, }: { - a: number; - b: string; -}): void +// | idLeading(**first: number**, { a, b }: { a: number; b: string; }): void // | - `first: number`: The first number parameter. // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- -// | idLeading(first: number, **{ a, b, }: { - a: number; - b: string; -}**): void -// | - `{ a, b, }: { - a: number; - b: string; -}`: An object with a and b properties. +// | idLeading(first: number, **{ a, b }: { a: number; b: string; }**): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. // | ---------------------------------------------------------------------- // @@ -97,22 +76,13 @@ // bindingLeading({ a: 1, b: 2 }, 123 ) // ^ // | ---------------------------------------------------------------------- -// | bindingLeading(**{ a, b, }: { - a: number; - b: string; -}**, last: number): void -// | - `{ a, b, }: { - a: number; - b: string; -}`: An object with a and b properties. +// | bindingLeading(**{ a, b }: { a: number; b: string; }**, last: number): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- -// | bindingLeading({ a, b, }: { - a: number; - b: string; -}, **last: number**): void +// | bindingLeading({ a, b }: { a: number; b: string; }, **last: number**): void // | - `last: number`: The last number parameter. // | ---------------------------------------------------------------------- @@ -129,32 +99,14 @@ // multipleBindings({ a: 0, b: "" }, { c: true, d: "" }) // ^ // | ---------------------------------------------------------------------- -// | multipleBindings(**{ a, b, }: { - a: any; - b: any; -}**, { c, d, }: { - c: any; - d: any; -}): void -// | - `{ a, b, }: { - a: any; - b: any; -}`: The first parameter +// | multipleBindings(**{ a, b }: { a: any; b: any; }**, { c, d }: { c: any; d: any; }): void +// | - `{ a, b }: { a: any; b: any; }`: The first parameter // | ---------------------------------------------------------------------- // ^ // | ---------------------------------------------------------------------- -// | multipleBindings({ a, b, }: { - a: any; - b: any; -}, **{ c, d, }: { - c: any; - d: any; -}**): void -// | - `{ c, d, }: { - c: any; - d: any; -}`: The second parameter +// | multipleBindings({ a, b }: { a: any; b: any; }, **{ c, d }: { c: any; d: any; }**): void +// | - `{ c, d }: { c: any; d: any; }`: The second parameter // | ---------------------------------------------------------------------- // @@ -230,10 +182,10 @@ "item": { "signatures": [ { - "label": "nonEmptyObj({ a, b, }: {\n a: number;\n b: string;\n}): void", + "label": "nonEmptyObj({ a, b }: { a: number; b: string; }): void", "parameters": [ { - "label": "{ a, b, }: {\n a: number;\n b: string;\n}", + "label": "{ a, b }: { a: number; b: string; }", "documentation": { "kind": "markdown", "value": "An object with a and b properties.\n" @@ -259,10 +211,10 @@ "item": { "signatures": [ { - "label": "nonEmptyArr([x, y,]: [\n number,\n string\n]): void", + "label": "nonEmptyArr([x, y]: [number, string]): void", "parameters": [ { - "label": "[x, y,]: [\n number,\n string\n]", + "label": "[x, y]: [number, string]", "documentation": { "kind": "markdown", "value": "A tuple with two elements.\n" @@ -288,7 +240,7 @@ "item": { "signatures": [ { - "label": "idLeading(first: number, { a, b, }: {\n a: number;\n b: string;\n}): void", + "label": "idLeading(first: number, { a, b }: { a: number; b: string; }): void", "parameters": [ { "label": "first: number", @@ -298,7 +250,7 @@ } }, { - "label": "{ a, b, }: {\n a: number;\n b: string;\n}", + "label": "{ a, b }: { a: number; b: string; }", "documentation": { "kind": "markdown", "value": "An object with a and b properties.\n" @@ -324,7 +276,7 @@ "item": { "signatures": [ { - "label": "idLeading(first: number, { a, b, }: {\n a: number;\n b: string;\n}): void", + "label": "idLeading(first: number, { a, b }: { a: number; b: string; }): void", "parameters": [ { "label": "first: number", @@ -334,7 +286,7 @@ } }, { - "label": "{ a, b, }: {\n a: number;\n b: string;\n}", + "label": "{ a, b }: { a: number; b: string; }", "documentation": { "kind": "markdown", "value": "An object with a and b properties.\n" @@ -360,10 +312,10 @@ "item": { "signatures": [ { - "label": "bindingLeading({ a, b, }: {\n a: number;\n b: string;\n}, last: number): void", + "label": "bindingLeading({ a, b }: { a: number; b: string; }, last: number): void", "parameters": [ { - "label": "{ a, b, }: {\n a: number;\n b: string;\n}", + "label": "{ a, b }: { a: number; b: string; }", "documentation": { "kind": "markdown", "value": "An object with a and b properties.\n" @@ -396,10 +348,10 @@ "item": { "signatures": [ { - "label": "bindingLeading({ a, b, }: {\n a: number;\n b: string;\n}, last: number): void", + "label": "bindingLeading({ a, b }: { a: number; b: string; }, last: number): void", "parameters": [ { - "label": "{ a, b, }: {\n a: number;\n b: string;\n}", + "label": "{ a, b }: { a: number; b: string; }", "documentation": { "kind": "markdown", "value": "An object with a and b properties.\n" @@ -432,17 +384,17 @@ "item": { "signatures": [ { - "label": "multipleBindings({ a, b, }: {\n a: any;\n b: any;\n}, { c, d, }: {\n c: any;\n d: any;\n}): void", + "label": "multipleBindings({ a, b }: { a: any; b: any; }, { c, d }: { c: any; d: any; }): void", "parameters": [ { - "label": "{ a, b, }: {\n a: any;\n b: any;\n}", + "label": "{ a, b }: { a: any; b: any; }", "documentation": { "kind": "markdown", "value": "The first parameter\n" } }, { - "label": "{ c, d, }: {\n c: any;\n d: any;\n}", + "label": "{ c, d }: { c: any; d: any; }", "documentation": { "kind": "markdown", "value": "The second parameter\n" @@ -468,17 +420,17 @@ "item": { "signatures": [ { - "label": "multipleBindings({ a, b, }: {\n a: any;\n b: any;\n}, { c, d, }: {\n c: any;\n d: any;\n}): void", + "label": "multipleBindings({ a, b }: { a: any; b: any; }, { c, d }: { c: any; d: any; }): void", "parameters": [ { - "label": "{ a, b, }: {\n a: any;\n b: any;\n}", + "label": "{ a, b }: { a: any; b: any; }", "documentation": { "kind": "markdown", "value": "The first parameter\n" } }, { - "label": "{ c, d, }: {\n c: any;\n d: any;\n}", + "label": "{ c, d }: { c: any; d: any; }", "documentation": { "kind": "markdown", "value": "The second parameter\n" diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPatternVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPatternVS.baseline new file mode 100644 index 000000000..328538322 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpBindingPatternVS.baseline @@ -0,0 +1,1874 @@ +// === SignatureHelp === +=== /signatureHelpBindingPatternVS.ts === +// +// /** +// * @param options An empty object binding pattern. +// */ +// function emptyObj({}) {} +// emptyObj() +// ^ +// | ---------------------------------------------------------------------- +// | emptyObj(**{}: {}**): void +// | - `{}: {}`: An empty object binding pattern. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param items An empty array binding pattern. +// */ +// function emptyArr([]) {} +// emptyArr() +// ^ +// | ---------------------------------------------------------------------- +// | emptyArr(**[]: Iterable**): void +// | - `[]: Iterable`: An empty array binding pattern. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param param An object with a and b properties. +// */ +// function nonEmptyObj({a, b}: {a: number, b: string}) {} +// nonEmptyObj() +// ^ +// | ---------------------------------------------------------------------- +// | nonEmptyObj(**{ a, b }: { a: number; b: string; }**): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param tuple A tuple with two elements. +// */ +// function nonEmptyArr([x, y]: [number, string]) {} +// nonEmptyArr() +// ^ +// | ---------------------------------------------------------------------- +// | nonEmptyArr(**[x, y]: [number, string]**): void +// | - `[x, y]: [number, string]`: A tuple with two elements. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param first The first number parameter. +// * @param second An object with a and b properties. +// */ +// function idLeading(first: number, {a, b}: {a: number, b: string}) {} +// idLeading(123, { a: 1, b: 2 }) +// ^ +// | ---------------------------------------------------------------------- +// | idLeading(**first: number**, { a, b }: { a: number; b: string; }): void +// | - `first: number`: The first number parameter. + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | idLeading(first: number, **{ a, b }: { a: number; b: string; }**): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param first An object with a and b properties. +// * @param last The last number parameter. +// */ +// function bindingLeading({a, b}: {a: number, b: string}, last: number) {} +// bindingLeading({ a: 1, b: 2 }, 123 ) +// ^ +// | ---------------------------------------------------------------------- +// | bindingLeading(**{ a, b }: { a: number; b: string; }**, last: number): void +// | - `{ a, b }: { a: number; b: string; }`: An object with a and b properties. + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | bindingLeading({ a, b }: { a: number; b: string; }, **last: number**): void +// | - `last: number`: The last number parameter. + +// | ---------------------------------------------------------------------- +// +// /** +// * @param param1 {Object} The first parameter +// * @param param1.a {number} Comment a +// * @param param1.b {string} Comment b +// * @param param2 {Object} The second parameter +// * @param param2.c {boolean} Comment c +// * @param param2.d {unknown} Comment d +// */ +// function multipleBindings({ a, b }, { c, d }) {} +// multipleBindings({ a: 0, b: "" }, { c: true, d: "" }) +// ^ +// | ---------------------------------------------------------------------- +// | multipleBindings(**{ a, b }: { a: any; b: any; }**, { c, d }: { c: any; d: any; }): void +// | - `{ a, b }: { a: any; b: any; }`: The first parameter + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | multipleBindings({ a, b }: { a: any; b: any; }, **{ c, d }: { c: any; d: any; }**): void +// | - `{ c, d }: { c: any; d: any; }`: The second parameter + +// | ---------------------------------------------------------------------- +// +[ + { + "marker": { + "Position": 94, + "LSPosition": { + "line": 5, + "character": 9 + }, + "Name": "emptyObj", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "emptyObj({}: {}): void", + "parameters": [ + { + "label": "{}: {}", + "documentation": { + "kind": "markdown", + "value": "An empty object binding pattern.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "emptyObj" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 187, + "LSPosition": { + "line": 11, + "character": 9 + }, + "Name": "emptyArr", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "emptyArr([]: Iterable): void", + "parameters": [ + { + "label": "[]: Iterable", + "documentation": { + "kind": "markdown", + "value": "An empty array binding pattern.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "emptyArr" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Iterable" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "undefined" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 317, + "LSPosition": { + "line": 17, + "character": 12 + }, + "Name": "nonEmptyObj", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nonEmptyObj({ a, b }: { a: number; b: string; }): void", + "parameters": [ + { + "label": "{ a, b }: { a: number; b: string; }", + "documentation": { + "kind": "markdown", + "value": "An object with a and b properties.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nonEmptyObj" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 433, + "LSPosition": { + "line": 23, + "character": 12 + }, + "Name": "nonEmptyArr", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nonEmptyArr([x, y]: [number, string]): void", + "parameters": [ + { + "label": "[x, y]: [number, string]", + "documentation": { + "kind": "markdown", + "value": "A tuple with two elements.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nonEmptyArr" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "y" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 622, + "LSPosition": { + "line": 30, + "character": 13 + }, + "Name": "idLeading", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "idLeading(first: number, { a, b }: { a: number; b: string; }): void", + "parameters": [ + { + "label": "first: number", + "documentation": { + "kind": "markdown", + "value": "The first number parameter.\n" + } + }, + { + "label": "{ a, b }: { a: number; b: string; }", + "documentation": { + "kind": "markdown", + "value": "An object with a and b properties.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "idLeading" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "first" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 638, + "LSPosition": { + "line": 30, + "character": 29 + }, + "Name": "bindingTrailing", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "idLeading(first: number, { a, b }: { a: number; b: string; }): void", + "parameters": [ + { + "label": "first: number", + "documentation": { + "kind": "markdown", + "value": "The first number parameter.\n" + } + }, + { + "label": "{ a, b }: { a: number; b: string; }", + "documentation": { + "kind": "markdown", + "value": "An object with a and b properties.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "idLeading" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "first" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 830, + "LSPosition": { + "line": 37, + "character": 15 + }, + "Name": "bindingLeading", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "bindingLeading({ a, b }: { a: number; b: string; }, last: number): void", + "parameters": [ + { + "label": "{ a, b }: { a: number; b: string; }", + "documentation": { + "kind": "markdown", + "value": "An object with a and b properties.\n" + } + }, + { + "label": "last: number", + "documentation": { + "kind": "markdown", + "value": "The last number parameter.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "bindingLeading" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "last" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 850, + "LSPosition": { + "line": 37, + "character": 35 + }, + "Name": "idTrailing", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "bindingLeading({ a, b }: { a: number; b: string; }, last: number): void", + "parameters": [ + { + "label": "{ a, b }: { a: number; b: string; }", + "documentation": { + "kind": "markdown", + "value": "An object with a and b properties.\n" + } + }, + { + "label": "last: number", + "documentation": { + "kind": "markdown", + "value": "The last number parameter.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "bindingLeading" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "last" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1189, + "LSPosition": { + "line": 48, + "character": 32 + }, + "Name": "firstObjParam", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multipleBindings({ a, b }: { a: any; b: any; }, { c, d }: { c: any; d: any; }): void", + "parameters": [ + { + "label": "{ a, b }: { a: any; b: any; }", + "documentation": { + "kind": "markdown", + "value": "The first parameter\n" + } + }, + { + "label": "{ c, d }: { c: any; d: any; }", + "documentation": { + "kind": "markdown", + "value": "The second parameter\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multipleBindings" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1209, + "LSPosition": { + "line": 48, + "character": 52 + }, + "Name": "secondObjParam", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multipleBindings({ a, b }: { a: any; b: any; }, { c, d }: { c: any; d: any; }): void", + "parameters": [ + { + "label": "{ a, b }: { a: any; b: any; }", + "documentation": { + "kind": "markdown", + "value": "The first parameter\n" + } + }, + { + "label": "{ c, d }: { c: any; d: any; }", + "documentation": { + "kind": "markdown", + "value": "The second parameter\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multipleBindings" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "{" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "property name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ";" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembersVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembersVS.baseline new file mode 100644 index 000000000..06551f397 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassMembersVS.baseline @@ -0,0 +1,1440 @@ +// === SignatureHelp === +=== /signatureHelpCommentsClassMembersVS.ts === +// /** This is comment for c1*/ +// class c1 { +// /** p1 is property of c1*/ +// public p1: number; +// /** sum with property*/ +// public p2(/** number to add*/b: number) { +// return this.p1 + b; +// } +// /** getter property 1*/ +// public get p3() { +// return this.p2(this.p1); +// ^ +// | ---------------------------------------------------------------------- +// | p2(**b: number**): number +// | - `b: number`: number to add +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 1*/ +// public set p3(/** this is value*/value: number) { +// this.p1 = this.p2(value); +// ^ +// | ---------------------------------------------------------------------- +// | p2(**b: number**): number +// | - `b: number`: number to add +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** pp1 is property of c1*/ +// private pp1: number; +// /** sum with property*/ +// private pp2(/** number to add*/b: number) { +// return this.p1 + b; +// } +// /** getter property 2*/ +// private get pp3() { +// return this.pp2(this.pp1); +// ^ +// | ---------------------------------------------------------------------- +// | pp2(**b: number**): number +// | - `b: number`: number to add +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 2*/ +// private set pp3( /** this is value*/value: number) { +// this.pp1 = this.pp2(value); +// ^ +// | ---------------------------------------------------------------------- +// | pp2(**b: number**): number +// | - `b: number`: number to add +// | sum with property +// | ---------------------------------------------------------------------- +// } +// /** Constructor method*/ +// constructor() { +// } +// /** s1 is static property of c1*/ +// static s1: number; +// /** static sum with property*/ +// static s2(/** number to add*/b: number) { +// return c1.s1 + b; +// } +// /** static getter property*/ +// static get s3() { +// return c1.s2(c1.s1); +// ^ +// | ---------------------------------------------------------------------- +// | s2(**b: number**): number +// | - `b: number`: number to add +// | static sum with property +// | ---------------------------------------------------------------------- +// } +// /** setter property 3*/ +// static set s3( /** this is value*/value: number) { +// c1.s1 = c1.s2(value); +// ^ +// | ---------------------------------------------------------------------- +// | s2(**b: number**): number +// | - `b: number`: number to add +// | static sum with property +// | ---------------------------------------------------------------------- +// } +// public nc_p1: number; +// public nc_p2(b: number) { +// return this.nc_p1 + b; +// } +// public get nc_p3() { +// return this.nc_p2(this.nc_p1); +// ^ +// | ---------------------------------------------------------------------- +// | nc_p2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// public set nc_p3(value: number) { +// this.nc_p1 = this.nc_p2(value); +// ^ +// | ---------------------------------------------------------------------- +// | nc_p2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// private nc_pp1: number; +// private nc_pp2(b: number) { +// return this.nc_pp1 + b; +// } +// private get nc_pp3() { +// return this.nc_pp2(this.nc_pp1); +// ^ +// | ---------------------------------------------------------------------- +// | nc_pp2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// private set nc_pp3(value: number) { +// this.nc_pp1 = this.nc_pp2(value); +// ^ +// | ---------------------------------------------------------------------- +// | nc_pp2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// static nc_s1: number; +// static nc_s2(b: number) { +// return c1.nc_s1 + b; +// } +// static get nc_s3() { +// return c1.nc_s2(c1.nc_s1); +// ^ +// | ---------------------------------------------------------------------- +// | nc_s2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// static set nc_s3(value: number) { +// c1.nc_s1 = c1.nc_s2(value); +// ^ +// | ---------------------------------------------------------------------- +// | nc_s2(**b: number**): number +// | ---------------------------------------------------------------------- +// } +// } +// var i1 = new c1(); +// ^ +// | ---------------------------------------------------------------------- +// | c1(): c1 +// | Constructor method +// | ---------------------------------------------------------------------- +// var i1_p = i1.p1; +// var i1_f = i1.p2; +// var i1_r = i1.p2(20); +// ^ +// | ---------------------------------------------------------------------- +// | p2(**b: number**): number +// | - `b: number`: number to add +// | sum with property +// | ---------------------------------------------------------------------- +// var i1_prop = i1.p3; +// i1.p3 = i1_prop; +// var i1_nc_p = i1.nc_p1; +// var i1_ncf = i1.nc_p2; +// var i1_ncr = i1.nc_p2(20); +// ^ +// | ---------------------------------------------------------------------- +// | nc_p2(**b: number**): number +// | ---------------------------------------------------------------------- +// var i1_ncprop = i1.nc_p3; +// i1.nc_p3 = i1_ncprop; +// var i1_s_p = c1.s1; +// var i1_s_f = c1.s2; +// var i1_s_r = c1.s2(20); +// ^ +// | ---------------------------------------------------------------------- +// | s2(**b: number**): number +// | - `b: number`: number to add +// | static sum with property +// | ---------------------------------------------------------------------- +// var i1_s_prop = c1.s3; +// c1.s3 = i1_s_prop; +// var i1_s_nc_p = c1.nc_s1; +// var i1_s_ncf = c1.nc_s2; +// var i1_s_ncr = c1.nc_s2(20); +// ^ +// | ---------------------------------------------------------------------- +// | nc_s2(**b: number**): number +// | ---------------------------------------------------------------------- +// var i1_s_ncprop = c1.nc_s3; +// c1.nc_s3 = i1_s_ncprop; +// var i1_c = c1; +// +// class cProperties { +// private val: number; +// /** getter only property*/ +// public get p1() { +// return this.val; +// } +// public get nc_p1() { +// return this.val; +// } +// /**setter only property*/ +// public set p2(value: number) { +// this.val = value; +// } +// public set nc_p2(value: number) { +// this.val = value; +// } +// } +// var cProperties_i = new cProperties(); +// cProperties_i.p2 = cProperties_i.p1; +// cProperties_i.nc_p2 = cProperties_i.nc_p1; +// class cWithConstructorProperty { +// /** +// * this is class cWithConstructorProperty's constructor +// * @param a this is first parameter a +// */ +// constructor(/**more info about a*/public a: number) { +// var bbbb = 10; +// this.a = a + 2 + bbbb; +// } +// } +[ + { + "marker": { + "Position": 275, + "LSPosition": { + "line": 10, + "character": 23 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 399, + "LSPosition": { + "line": 14, + "character": 26 + }, + "Name": "13", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 656, + "LSPosition": { + "line": 24, + "character": 24 + }, + "Name": "20", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "pp2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "pp2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 786, + "LSPosition": { + "line": 28, + "character": 28 + }, + "Name": "25", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "pp2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "pp2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1105, + "LSPosition": { + "line": 41, + "character": 21 + }, + "Name": "35", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1224, + "LSPosition": { + "line": 45, + "character": 22 + }, + "Name": "42", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1382, + "LSPosition": { + "line": 52, + "character": 26 + }, + "Name": "47", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_p2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1471, + "LSPosition": { + "line": 55, + "character": 32 + }, + "Name": "49", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_p2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1637, + "LSPosition": { + "line": 62, + "character": 27 + }, + "Name": "54", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_pp2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_pp2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1731, + "LSPosition": { + "line": 65, + "character": 34 + }, + "Name": "56", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_pp2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_pp2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1885, + "LSPosition": { + "line": 72, + "character": 24 + }, + "Name": "61", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_s2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1968, + "LSPosition": { + "line": 75, + "character": 28 + }, + "Name": "63", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_s2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2000, + "LSPosition": { + "line": 78, + "character": 16 + }, + "Name": "65", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c1(): c1", + "documentation": { + "kind": "markdown", + "value": "Constructor method" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c1" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2056, + "LSPosition": { + "line": 81, + "character": 17 + }, + "Name": "71", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "p2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2168, + "LSPosition": { + "line": 86, + "character": 22 + }, + "Name": "81", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_p2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_p2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2280, + "LSPosition": { + "line": 91, + "character": 19 + }, + "Name": "92", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "s2(b: number): number", + "documentation": { + "kind": "markdown", + "value": "static sum with property" + }, + "parameters": [ + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "number to add" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2402, + "LSPosition": { + "line": 96, + "character": 24 + }, + "Name": "102", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "nc_s2(b: number): number", + "parameters": [ + { + "label": "b: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "nc_s2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassVS.baseline new file mode 100644 index 000000000..1aeea6540 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsClassVS.baseline @@ -0,0 +1,420 @@ +// === SignatureHelp === +=== /signatureHelpCommentsClassVS.ts === +// /** This is class c2 without constructor*/ +// class c2 { +// } +// var i2 = new c2(); +// ^ +// | ---------------------------------------------------------------------- +// | c2(): c2 +// | ---------------------------------------------------------------------- +// var i2_c = c2; +// class c3 { +// /** Constructor comment*/ +// constructor() { +// } +// } +// var i3 = new c3(); +// ^ +// | ---------------------------------------------------------------------- +// | c3(): c3 +// | Constructor comment +// | ---------------------------------------------------------------------- +// var i3_c = c3; +// /** Class comment*/ +// class c4 { +// /** Constructor comment*/ +// constructor() { +// } +// } +// var i4 = new c4(); +// ^ +// | ---------------------------------------------------------------------- +// | c4(): c4 +// | Constructor comment +// | ---------------------------------------------------------------------- +// var i4_c = c4; +// /** Class with statics*/ +// class c5 { +// static s1: number; +// } +// var i5 = new c5(); +// ^ +// | ---------------------------------------------------------------------- +// | c5(): c5 +// | ---------------------------------------------------------------------- +// var i5_c = c5; +// /** class with statics and constructor*/ +// class c6 { +// /** s1 comment*/ +// static s1: number; +// /** constructor comment*/ +// constructor() { +// } +// } +// var i6 = new c6(); +// ^ +// | ---------------------------------------------------------------------- +// | c6(): c6 +// | constructor comment +// | ---------------------------------------------------------------------- +// var i6_c = c6; +// +// class a { +// /** +// constructor for a +// @param a this is my a +// */ +// constructor(a: string) { +// } +// } +// new a("Hello"); +// ^ +// | ---------------------------------------------------------------------- +// | a(**a: string**): a +// | - `a: string`: this is my a + +// | constructor for a +// | ---------------------------------------------------------------------- +// namespace m { +// export namespace m2 { +// /** class comment */ +// export class c1 { +// /** constructor comment*/ +// constructor() { +// } +// } +// } +// } +// var myVar = new m.m2.c1(); +[ + { + "marker": { + "Position": 72, + "LSPosition": { + "line": 3, + "character": 16 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c2(): c2", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c2" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 175, + "LSPosition": { + "line": 10, + "character": 16 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c3(): c3", + "documentation": { + "kind": "markdown", + "value": "Constructor comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c3" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 298, + "LSPosition": { + "line": 18, + "character": 16 + }, + "Name": "13", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c4(): c4", + "documentation": { + "kind": "markdown", + "value": "Constructor comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c4" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 393, + "LSPosition": { + "line": 24, + "character": 16 + }, + "Name": "18", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c5(): c5", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c5" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 581, + "LSPosition": { + "line": 34, + "character": 16 + }, + "Name": "23", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "c6(): c6", + "documentation": { + "kind": "markdown", + "value": "constructor comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "c6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "c6" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 716, + "LSPosition": { + "line": 45, + "character": 6 + }, + "Name": "27", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "a(a: string): a", + "documentation": { + "kind": "markdown", + "value": "constructor for a" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is my a\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "a" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsingVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsingVS.baseline new file mode 100644 index 000000000..7fb118be2 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsCommentParsingVS.baseline @@ -0,0 +1,6307 @@ +// === SignatureHelp === +=== /signatureHelpCommentsCommentParsingVS.ts === +// /// This is simple /// comments +// function simple() { +// } +// +// simple( ); +// ^ +// | ---------------------------------------------------------------------- +// | simple(): void +// | ---------------------------------------------------------------------- +// +// /// multiLine /// Comments +// /// This is example of multiline /// comments +// /// Another multiLine +// function multiLine() { +// } +// multiLine( ); +// ^ +// | ---------------------------------------------------------------------- +// | multiLine(): void +// | ---------------------------------------------------------------------- +// +// /** this is eg of single line jsdoc style comment */ +// function jsDocSingleLine() { +// } +// jsDocSingleLine(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocSingleLine(): void +// | this is eg of single line jsdoc style comment +// | ---------------------------------------------------------------------- +// +// +// /** this is multiple line jsdoc stule comment +// *New line1 +// *New Line2*/ +// function jsDocMultiLine() { +// } +// jsDocMultiLine(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMultiLine(): void +// | this is multiple line jsdoc stule comment +// | New line1 +// | New Line2 +// | ---------------------------------------------------------------------- +// +// /** multiple line jsdoc comments no longer merge +// *New line1 +// *New Line2*/ +// /** Shoul mege this line as well +// * and this too*/ /** Another this one too*/ +// function jsDocMultiLineMerge() { +// } +// jsDocMultiLineMerge(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMultiLineMerge(): void +// | Another this one too +// | ---------------------------------------------------------------------- +// +// +// /// Triple slash comment +// /** jsdoc comment */ +// function jsDocMixedComments1() { +// } +// jsDocMixedComments1(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments1(): void +// | jsdoc comment +// | ---------------------------------------------------------------------- +// +// /// Triple slash comment +// /** jsdoc comment */ /** another jsDocComment*/ +// function jsDocMixedComments2() { +// } +// jsDocMixedComments2(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments2(): void +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /** jsdoc comment */ /*** triplestar jsDocComment*/ +// /// Triple slash comment +// function jsDocMixedComments3() { +// } +// jsDocMixedComments3(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments3(): void +// | * triplestar jsDocComment +// | ---------------------------------------------------------------------- +// +// /** jsdoc comment */ /** another jsDocComment*/ +// /// Triple slash comment +// /// Triple slash comment 2 +// function jsDocMixedComments4() { +// } +// jsDocMixedComments4(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments4(): void +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /// Triple slash comment 1 +// /** jsdoc comment */ /** another jsDocComment*/ +// /// Triple slash comment +// /// Triple slash comment 2 +// function jsDocMixedComments5() { +// } +// jsDocMixedComments5(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments5(): void +// | another jsDocComment +// | ---------------------------------------------------------------------- +// +// /** another jsDocComment*/ +// /// Triple slash comment 1 +// /// Triple slash comment +// /// Triple slash comment 2 +// /** jsdoc comment */ +// function jsDocMixedComments6() { +// } +// jsDocMixedComments6(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocMixedComments6(): void +// | jsdoc comment +// | ---------------------------------------------------------------------- +// +// // This shoulnot be help comment +// function noHelpComment1() { +// } +// noHelpComment1(); +// ^ +// | ---------------------------------------------------------------------- +// | noHelpComment1(): void +// | ---------------------------------------------------------------------- +// +// /* This shoulnot be help comment */ +// function noHelpComment2() { +// } +// noHelpComment2(); +// ^ +// | ---------------------------------------------------------------------- +// | noHelpComment2(): void +// | ---------------------------------------------------------------------- +// +// function noHelpComment3() { +// } +// noHelpComment3(); +// ^ +// | ---------------------------------------------------------------------- +// | noHelpComment3(): void +// | ---------------------------------------------------------------------- +// /** Adds two integers and returns the result +// * @param {number} a first number +// * @param b second number +// */ +// function sum(a: number, b: number) { +// return a + b; +// } +// sum(10, 20); +// ^ +// | ---------------------------------------------------------------------- +// | sum(**a: number**, b: number): number +// | - `a: number`: first number + +// | Adds two integers and returns the result +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | sum(a: number, **b: number**): number +// | - `b: number`: second number + +// | Adds two integers and returns the result +// | ---------------------------------------------------------------------- +// /** This is multiplication function +// * @param +// * @param a first number +// * @param b +// * @param c { +// @param d @anotherTag +// * @param e LastParam @anotherTag*/ +// function multiply(a: number, b: number, c?: number, d?, e?) { +// } +// multiply(10, 20, 30, 40, 50); +// ^ +// | ---------------------------------------------------------------------- +// | multiply(**a: number**, b: number, c?: number, d?: any, e?: any): void +// | - `a: number`: first number + +// | This is multiplication function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | multiply(a: number, **b: number**, c?: number, d?: any, e?: any): void +// | This is multiplication function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | multiply(a: number, b: number, **c?: number**, d?: any, e?: any): void +// | This is multiplication function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | multiply(a: number, b: number, c?: number, **d?: any**, e?: any): void +// | This is multiplication function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | multiply(a: number, b: number, c?: number, d?: any, **e?: any**): void +// | - `e?: any`: LastParam +// | This is multiplication function +// | ---------------------------------------------------------------------- +// /** fn f1 with number +// * @param { string} b about b +// */ +// function f1(a: number); +// function f1(b: string); +// /**@param opt optional parameter*/ +// function f1(aOrb, opt?) { +// return aOrb; +// } +// f1(10); +// ^ +// | ---------------------------------------------------------------------- +// | f1(**a: number**): any +// | fn f1 with number +// | ---------------------------------------------------------------------- +// f1("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | f1(**b: string**): any +// | - `b: string`: about b + +// | fn f1 with number +// | ---------------------------------------------------------------------- +// +// /** This is subtract function +// @param { a +// *@param { number | } b this is about b +// @param { { () => string; } } c this is optional param c +// @param { { () => string; } d this is optional param d +// @param { { () => string; } } e this is optional param e +// @param { { { () => string; } } f this is optional param f +// */ +// function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +// } +// subtract(10, 20, null, null, null, null); +// ^ +// | ---------------------------------------------------------------------- +// | subtract(**a: number**, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void +// | This is subtract function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | subtract(a: number, **b: number**, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void +// | - `b: number`: this is about b + +// | This is subtract function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | subtract(a: number, b: number, **c?: () => string**, d?: () => string, e?: () => string, f?: () => string): void +// | - `c?: () => string`: this is optional param c + +// | This is subtract function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | subtract(a: number, b: number, c?: () => string, **d?: () => string**, e?: () => string, f?: () => string): void +// | - `d?: () => string`: this is optional param d + +// | This is subtract function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | subtract(a: number, b: number, c?: () => string, d?: () => string, **e?: () => string**, f?: () => string): void +// | - `e?: () => string`: this is optional param e + +// | This is subtract function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, **f?: () => string**): void +// | This is subtract function +// | ---------------------------------------------------------------------- +// /** this is square function +// @paramTag { number } a this is input number of paramTag +// @param { number } a this is input number +// @returnType { number } it is return type +// */ +// function square(a: number) { +// return a * a; +// } +// square(10); +// ^ +// | ---------------------------------------------------------------------- +// | square(**a: number**): number +// | - `a: number`: this is input number + +// | this is square function +// | ---------------------------------------------------------------------- +// /** this is divide function +// @param { number} a this is a +// @paramTag { number } g this is optional param g +// @param { number} b this is b +// */ +// function divide(a: number, b: number) { +// } +// divide(10, 20); +// ^ +// | ---------------------------------------------------------------------- +// | divide(**a: number**, b: number): void +// | - `a: number`: this is a + +// | this is divide function +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | divide(a: number, **b: number**): void +// | - `b: number`: this is b + +// | this is divide function +// | ---------------------------------------------------------------------- +// /** +// Function returns string concat of foo and bar +// @param {string} foo is string +// @param {string} bar is second string +// */ +// function fooBar(foo: string, bar: string) { +// return foo + bar; +// } +// fooBar("foo","bar"); +// ^ +// | ---------------------------------------------------------------------- +// | fooBar(**foo: string**, bar: string): string +// | - `foo: string`: is string + +// | Function returns string concat of foo and bar +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fooBar(foo: string, **bar: string**): string +// | - `bar: string`: is second string + +// | Function returns string concat of foo and bar +// | ---------------------------------------------------------------------- +// /** This is a comment */ +// var x; +// /** +// * This is a comment +// */ +// var y; +// /** this is jsdoc style function with param tag as well as inline parameter help +// *@param a it is first parameter +// *@param c it is third parameter +// */ +// function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { +// return a + b + c + d; +// ^ +// | ---------------------------------------------------------------------- +// | No signaturehelp at /*39*/. +// | ---------------------------------------------------------------------- +// } +// jsDocParamTest(30, 40, 50, 60); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocParamTest(**a: number**, b: number, c: number, d: number): number +// | - `a: number`: this is inline comment for a +// | this is jsdoc style function with param tag as well as inline parameter help +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | jsDocParamTest(a: number, **b: number**, c: number, d: number): number +// | - `b: number`: this is inline comment for b +// | this is jsdoc style function with param tag as well as inline parameter help +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | jsDocParamTest(a: number, b: number, **c: number**, d: number): number +// | - `c: number`: it is third parameter + +// | this is jsdoc style function with param tag as well as inline parameter help +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | jsDocParamTest(a: number, b: number, c: number, **d: number**): number +// | this is jsdoc style function with param tag as well as inline parameter help +// | ---------------------------------------------------------------------- +// /** This is function comment +// * And properly aligned comment +// */ +// function jsDocCommentAlignmentTest1() { +// } +// jsDocCommentAlignmentTest1(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocCommentAlignmentTest1(): void +// | This is function comment +// | And properly aligned comment +// | ---------------------------------------------------------------------- +// /** This is function comment +// * And aligned with 4 space char margin +// */ +// function jsDocCommentAlignmentTest2() { +// } +// jsDocCommentAlignmentTest2(); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocCommentAlignmentTest2(): void +// | This is function comment +// | And aligned with 4 space char margin +// | ---------------------------------------------------------------------- +// /** This is function comment +// * And aligned with 4 space char margin +// * @param {string} a this is info about a +// * spanning on two lines and aligned perfectly +// * @param b this is info about b +// * spanning on two lines and aligned perfectly +// * spanning one more line alined perfectly +// * spanning another line with more margin +// * @param c this is info about b +// * not aligned text about parameter will eat only one space +// */ +// function jsDocCommentAlignmentTest3(a: string, b, c) { +// } +// jsDocCommentAlignmentTest3("hello",1, 2); +// ^ +// | ---------------------------------------------------------------------- +// | jsDocCommentAlignmentTest3(**a: string**, b: any, c: any): void +// | - `a: string`: this is info about a +spanning on two lines and aligned perfectly + +// | This is function comment +// | And aligned with 4 space char margin +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | jsDocCommentAlignmentTest3(a: string, **b: any**, c: any): void +// | - `b: any`: this is info about b +spanning on two lines and aligned perfectly +spanning one more line alined perfectly + spanning another line with more margin + +// | This is function comment +// | And aligned with 4 space char margin +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | jsDocCommentAlignmentTest3(a: string, b: any, **c: any**): void +// | - `c: any`: this is info about b +not aligned text about parameter will eat only one space + +// | This is function comment +// | And aligned with 4 space char margin +// | ---------------------------------------------------------------------- +// +// ^ +// | ---------------------------------------------------------------------- +// | No signaturehelp at /**/. +// | ---------------------------------------------------------------------- +// class NoQuickInfoClass { +// } +[ + { + "marker": { + "Position": 63, + "LSPosition": { + "line": 4, + "character": 8 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "simple(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "simple" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 198, + "LSPosition": { + "line": 11, + "character": 11 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiLine(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiLine" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 302, + "LSPosition": { + "line": 16, + "character": 16 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocSingleLine(): void", + "documentation": { + "kind": "markdown", + "value": "this is eg of single line jsdoc style comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocSingleLine" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 422, + "LSPosition": { + "line": 24, + "character": 15 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMultiLine(): void", + "documentation": { + "kind": "markdown", + "value": "this is multiple line jsdoc stule comment\nNew line1\nNew Line2" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMultiLine" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 631, + "LSPosition": { + "line": 33, + "character": 20 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMultiLineMerge(): void", + "documentation": { + "kind": "markdown", + "value": "Another this one too" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMultiLineMerge" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 737, + "LSPosition": { + "line": 40, + "character": 20 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments1(): void", + "documentation": { + "kind": "markdown", + "value": "jsdoc comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 869, + "LSPosition": { + "line": 46, + "character": 20 + }, + "Name": "7", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments2(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1005, + "LSPosition": { + "line": 52, + "character": 20 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments3(): void", + "documentation": { + "kind": "markdown", + "value": "* triplestar jsDocComment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1164, + "LSPosition": { + "line": 59, + "character": 20 + }, + "Name": "9", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments4(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1350, + "LSPosition": { + "line": 67, + "character": 20 + }, + "Name": "10", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments5(): void", + "documentation": { + "kind": "markdown", + "value": "another jsDocComment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1536, + "LSPosition": { + "line": 76, + "character": 20 + }, + "Name": "11", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocMixedComments6(): void", + "documentation": { + "kind": "markdown", + "value": "jsdoc comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocMixedComments6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1618, + "LSPosition": { + "line": 81, + "character": 15 + }, + "Name": "12", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "noHelpComment1(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "noHelpComment1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1703, + "LSPosition": { + "line": 86, + "character": 15 + }, + "Name": "13", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "noHelpComment2(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "noHelpComment2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1752, + "LSPosition": { + "line": 90, + "character": 15 + }, + "Name": "14", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "noHelpComment3(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "noHelpComment3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1928, + "LSPosition": { + "line": 98, + "character": 4 + }, + "Name": "16", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "sum(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "Adds two integers and returns the result" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "second number\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "sum" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1932, + "LSPosition": { + "line": 98, + "character": 8 + }, + "Name": "17", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "sum(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "Adds two integers and returns the result" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "second number\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "sum" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2166, + "LSPosition": { + "line": 108, + "character": 9 + }, + "Name": "19", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number" + }, + { + "label": "c?: number" + }, + { + "label": "d?: any" + }, + { + "label": "e?: any", + "documentation": { + "kind": "markdown", + "value": "LastParam " + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiply" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2169, + "LSPosition": { + "line": 108, + "character": 12 + }, + "Name": "20", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number" + }, + { + "label": "c?: number" + }, + { + "label": "d?: any" + }, + { + "label": "e?: any", + "documentation": { + "kind": "markdown", + "value": "LastParam " + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiply" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2173, + "LSPosition": { + "line": 108, + "character": 16 + }, + "Name": "21", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number" + }, + { + "label": "c?: number" + }, + { + "label": "d?: any" + }, + { + "label": "e?: any", + "documentation": { + "kind": "markdown", + "value": "LastParam " + } + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiply" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2178, + "LSPosition": { + "line": 108, + "character": 21 + }, + "Name": "22", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number" + }, + { + "label": "c?: number" + }, + { + "label": "d?: any" + }, + { + "label": "e?: any", + "documentation": { + "kind": "markdown", + "value": "LastParam " + } + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiply" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2182, + "LSPosition": { + "line": 108, + "character": 25 + }, + "Name": "23", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "multiply(a: number, b: number, c?: number, d?: any, e?: any): void", + "documentation": { + "kind": "markdown", + "value": "This is multiplication function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "first number\n" + } + }, + { + "label": "b: number" + }, + { + "label": "c?: number" + }, + { + "label": "d?: any" + }, + { + "label": "e?: any", + "documentation": { + "kind": "markdown", + "value": "LastParam " + } + } + ], + "activeParameter": 4, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "multiply" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2372, + "LSPosition": { + "line": 118, + "character": 3 + }, + "Name": "25", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(a: number): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number" + }, + "parameters": [ + { + "label": "a: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + }, + { + "label": "f1(b: string): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number" + }, + "parameters": [ + { + "label": "b: string", + "documentation": { + "kind": "markdown", + "value": "about b\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2380, + "LSPosition": { + "line": 119, + "character": 3 + }, + "Name": "26", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f1(a: number): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number" + }, + "parameters": [ + { + "label": "a: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + }, + { + "label": "f1(b: string): any", + "documentation": { + "kind": "markdown", + "value": "fn f1 with number" + }, + "parameters": [ + { + "label": "b: string", + "documentation": { + "kind": "markdown", + "value": "about b\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 1 + } + }, + { + "marker": { + "Position": 2823, + "LSPosition": { + "line": 131, + "character": 9 + }, + "Name": "28", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2827, + "LSPosition": { + "line": 131, + "character": 13 + }, + "Name": "29", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2832, + "LSPosition": { + "line": 131, + "character": 18 + }, + "Name": "30", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2839, + "LSPosition": { + "line": 131, + "character": 25 + }, + "Name": "31", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2846, + "LSPosition": { + "line": 131, + "character": 32 + }, + "Name": "32", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 4, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 2853, + "LSPosition": { + "line": 131, + "character": 39 + }, + "Name": "33", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void", + "documentation": { + "kind": "markdown", + "value": "This is subtract function" + }, + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is about b\n" + } + }, + { + "label": "c?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param c\n" + } + }, + { + "label": "d?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param d\n" + } + }, + { + "label": "e?: () => string", + "documentation": { + "kind": "markdown", + "value": "this is optional param e\n" + } + }, + { + "label": "f?: () => string" + } + ], + "activeParameter": 5, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "subtract" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "e" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3085, + "LSPosition": { + "line": 140, + "character": 7 + }, + "Name": "34", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "square(a: number): number", + "documentation": { + "kind": "markdown", + "value": "this is square function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is input number\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "square" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3276, + "LSPosition": { + "line": 148, + "character": 7 + }, + "Name": "35", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "divide(a: number, b: number): void", + "documentation": { + "kind": "markdown", + "value": "this is divide function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is a\n" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is b\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "divide" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3280, + "LSPosition": { + "line": 148, + "character": 11 + }, + "Name": "36", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "divide(a: number, b: number): void", + "documentation": { + "kind": "markdown", + "value": "this is divide function" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is a\n" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is b\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "divide" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3491, + "LSPosition": { + "line": 157, + "character": 7 + }, + "Name": "37", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fooBar(foo: string, bar: string): string", + "documentation": { + "kind": "markdown", + "value": "Function returns string concat of foo and bar" + }, + "parameters": [ + { + "label": "foo: string", + "documentation": { + "kind": "markdown", + "value": "is string\n" + } + }, + { + "label": "bar: string", + "documentation": { + "kind": "markdown", + "value": "is second string\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fooBar" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "bar" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3497, + "LSPosition": { + "line": 157, + "character": 13 + }, + "Name": "38", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fooBar(foo: string, bar: string): string", + "documentation": { + "kind": "markdown", + "value": "Function returns string concat of foo and bar" + }, + "parameters": [ + { + "label": "foo: string", + "documentation": { + "kind": "markdown", + "value": "is string\n" + } + }, + { + "label": "bar: string", + "documentation": { + "kind": "markdown", + "value": "is second string\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fooBar" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "bar" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3874, + "LSPosition": { + "line": 169, + "character": 11 + }, + "Name": "39", + "Data": {} + }, + "item": null + }, + { + "marker": { + "Position": 3906, + "LSPosition": { + "line": 171, + "character": 15 + }, + "Name": "40", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for b" + } + }, + { + "label": "c: number", + "documentation": { + "kind": "markdown", + "value": "it is third parameter\n" + } + }, + { + "label": "d: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocParamTest" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3910, + "LSPosition": { + "line": 171, + "character": 19 + }, + "Name": "41", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for b" + } + }, + { + "label": "c: number", + "documentation": { + "kind": "markdown", + "value": "it is third parameter\n" + } + }, + { + "label": "d: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocParamTest" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3914, + "LSPosition": { + "line": 171, + "character": 23 + }, + "Name": "42", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for b" + } + }, + { + "label": "c: number", + "documentation": { + "kind": "markdown", + "value": "it is third parameter\n" + } + }, + { + "label": "d: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocParamTest" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 3918, + "LSPosition": { + "line": 171, + "character": 27 + }, + "Name": "43", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocParamTest(a: number, b: number, c: number, d: number): number", + "documentation": { + "kind": "markdown", + "value": "this is jsdoc style function with param tag as well as inline parameter help" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is inline comment for b" + } + }, + { + "label": "c: number", + "documentation": { + "kind": "markdown", + "value": "it is third parameter\n" + } + }, + { + "label": "d: number" + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocParamTest" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "d" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4059, + "LSPosition": { + "line": 177, + "character": 27 + }, + "Name": "45", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocCommentAlignmentTest1(): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\nAnd properly aligned comment" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocCommentAlignmentTest1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4210, + "LSPosition": { + "line": 183, + "character": 27 + }, + "Name": "46", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocCommentAlignmentTest2(): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocCommentAlignmentTest2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4826, + "LSPosition": { + "line": 197, + "character": 27 + }, + "Name": "47", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is info about a\nspanning on two lines and aligned perfectly\n" + } + }, + { + "label": "b: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n" + } + }, + { + "label": "c: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nnot aligned text about parameter will eat only one space\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocCommentAlignmentTest3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4834, + "LSPosition": { + "line": 197, + "character": 35 + }, + "Name": "48", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is info about a\nspanning on two lines and aligned perfectly\n" + } + }, + { + "label": "b: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n" + } + }, + { + "label": "c: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nnot aligned text about parameter will eat only one space\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocCommentAlignmentTest3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4837, + "LSPosition": { + "line": 197, + "character": 38 + }, + "Name": "49", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "jsDocCommentAlignmentTest3(a: string, b: any, c: any): void", + "documentation": { + "kind": "markdown", + "value": "This is function comment\n And aligned with 4 space char margin" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is info about a\nspanning on two lines and aligned perfectly\n" + } + }, + { + "label": "b: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin\n" + } + }, + { + "label": "c: any", + "documentation": { + "kind": "markdown", + "value": "this is info about b\nnot aligned text about parameter will eat only one space\n" + } + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "jsDocCommentAlignmentTest3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 4841, + "LSPosition": { + "line": 198, + "character": 0 + }, + "Name": "", + "Data": {} + }, + "item": null + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclarationVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclarationVS.baseline new file mode 100644 index 000000000..029497a00 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionDeclarationVS.baseline @@ -0,0 +1,390 @@ +// === SignatureHelp === +=== /signatureHelpCommentsFunctionDeclarationVS.ts === +// /** This comment should appear for foo*/ +// function foo() { +// } +// foo(); +// ^ +// | ---------------------------------------------------------------------- +// | foo(): void +// | This comment should appear for foo +// | ---------------------------------------------------------------------- +// /** This is comment for function signature*/ +// function fooWithParameters(/** this is comment about a*/a: string, +// /** this is comment for b*/ +// b: number) { +// var d = a; +// } +// fooWithParameters("a",10); +// ^ +// | ---------------------------------------------------------------------- +// | fooWithParameters(**a: string**, b: number): void +// | - `a: string`: this is comment about a +// | This is comment for function signature +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fooWithParameters(a: string, **b: number**): void +// | - `b: number`: this is comment for b +// | This is comment for function signature +// | ---------------------------------------------------------------------- +// /** +// * Does something +// * @param a a string +// */ +// declare function fn(a: string); +// fn("hello"); +// ^ +// | ---------------------------------------------------------------------- +// | fn(**a: string**): any +// | - `a: string`: a string + +// | Does something +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 64, + "LSPosition": { + "line": 3, + "character": 4 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "foo(): void", + "documentation": { + "kind": "markdown", + "value": "This comment should appear for foo" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 263, + "LSPosition": { + "line": 10, + "character": 18 + }, + "Name": "10", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fooWithParameters(a: string, b: number): void", + "documentation": { + "kind": "markdown", + "value": "This is comment for function signature" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is comment about a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is comment for b" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fooWithParameters" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 267, + "LSPosition": { + "line": 10, + "character": 22 + }, + "Name": "11", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fooWithParameters(a: string, b: number): void", + "documentation": { + "kind": "markdown", + "value": "This is comment for function signature" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "this is comment about a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "this is comment for b" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fooWithParameters" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 351, + "LSPosition": { + "line": 16, + "character": 3 + }, + "Name": "12", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: string): any", + "documentation": { + "kind": "markdown", + "value": "Does something" + }, + "parameters": [ + { + "label": "a: string", + "documentation": { + "kind": "markdown", + "value": "a string\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpressionVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpressionVS.baseline new file mode 100644 index 000000000..2b7d99a23 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpCommentsFunctionExpressionVS.baseline @@ -0,0 +1,341 @@ +// === SignatureHelp === +=== /signatureHelpCommentsFunctionExpressionVS.ts === +// /** lambdaFoo var comment*/ +// var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +// var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +// lambdaFoo(10, 20); +// ^ +// | ---------------------------------------------------------------------- +// | lambdaFoo(**a: number**, b: number): number +// | - `a: number`: param a +// | this is lambda comment +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | lambdaFoo(a: number, **b: number**): number +// | - `b: number`: param b +// | this is lambda comment +// | ---------------------------------------------------------------------- +// function anotherFunc(a: number) { +// /** documentation +// @param b {string} inner parameter */ +// var lambdaVar = /** inner docs */(b: string) => { +// var localVar = "Hello "; +// return localVar + b; +// } +// return lambdaVar("World") + a; +// } +// /** +// * On variable +// * @param s the first parameter! +// * @returns the parameter's length +// */ +// var assigned = /** +// * Summary on expression +// * @param s param on expression +// * @returns return on expression +// */function(/** On parameter */s: string) { +// return s.length; +// } +// assigned("hey"); +// ^ +// | ---------------------------------------------------------------------- +// | assigned(**s: string**): number +// | - `s: string`: On parameter +// | Summary on expression +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 259, + "LSPosition": { + "line": 3, + "character": 10 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "lambdaFoo(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "this is lambda comment" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "param a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "param b" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "lambdaFoo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 263, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "lambdaFoo(a: number, b: number): number", + "documentation": { + "kind": "markdown", + "value": "this is lambda comment" + }, + "parameters": [ + { + "label": "a: number", + "documentation": { + "kind": "markdown", + "value": "param a" + } + }, + { + "label": "b: number", + "documentation": { + "kind": "markdown", + "value": "param b" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "lambdaFoo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 862, + "LSPosition": { + "line": 25, + "character": 9 + }, + "Name": "18", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "assigned(s: string): number", + "documentation": { + "kind": "markdown", + "value": "Summary on expression" + }, + "parameters": [ + { + "label": "s: string", + "documentation": { + "kind": "markdown", + "value": "On parameter" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "assigned" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "s" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamPropertiesVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamPropertiesVS.baseline new file mode 100644 index 000000000..d9f716ebe --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpConstructorCallParamPropertiesVS.baseline @@ -0,0 +1,97 @@ +// === SignatureHelp === +=== /signatureHelpConstructorCallParamPropertiesVS.ts === +// class Circle { +// /** +// * Initialize a circle. +// * @param radius The radius of the circle. +// */ +// constructor(private radius: number) { +// } +// } +// var a = new Circle( +// ^ +// | ---------------------------------------------------------------------- +// | Circle(**radius: number**): Circle +// | - `radius: number`: The radius of the circle. + +// | Initialize a circle. +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 179, + "LSPosition": { + "line": 8, + "character": 19 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Circle(radius: number): Circle", + "documentation": { + "kind": "markdown", + "value": "Initialize a circle." + }, + "parameters": [ + { + "label": "radius: number", + "documentation": { + "kind": "markdown", + "value": "The radius of the circle.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "Circle" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "radius" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Circle" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpExpandedRestTuplesLocalLabels1VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpExpandedRestTuplesLocalLabels1VS.baseline new file mode 100644 index 000000000..3fe608790 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpExpandedRestTuplesLocalLabels1VS.baseline @@ -0,0 +1,6213 @@ +// === SignatureHelp === +=== /signatureHelpExpandedRestTuplesLocalLabels1VS.ts === +// interface AppleInfo { +// color: "green" | "red"; +// } +// +// interface BananaInfo { +// curvature: number; +// } +// +// type FruitAndInfo1 = ["apple", AppleInfo] | ["banana", BananaInfo]; +// +// function logFruitTuple1(...[fruit, info]: FruitAndInfo1) {} +// logFruitTuple1(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple1(**fruit: "apple"**, info: AppleInfo): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple2(...[, info]: FruitAndInfo1) {} +// logFruitTuple2(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple2(**arg_0: "apple"**, info: AppleInfo): void +// | ---------------------------------------------------------------------- +// logFruitTuple2("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple2(arg_0: "apple", **info: AppleInfo**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple3(...[fruit, ...rest]: FruitAndInfo1) {} +// logFruitTuple3(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple3(**fruit: "apple"**, rest_0: AppleInfo): void +// | ---------------------------------------------------------------------- +// logFruitTuple3("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple3(fruit: "apple", **rest_0: AppleInfo**): void +// | ---------------------------------------------------------------------- +// function logFruitTuple4(...[fruit, ...[info]]: FruitAndInfo1) {} +// logFruitTuple4(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple4(**fruit: "apple"**, info: AppleInfo): void +// | ---------------------------------------------------------------------- +// logFruitTuple4("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple4(fruit: "apple", **info: AppleInfo**): void +// | ---------------------------------------------------------------------- +// +// type FruitAndInfo2 = ["apple", ...AppleInfo[]] | ["banana", ...BananaInfo[]]; +// +// function logFruitTuple5(...[fruit, firstInfo]: FruitAndInfo2) {} +// logFruitTuple5(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple5(**fruit: "apple"**, ...firstInfo_n: AppleInfo[]): void +// | ---------------------------------------------------------------------- +// logFruitTuple5("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple5(fruit: "apple", **...firstInfo_n: AppleInfo[]**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple6(...[fruit, ...fruitInfo]: FruitAndInfo2) {} +// logFruitTuple6(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple6(**fruit: "apple"**, ...fruitInfo: AppleInfo[]): void +// | ---------------------------------------------------------------------- +// logFruitTuple6("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple6(fruit: "apple", **...fruitInfo: AppleInfo[]**): void +// | ---------------------------------------------------------------------- +// +// type FruitAndInfo3 = ["apple", ...AppleInfo[], number] | ["banana", ...BananaInfo[], number]; +// +// function logFruitTuple7(...[fruit, fruitInfoOrNumber, secondFruitInfoOrNumber]: FruitAndInfo3) {} +// logFruitTuple7(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple7(**fruit: "apple"**, ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple7("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple7(fruit: "apple", **...fruitInfoOrNumber_n: AppleInfo[]**, secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple7("apple", { color: "red" }, ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple7(fruit: "apple", ...fruitInfoOrNumber_n: AppleInfo[], **secondFruitInfoOrNumber: number**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple8(...[fruit, , secondFruitInfoOrNumber]: FruitAndInfo3) {} +// logFruitTuple8(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple8(**fruit: "apple"**, ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple8("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple8(fruit: "apple", **...arg_1: AppleInfo[]**, secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple8("apple", { color: "red" }, ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple8(fruit: "apple", ...arg_1: AppleInfo[], **secondFruitInfoOrNumber: number**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple9(...[...[fruit, fruitInfoOrNumber, secondFruitInfoOrNumber]]: FruitAndInfo3) {} +// logFruitTuple9(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple9(**fruit: "apple"**, ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple9("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple9(fruit: "apple", **...fruitInfoOrNumber_n: AppleInfo[]**, secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple9("apple", { color: "red" }, ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple9(fruit: "apple", ...fruitInfoOrNumber_n: AppleInfo[], **secondFruitInfoOrNumber: number**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple10(...[fruit, {}, secondFruitInfoOrNumber]: FruitAndInfo3) {} +// logFruitTuple10(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple10(**fruit: "apple"**, ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple10("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple10(fruit: "apple", **...arg_1: AppleInfo[]**, secondFruitInfoOrNumber: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple10("apple", { color: "red" }, ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple10(fruit: "apple", ...arg_1: AppleInfo[], **secondFruitInfoOrNumber: number**): void +// | ---------------------------------------------------------------------- +// +// function logFruitTuple11(...{}: FruitAndInfo3) {} +// logFruitTuple11(); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple11(**arg_0: "apple"**, ...arg_1: AppleInfo[], arg_2: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple11("apple", ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple11(arg_0: "apple", **...arg_1: AppleInfo[]**, arg_2: number): void +// | ---------------------------------------------------------------------- +// logFruitTuple11("apple", { color: "red" }, ); +// ^ +// | ---------------------------------------------------------------------- +// | logFruitTuple11(arg_0: "apple", ...arg_1: AppleInfo[], **arg_2: number**): void +// | ---------------------------------------------------------------------- +// function withPair(...[first, second]: [number, named: string]) {} +// withPair(); +// ^ +// | ---------------------------------------------------------------------- +// | withPair(**first: number**, named: string): void +// | ---------------------------------------------------------------------- +// withPair(101, ); +// ^ +// | ---------------------------------------------------------------------- +// | withPair(first: number, **named: string**): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 242, + "LSPosition": { + "line": 11, + "character": 15 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple1(fruit: \"apple\", info: AppleInfo): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "info: AppleInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple1(fruit: \"banana\", info: BananaInfo): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "info: BananaInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 316, + "LSPosition": { + "line": 14, + "character": 15 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple2(arg_0: \"apple\", info: AppleInfo): void", + "parameters": [ + { + "label": "arg_0: \"apple\"" + }, + { + "label": "info: AppleInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple2(arg_0: \"banana\", info: BananaInfo): void", + "parameters": [ + { + "label": "arg_0: \"banana\"" + }, + { + "label": "info: BananaInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 343, + "LSPosition": { + "line": 15, + "character": 24 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple2(arg_0: \"apple\", info: AppleInfo): void", + "parameters": [ + { + "label": "arg_0: \"apple\"" + }, + { + "label": "info: AppleInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple2(arg_0: \"banana\", info: BananaInfo): void", + "parameters": [ + { + "label": "arg_0: \"banana\"" + }, + { + "label": "info: BananaInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 425, + "LSPosition": { + "line": 18, + "character": 15 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple3(fruit: \"apple\", rest_0: AppleInfo): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "rest_0: AppleInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "rest_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple3(fruit: \"banana\", rest_0: BananaInfo): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "rest_0: BananaInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "rest_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 452, + "LSPosition": { + "line": 19, + "character": 24 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple3(fruit: \"apple\", rest_0: AppleInfo): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "rest_0: AppleInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "rest_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple3(fruit: \"banana\", rest_0: BananaInfo): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "rest_0: BananaInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "rest_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 535, + "LSPosition": { + "line": 21, + "character": 15 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple4(fruit: \"apple\", info: AppleInfo): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "info: AppleInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple4(fruit: \"banana\", info: BananaInfo): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "info: BananaInfo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 562, + "LSPosition": { + "line": 22, + "character": 24 + }, + "Name": "7", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple4(fruit: \"apple\", info: AppleInfo): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "info: AppleInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple4(fruit: \"banana\", info: BananaInfo): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "info: BananaInfo" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple4" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "info" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 725, + "LSPosition": { + "line": 27, + "character": 15 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple5(fruit: \"apple\", ...firstInfo_n: AppleInfo[]): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...firstInfo_n: AppleInfo[]" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "firstInfo_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple5(fruit: \"banana\", ...firstInfo_n: BananaInfo[]): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...firstInfo_n: BananaInfo[]" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "firstInfo_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 752, + "LSPosition": { + "line": 28, + "character": 24 + }, + "Name": "9", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple5(fruit: \"apple\", ...firstInfo_n: AppleInfo[]): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...firstInfo_n: AppleInfo[]" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "firstInfo_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple5(fruit: \"banana\", ...firstInfo_n: BananaInfo[]): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...firstInfo_n: BananaInfo[]" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple5" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "firstInfo_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 839, + "LSPosition": { + "line": 31, + "character": 15 + }, + "Name": "10", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple6(fruit: \"apple\", ...fruitInfo: AppleInfo[]): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfo: AppleInfo[]" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple6(fruit: \"banana\", ...fruitInfo: BananaInfo[]): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfo: BananaInfo[]" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 866, + "LSPosition": { + "line": 32, + "character": 24 + }, + "Name": "11", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple6(fruit: \"apple\", ...fruitInfo: AppleInfo[]): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfo: AppleInfo[]" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple6(fruit: \"banana\", ...fruitInfo: BananaInfo[]): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfo: BananaInfo[]" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple6" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1078, + "LSPosition": { + "line": 37, + "character": 15 + }, + "Name": "12", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple7(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple7(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1105, + "LSPosition": { + "line": 38, + "character": 24 + }, + "Name": "13", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple7(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple7(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1150, + "LSPosition": { + "line": 39, + "character": 42 + }, + "Name": "14", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple7(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple7(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple7" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1250, + "LSPosition": { + "line": 42, + "character": 15 + }, + "Name": "15", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple8(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple8(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1277, + "LSPosition": { + "line": 43, + "character": 24 + }, + "Name": "16", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple8(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple8(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1322, + "LSPosition": { + "line": 44, + "character": 42 + }, + "Name": "17", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple8(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple8(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple8" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1444, + "LSPosition": { + "line": 47, + "character": 15 + }, + "Name": "18", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple9(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple9(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1471, + "LSPosition": { + "line": 48, + "character": 24 + }, + "Name": "19", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple9(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple9(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1516, + "LSPosition": { + "line": 49, + "character": 42 + }, + "Name": "20", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple9(fruit: \"apple\", ...fruitInfoOrNumber_n: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...fruitInfoOrNumber_n: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple9(fruit: \"banana\", ...fruitInfoOrNumber_n: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...fruitInfoOrNumber_n: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple9" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruitInfoOrNumber_n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1620, + "LSPosition": { + "line": 52, + "character": 16 + }, + "Name": "21", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple10(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple10(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1648, + "LSPosition": { + "line": 53, + "character": 25 + }, + "Name": "22", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple10(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple10(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1694, + "LSPosition": { + "line": 54, + "character": 43 + }, + "Name": "23", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple10(fruit: \"apple\", ...arg_1: AppleInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple10(fruit: \"banana\", ...arg_1: BananaInfo[], secondFruitInfoOrNumber: number): void", + "parameters": [ + { + "label": "fruit: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "secondFruitInfoOrNumber: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple10" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fruit" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "secondFruitInfoOrNumber" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1764, + "LSPosition": { + "line": 57, + "character": 16 + }, + "Name": "24", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple11(arg_0: \"apple\", ...arg_1: AppleInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple11(arg_0: \"banana\", ...arg_1: BananaInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1792, + "LSPosition": { + "line": 58, + "character": 25 + }, + "Name": "25", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple11(arg_0: \"apple\", ...arg_1: AppleInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple11(arg_0: \"banana\", ...arg_1: BananaInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1838, + "LSPosition": { + "line": 59, + "character": 43 + }, + "Name": "26", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "logFruitTuple11(arg_0: \"apple\", ...arg_1: AppleInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"apple\"" + }, + { + "label": "...arg_1: AppleInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"apple\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "AppleInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + }, + { + "label": "logFruitTuple11(arg_0: \"banana\", ...arg_1: BananaInfo[], arg_2: number): void", + "parameters": [ + { + "label": "arg_0: \"banana\"" + }, + { + "label": "...arg_1: BananaInfo[]" + }, + { + "label": "arg_2: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "logFruitTuple11" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_0" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "\"banana\"" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "BananaInfo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "arg_2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1916, + "LSPosition": { + "line": 61, + "character": 9 + }, + "Name": "27", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "withPair(first: number, named: string): void", + "parameters": [ + { + "label": "first: number" + }, + { + "label": "named: string" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "withPair" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "first" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "named" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1933, + "LSPosition": { + "line": 62, + "character": 14 + }, + "Name": "28", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "withPair(first: number, named: string): void", + "parameters": [ + { + "label": "first: number" + }, + { + "label": "named: string" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "withPair" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "first" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "named" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpInferenceJsDocImportTagVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpInferenceJsDocImportTagVS.baseline new file mode 100644 index 000000000..467d77b21 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpInferenceJsDocImportTagVS.baseline @@ -0,0 +1,88 @@ +// === SignatureHelp === +=== /b.js === +// /** +// * @import { +// * Foo +// * } from './a' +// */ +// +// /** +// * @param {Foo} a +// */ +// function foo(a) {} +// foo() +// ^ +// | ---------------------------------------------------------------------- +// | foo(**a: Foo**): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 98, + "LSPosition": { + "line": 10, + "character": 4 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "foo(a: Foo): void", + "parameters": [ + { + "label": "a: Foo" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpIteratorNextVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpIteratorNextVS.baseline new file mode 100644 index 000000000..a131f37aa --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpIteratorNextVS.baseline @@ -0,0 +1,1343 @@ +// === SignatureHelp === +=== /signatureHelpIteratorNextVS.ts === +// declare const iterator: Iterator; +// +// iterator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): IteratorResult +// | ---------------------------------------------------------------------- +// iterator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): IteratorResult +// | ---------------------------------------------------------------------- +// +// declare const generator: Generator; +// +// generator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): IteratorResult +// | ---------------------------------------------------------------------- +// generator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): IteratorResult +// | ---------------------------------------------------------------------- +// +// declare const asyncIterator: AsyncIterator; +// +// asyncIterator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): Promise> +// | ---------------------------------------------------------------------- +// asyncIterator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): Promise> +// | ---------------------------------------------------------------------- +// +// declare const asyncGenerator: AsyncGenerator; +// +// asyncGenerator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): Promise> +// | ---------------------------------------------------------------------- +// asyncGenerator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): Promise> +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 71, + "LSPosition": { + "line": 2, + "character": 14 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): IteratorResult", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): IteratorResult", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 88, + "LSPosition": { + "line": 3, + "character": 14 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): IteratorResult", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): IteratorResult", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 1 + } + }, + { + "marker": { + "Position": 168, + "LSPosition": { + "line": 7, + "character": 15 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): IteratorResult", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): IteratorResult", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 186, + "LSPosition": { + "line": 8, + "character": 15 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): IteratorResult", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): IteratorResult", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 1 + } + }, + { + "marker": { + "Position": 278, + "LSPosition": { + "line": 12, + "character": 19 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): Promise>", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): Promise>", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 300, + "LSPosition": { + "line": 13, + "character": 19 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): Promise>", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): Promise>", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 1 + } + }, + { + "marker": { + "Position": 395, + "LSPosition": { + "line": 17, + "character": 20 + }, + "Name": "7", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): Promise>", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): Promise>", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 418, + "LSPosition": { + "line": 18, + "character": 20 + }, + "Name": "8", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "next(): Promise>", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + }, + { + "label": "next(value: number): Promise>", + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "next" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Promise" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "text", + "Text": "IteratorResult" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + } + ] + } + } + ], + "activeSignature": 1 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocCallbackTagVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocCallbackTagVS.baseline new file mode 100644 index 000000000..10921c06f --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocCallbackTagVS.baseline @@ -0,0 +1,497 @@ +// === SignatureHelp === +=== /jsdocCallbackTag.js === +// /** +// * @callback FooHandler - A kind of magic +// * @param {string} eventName - So many words +// * @param eventName2 {number | string} - Silence is golden +// * @param eventName3 - Osterreich mos def +// * @return {number} - DIVEKICK +// */ +// /** +// * @type {FooHandler} callback +// */ +// var t; +// +// /** +// * @callback FooHandler2 - What, another one? +// * @param {string=} eventName - it keeps happening +// * @param {string} [eventName2] - i WARNED you dog +// */ +// /** +// * @type {FooHandler2} callback +// */ +// var t2; +// t("!", 12, false); +// ^ +// | ---------------------------------------------------------------------- +// | t(**eventName: string**, eventName2: number | string, eventName3: any): number +// | - `eventName: string`: - So many words + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | t(eventName: string, **eventName2: number | string**, eventName3: any): number +// | - `eventName2: number | string`: - Silence is golden + +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | t(eventName: string, eventName2: number | string, **eventName3: any**): number +// | - `eventName3: any`: - Osterreich mos def + +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 480, + "LSPosition": { + "line": 21, + "character": 2 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "t(eventName: string, eventName2: number | string, eventName3: any): number", + "parameters": [ + { + "label": "eventName: string", + "documentation": { + "kind": "markdown", + "value": "- So many words\n" + } + }, + { + "label": "eventName2: number | string", + "documentation": { + "kind": "markdown", + "value": "- Silence is golden\n" + } + }, + { + "label": "eventName3: any", + "documentation": { + "kind": "markdown", + "value": "- Osterreich mos def\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "t" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 485, + "LSPosition": { + "line": 21, + "character": 7 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "t(eventName: string, eventName2: number | string, eventName3: any): number", + "parameters": [ + { + "label": "eventName: string", + "documentation": { + "kind": "markdown", + "value": "- So many words\n" + } + }, + { + "label": "eventName2: number | string", + "documentation": { + "kind": "markdown", + "value": "- Silence is golden\n" + } + }, + { + "label": "eventName3: any", + "documentation": { + "kind": "markdown", + "value": "- Osterreich mos def\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "t" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 489, + "LSPosition": { + "line": 21, + "character": 11 + }, + "Name": "6", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "t(eventName: string, eventName2: number | string, eventName3: any): number", + "parameters": [ + { + "label": "eventName: string", + "documentation": { + "kind": "markdown", + "value": "- So many words\n" + } + }, + { + "label": "eventName2: number | string", + "documentation": { + "kind": "markdown", + "value": "- Silence is golden\n" + } + }, + { + "label": "eventName3: any", + "documentation": { + "kind": "markdown", + "value": "- Osterreich mos def\n" + } + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "t" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "eventName3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTagsVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTagsVS.baseline new file mode 100644 index 000000000..ba8e0a81e --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSDocTagsVS.baseline @@ -0,0 +1,301 @@ +// === SignatureHelp === +=== /signatureHelpJSDocTagsVS.ts === +// /** +// * This is class Foo. +// * @mytag comment1 comment2 +// */ +// class Foo { +// /** +// * This is the constructor. +// * @myjsdoctag this is a comment +// */ +// constructor(value: number) {} +// /** +// * method1 documentation +// * @mytag comment1 comment2 +// */ +// static method1() {} +// /** +// * @mytag +// */ +// method2() {} +// /** +// * @mytag comment1 comment2 +// */ +// property1: string; +// /** +// * @mytag1 some comments +// * some more comments about mytag1 +// * @mytag2 +// * here all the comments are on a new line +// * @mytag3 +// * @mytag +// */ +// property2: number; +// /** +// * @returns {number} a value +// */ +// method3(): number { return 3; } +// /** +// * @param {string} foo A value. +// * @returns {number} Another value +// * @mytag +// */ +// method4(foo: string): number { return 3; } +// /** @mytag */ +// method5() {} +// /** method documentation +// * @mytag a JSDoc tag +// */ +// newMethod() {} +// } +// var foo = new Foo(4); +// ^ +// | ---------------------------------------------------------------------- +// | Foo(**value: number**): Foo +// | This is the constructor. +// | ---------------------------------------------------------------------- +// Foo.method1(); +// ^ +// | ---------------------------------------------------------------------- +// | method1(): void +// | method1 documentation +// | ---------------------------------------------------------------------- +// foo.method2(); +// ^ +// | ---------------------------------------------------------------------- +// | method2(): void +// | ---------------------------------------------------------------------- +// foo.method3(); +// ^ +// | ---------------------------------------------------------------------- +// | method3(): number +// | ---------------------------------------------------------------------- +// foo.method4(); +// foo.property1; +// foo.property2; +// foo.method5(); +// foo.newMet +[ + { + "marker": { + "Position": 981, + "LSPosition": { + "line": 49, + "character": 18 + }, + "Name": "10", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Foo(value: number): Foo", + "documentation": { + "kind": "markdown", + "value": "This is the constructor." + }, + "parameters": [ + { + "label": "value: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "class name", + "Text": "Foo" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "Foo" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 997, + "LSPosition": { + "line": 50, + "character": 12 + }, + "Name": "11", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "method1(): void", + "documentation": { + "kind": "markdown", + "value": "method1 documentation" + }, + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "method1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1012, + "LSPosition": { + "line": 51, + "character": 12 + }, + "Name": "12", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "method2(): void", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "method2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 1027, + "LSPosition": { + "line": 52, + "character": 12 + }, + "Name": "13", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "method3(): number", + "parameters": [], + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "method3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSMissingPropertyAccessVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSMissingPropertyAccessVS.baseline new file mode 100644 index 000000000..d17d7dda1 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpJSMissingPropertyAccessVS.baseline @@ -0,0 +1,464 @@ +// === SignatureHelp === +=== /test.js === +// foo.filter() +// ^ +// | ---------------------------------------------------------------------- +// | ReadonlyArray.filter(**predicate: (value: T, index: number, array: readonly T[]) => value is S**, thisArg?: any): S[] +// | - `predicate: (value: T, index: number, array: readonly T[]) => value is S`: A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. + +// | Returns the elements of an array that meet the condition specified in a callback function. +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 11, + "LSPosition": { + "line": 0, + "character": 11 + }, + "Name": "", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "ReadonlyArray.filter(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[]", + "documentation": { + "kind": "markdown", + "value": "Returns the elements of an array that meet the condition specified in a callback function." + }, + "parameters": [ + { + "label": "predicate: (value: T, index: number, array: readonly T[]) => value is S", + "documentation": { + "kind": "markdown", + "value": "A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\n" + } + }, + { + "label": "thisArg?: any", + "documentation": { + "kind": "markdown", + "value": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "ReadonlyArray.filter" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "S extends T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "predicate" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "index" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "array" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "readonly" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "value" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "is" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "S" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "thisArg" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "S" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + } + ] + } + }, + { + "label": "ReadonlyArray.filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]", + "documentation": { + "kind": "markdown", + "value": "Returns the elements of an array that meet the condition specified in a callback function." + }, + "parameters": [ + { + "label": "predicate: (value: T, index: number, array: readonly T[]) => unknown", + "documentation": { + "kind": "markdown", + "value": "A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\n" + } + }, + { + "label": "thisArg?: any", + "documentation": { + "kind": "markdown", + "value": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "ReadonlyArray.filter" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "predicate" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "value" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "index" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "array" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "readonly" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "unknown" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "thisArg" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs1VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs1VS.baseline new file mode 100644 index 000000000..0901ea16f --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs1VS.baseline @@ -0,0 +1,648 @@ +// === SignatureHelp === +=== /signatureHelpRestArgs1VS.ts === +// function fn(a: number, b: number, c: number) {} +// const a = [1, 2] as const; +// const b = [1] as const; +// +// fn(...a, ); +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, b: number, **c: number**): void +// | ---------------------------------------------------------------------- +// fn(, ...a); +// ^ +// | ---------------------------------------------------------------------- +// | fn(**a: number**, b: number, c: number): void +// | ---------------------------------------------------------------------- +// +// fn(...b, ); +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, **b: number**, c: number): void +// | ---------------------------------------------------------------------- +// fn(, ...b, ); +// ^ +// | ---------------------------------------------------------------------- +// | fn(**a: number**, b: number, c: number): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, b: number, **c: number**): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 109, + "LSPosition": { + "line": 4, + "character": 9 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 115, + "LSPosition": { + "line": 5, + "character": 3 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 134, + "LSPosition": { + "line": 7, + "character": 9 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 140, + "LSPosition": { + "line": 8, + "character": 3 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 148, + "LSPosition": { + "line": 8, + "character": 11 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs2VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs2VS.baseline new file mode 100644 index 000000000..14f40157e --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs2VS.baseline @@ -0,0 +1,139 @@ +// === SignatureHelp === +=== /index.js === +// const promisify = function (thisArg, fnName) { +// const fn = thisArg[fnName]; +// return function () { +// return new Promise((resolve) => { +// fn.call(thisArg, ...arguments, ); +// ^ +// | ---------------------------------------------------------------------- +// | Function.call(thisArg: any, **...argArray: any[]**): any +// | - `...argArray: any[]`: A list of arguments to be passed to the method. + +// | Calls a method of an object, substituting another object for the current object. +// | ---------------------------------------------------------------------- +// }); +// }; +// }; +[ + { + "marker": { + "Position": 189, + "LSPosition": { + "line": 4, + "character": 43 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Function.call(thisArg: any, ...argArray: any[]): any", + "documentation": { + "kind": "markdown", + "value": "Calls a method of an object, substituting another object for the current object." + }, + "parameters": [ + { + "label": "thisArg: any", + "documentation": { + "kind": "markdown", + "value": "The object to be used as the current object.\n" + } + }, + { + "label": "...argArray: any[]", + "documentation": { + "kind": "markdown", + "value": "A list of arguments to be passed to the method.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "Function.call" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "thisArg" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "argArray" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3VS.baseline new file mode 100644 index 000000000..fbf9b94fc --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpRestArgs3VS.baseline @@ -0,0 +1,706 @@ +// === SignatureHelp === +=== /signatureHelpRestArgs3VS.ts === +// const layers = Object.assign({}, ...[]); +// ^ +// | ---------------------------------------------------------------------- +// | assign(target: object, **...sources: any[]**): any +// | - `...sources: any[]`: One or more source objects from which to copy properties + +// | Copy the values of all of the enumerable own properties from one or more source objects to a +// | target object. Returns the target object. +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 33, + "LSPosition": { + "line": 0, + "character": 33 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "assign(target: T, source: U): T & U", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object." + }, + "parameters": [ + { + "label": "target: T", + "documentation": { + "kind": "markdown", + "value": "The target object to copy to.\n" + } + }, + { + "label": "source: U", + "documentation": { + "kind": "markdown", + "value": "The source object from which to copy properties.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "assign" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T extends {}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "target" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + } + ] + } + }, + { + "label": "assign(target: T, source1: U, source2: V): T & U & V", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object." + }, + "parameters": [ + { + "label": "target: T", + "documentation": { + "kind": "markdown", + "value": "The target object to copy to.\n" + } + }, + { + "label": "source1: U", + "documentation": { + "kind": "markdown", + "value": "The first source object from which to copy properties.\n" + } + }, + { + "label": "source2: V", + "documentation": { + "kind": "markdown", + "value": "The second source object from which to copy properties.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "assign" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T extends {}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "target" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "V" + } + ] + } + }, + { + "label": "assign(target: T, source1: U, source2: V, source3: W): T & U & V & W", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object." + }, + "parameters": [ + { + "label": "target: T", + "documentation": { + "kind": "markdown", + "value": "The target object to copy to.\n" + } + }, + { + "label": "source1: U", + "documentation": { + "kind": "markdown", + "value": "The first source object from which to copy properties.\n" + } + }, + { + "label": "source2: V", + "documentation": { + "kind": "markdown", + "value": "The second source object from which to copy properties.\n" + } + }, + { + "label": "source3: W", + "documentation": { + "kind": "markdown", + "value": "The third source object from which to copy properties.\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "assign" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T extends {}" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "target" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source1" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "source3" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "T" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "U" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "V" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "&" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "text", + "Text": "W" + } + ] + } + }, + { + "label": "assign(target: object, ...sources: any[]): any", + "documentation": { + "kind": "markdown", + "value": "Copy the values of all of the enumerable own properties from one or more source objects to a\ntarget object. Returns the target object." + }, + "parameters": [ + { + "label": "target: object", + "documentation": { + "kind": "markdown", + "value": "The target object to copy to.\n" + } + }, + { + "label": "...sources: any[]", + "documentation": { + "kind": "markdown", + "value": "One or more source objects from which to copy properties\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "assign" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "target" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "object" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "..." + }, + { + "ClassificationTypeName": "parameter name", + "Text": "sources" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "[" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "]" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 3 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpSkippedArgs1VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpSkippedArgs1VS.baseline new file mode 100644 index 000000000..2a22bdf49 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpSkippedArgs1VS.baseline @@ -0,0 +1,641 @@ +// === SignatureHelp === +=== /signatureHelpSkippedArgs1VS.ts === +// function fn(a: number, b: number, c: number) {} +// fn(, , , , ); +// ^ +// | ---------------------------------------------------------------------- +// | fn(**a: number**, b: number, c: number): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, **b: number**, c: number): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, b: number, **c: number**): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, b: number, c: number): void +// | ---------------------------------------------------------------------- +// ^ +// | ---------------------------------------------------------------------- +// | fn(a: number, b: number, c: number): void +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 51, + "LSPosition": { + "line": 1, + "character": 3 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 53, + "LSPosition": { + "line": 1, + "character": 5 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 55, + "LSPosition": { + "line": 1, + "character": 7 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 57, + "LSPosition": { + "line": 1, + "character": 9 + }, + "Name": "4", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 59, + "LSPosition": { + "line": 1, + "character": 11 + }, + "Name": "5", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "fn(a: number, b: number, c: number): void", + "parameters": [ + { + "label": "a: number" + }, + { + "label": "b: number" + }, + { + "label": "c: number" + } + ], + "activeParameter": 4, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2VS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2VS.baseline new file mode 100644 index 000000000..a58563e5c --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpTypeArguments2VS.baseline @@ -0,0 +1,748 @@ +// === SignatureHelp === +=== /signatureHelpTypeArguments2VS.ts === +// /** some documentation +// * @template T some documentation 2 +// * @template W +// * @template U,V others +// * @param a ok +// * @param b not ok +// */ +// function f(a: number, b: string, c: boolean): void { } +// f<; +// ^ +// | ---------------------------------------------------------------------- +// | f<**T**, U, V, W>(a: number, b: string, c: boolean): void +// | some documentation +// | ---------------------------------------------------------------------- +// f(a: number, b: string, c: boolean): void +// | some documentation +// | ---------------------------------------------------------------------- +// f(a: number, b: string, c: boolean): void +// | some documentation +// | ---------------------------------------------------------------------- +// f(a: number, b: string, c: boolean): void +// | some documentation +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 205, + "LSPosition": { + "line": 8, + "character": 2 + }, + "Name": "f0", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation" + }, + "parameters": [ + { + "label": "T" + }, + { + "label": "U" + }, + { + "label": "V" + }, + { + "label": "W" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "boolean" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 217, + "LSPosition": { + "line": 9, + "character": 10 + }, + "Name": "f1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation" + }, + "parameters": [ + { + "label": "T" + }, + { + "label": "U" + }, + { + "label": "V" + }, + { + "label": "W" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "boolean" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 237, + "LSPosition": { + "line": 10, + "character": 18 + }, + "Name": "f2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation" + }, + "parameters": [ + { + "label": "T" + }, + { + "label": "U" + }, + { + "label": "V" + }, + { + "label": "W" + } + ], + "activeParameter": 2, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "boolean" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 266, + "LSPosition": { + "line": 11, + "character": 27 + }, + "Name": "f3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: number, b: string, c: boolean): void", + "documentation": { + "kind": "markdown", + "value": "some documentation" + }, + "parameters": [ + { + "label": "T" + }, + { + "label": "U" + }, + { + "label": "V" + }, + { + "label": "W" + } + ], + "activeParameter": 3, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "<" + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "T" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "U" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "V" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "type parameter name", + "Text": "W" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ">" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "c" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "boolean" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknownVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknownVS.baseline new file mode 100644 index 000000000..76356cce0 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelpWithUnknownVS.baseline @@ -0,0 +1,89 @@ +// === SignatureHelp === +=== /signatureHelpWithUnknownVS.ts === +// eval(\ +// ^ +// | ---------------------------------------------------------------------- +// | eval(**x: string**): any +// | - `x: string`: A String value that contains valid JavaScript code. + +// | Evaluates JavaScript code and executes it. +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 6, + "LSPosition": { + "line": 0, + "character": 6 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "eval(x: string): any", + "documentation": { + "kind": "markdown", + "value": "Evaluates JavaScript code and executes it." + }, + "parameters": [ + { + "label": "x: string", + "documentation": { + "kind": "markdown", + "value": "A String value that contains valid JavaScript code.\n" + } + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "eval" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "any" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/signatureHelp_unionTypeVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelp_unionTypeVS.baseline new file mode 100644 index 000000000..5a5a977a3 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/signatureHelp_unionTypeVS.baseline @@ -0,0 +1,395 @@ +// === SignatureHelp === +=== /signatureHelp_unionTypeVS.ts === +// declare const a: (fn?: ((x: string) => string) | ((y: number) => number)) => void; +// declare const b: (x: string | number) => void; +// +// interface Callback { +// (x: string): string; +// (x: number): number; +// (x: string | number): string | number; +// } +// declare function c(callback: Callback): void; +// a(() => { +// ^ +// | ---------------------------------------------------------------------- +// | a(**fn?: ((x: string) => string) | ((y: number) => number)**): void +// | ---------------------------------------------------------------------- +// return undefined; +// }); +// +// b(); +// ^ +// | ---------------------------------------------------------------------- +// | b(**x: string | number**): void +// | ---------------------------------------------------------------------- +// +// c(() => {}); +// ^ +// | ---------------------------------------------------------------------- +// | Callback(**x: string | number**): string | number +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 296, + "LSPosition": { + "line": 9, + "character": 3 + }, + "Name": "1", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "a(fn?: ((x: string) => string) | ((y: number) => number)): void", + "parameters": [ + { + "label": "fn?: ((x: string) => string) | ((y: number) => number)" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "fn" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "?" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "y" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "=>" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 332, + "LSPosition": { + "line": 13, + "character": 2 + }, + "Name": "2", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "b(x: string | number): void", + "parameters": [ + { + "label": "x: string | number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "local name", + "Text": "b" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "void" + } + ] + } + } + ], + "activeSignature": 0 + } + }, + { + "marker": { + "Position": 339, + "LSPosition": { + "line": 15, + "character": 3 + }, + "Name": "3", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "Callback(x: string | number): string | number", + "parameters": [ + { + "label": "x: string | number" + } + ], + "activeParameter": 0, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "interface name", + "Text": "Callback" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "x" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "punctuation", + "Text": "|" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelpVS.baseline b/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelpVS.baseline new file mode 100644 index 000000000..9fba82dc5 --- /dev/null +++ b/testdata/baselines/reference/fourslash/signatureHelp/trailingCommaSignatureHelpVS.baseline @@ -0,0 +1,253 @@ +// === SignatureHelp === +=== /trailingCommaSignatureHelpVS.ts === +// function str(n: number): string; +// /** +// * Stringifies a number with radix +// * @param radix The radix +// */ +// function str(n: number, radix: number): string; +// function str(n: number, radix?: number): string { return ""; } +// +// str(1, ) +// ^ +// | ---------------------------------------------------------------------- +// | str(n: number, **radix: number**): string +// | - `radix: number`: The radix + +// | Stringifies a number with radix +// | ---------------------------------------------------------------------- +// +// declare function f(a: T): T; +// f(2, ); +// ^ +// | ---------------------------------------------------------------------- +// | f(a: 2): 2 +// | ---------------------------------------------------------------------- +[ + { + "marker": { + "Position": 221, + "LSPosition": { + "line": 8, + "character": 7 + }, + "Name": "a", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "str(n: number): string", + "parameters": [ + { + "label": "n: number" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "str" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + } + ] + } + }, + { + "label": "str(n: number, radix: number): string", + "documentation": { + "kind": "markdown", + "value": "Stringifies a number with radix" + }, + "parameters": [ + { + "label": "n: number" + }, + { + "label": "radix: number", + "documentation": { + "kind": "markdown", + "value": "The radix\n" + } + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "str" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "n" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "," + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "parameter name", + "Text": "radix" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "number" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "keyword", + "Text": "string" + } + ] + } + } + ], + "activeSignature": 1 + } + }, + { + "marker": { + "Position": 261, + "LSPosition": { + "line": 11, + "character": 5 + }, + "Name": "b", + "Data": {} + }, + "item": { + "signatures": [ + { + "label": "f(a: 2): 2", + "parameters": [ + { + "label": "a: 2" + } + ], + "activeParameter": 1, + "_vs_colorizedLabel": { + "Runs": [ + { + "ClassificationTypeName": "method name", + "Text": "f" + }, + { + "ClassificationTypeName": "punctuation", + "Text": "(" + }, + { + "ClassificationTypeName": "parameter name", + "Text": "a" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "2" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ")" + }, + { + "ClassificationTypeName": "punctuation", + "Text": ":" + }, + { + "ClassificationTypeName": "whitespace", + "Text": " " + }, + { + "ClassificationTypeName": "string", + "Text": "2" + } + ] + } + } + ], + "activeSignature": 0 + } + } +] \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitGlobalThisPreserved.js b/testdata/baselines/reference/submodule/compiler/declarationEmitGlobalThisPreserved.js index bc9eefece..0d3f70f44 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitGlobalThisPreserved.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitGlobalThisPreserved.js @@ -122,7 +122,7 @@ export declare const aObj: { a4: (isNaN: number) => typeof globalThis.isNaN; }; export type a4Return = ReturnType>; -export type a4oReturn = ReturnType>; +export type a4oReturn = ReturnType>; export declare const b1: (isNaN: typeof globalThis.isNaN) => typeof globalThis.isNaN; export declare const b2: (isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN) => typeof globalThis.isNaN; export declare const b3: (isNaN: number, bar: typeof globalThis.isNaN) => typeof globalThis.isNaN; @@ -134,7 +134,7 @@ export declare const bObj: { b4: (isNaN: number) => typeof globalThis.isNaN; }; export type b4Return = ReturnType>; -export type b4oReturn = ReturnType>; +export type b4oReturn = ReturnType>; export declare function c1(isNaN: typeof globalThis.isNaN): typeof globalThis.isNaN; export declare function c2(isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN): typeof globalThis.isNaN; export declare function c3(isNaN: number, bar: typeof globalThis.isNaN): typeof globalThis.isNaN; @@ -146,7 +146,7 @@ export declare const cObj: { c4(isNaN: number): typeof globalThis.isNaN; }; export type c4Return = ReturnType>; -export type c4oReturn = ReturnType>; +export type c4oReturn = ReturnType>; export declare function d1(): () => (isNaN: typeof globalThis.isNaN) => typeof globalThis.isNaN; export declare function d2(): () => (isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN) => typeof globalThis.isNaN; export declare function d3(): () => (isNaN: number, bar: typeof globalThis.isNaN) => typeof globalThis.isNaN; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.js b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.js index c342d487d..66a05b4f4 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.js @@ -44,7 +44,7 @@ declare const a: { }; export declare const o1: (o: A['a']['b']) => void; export declare const o2: (o: (typeof a)['a']) => void; -export declare const o3: (o: (typeof a)['a']) => void; +export declare const o3: (o: typeof a['a']) => void; export declare const o4: (o: keyof (A['a'])) => void; export {}; //// [main.d.ts] diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types index e62f0ade3..e709acb4d 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types @@ -34,8 +34,8 @@ export const o2 = (o: (typeof a)['a']) => {} >a : { readonly a: "value of a"; readonly notNecessary: "X"; } export const o3 = (o: typeof a['a']) => {} ->o3 : (o: (typeof a)['a']) => void ->(o: typeof a['a']) => {} : (o: (typeof a)['a']) => void +>o3 : (o: typeof a['a']) => void +>(o: typeof a['a']) => {} : (o: typeof a['a']) => void >o : "value of a" >a : { readonly a: "value of a"; readonly notNecessary: "X"; } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types.diff index 7aea43a7b..efce400be 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitResolveTypesIfNotReusable.types.diff @@ -21,8 +21,8 @@ export const o3 = (o: typeof a['a']) => {} ->o3 : (o: (typeof a)["a"]) => void ->(o: typeof a['a']) => {} : (o: (typeof a)["a"]) => void -+>o3 : (o: (typeof a)['a']) => void -+>(o: typeof a['a']) => {} : (o: (typeof a)['a']) => void ++>o3 : (o: typeof a['a']) => void ++>(o: typeof a['a']) => {} : (o: typeof a['a']) => void >o : "value of a" >a : { readonly a: "value of a"; readonly notNecessary: "X"; } diff --git a/testdata/baselines/reference/submodule/compiler/reachabilityChecksNoCrash1.errors.txt b/testdata/baselines/reference/submodule/compiler/reachabilityChecksNoCrash1.errors.txt index 721d50fa3..fa08b6ff7 100644 --- a/testdata/baselines/reference/submodule/compiler/reachabilityChecksNoCrash1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/reachabilityChecksNoCrash1.errors.txt @@ -20,7 +20,6 @@ reachabilityChecksNoCrash1.ts(2,11): error TS2304: Cannot find name 'out'. reachabilityChecksNoCrash1.ts(2,19): error TS1005: ',' expected. reachabilityChecksNoCrash1.ts(3,9): error TS1005: ':' expected. reachabilityChecksNoCrash1.ts(3,16): error TS1109: Expression expected. -reachabilityChecksNoCrash1.ts(3,16): error TS1135: Argument expression expected. reachabilityChecksNoCrash1.ts(3,22): error TS1005: ':' expected. reachabilityChecksNoCrash1.ts(3,22): error TS2304: Cannot find name 'v'. reachabilityChecksNoCrash1.ts(3,24): error TS1005: ',' expected. @@ -34,10 +33,9 @@ reachabilityChecksNoCrash1.ts(4,12): error TS1005: ',' expected. reachabilityChecksNoCrash1.ts(4,24): error TS2304: Cannot find name 'v'. reachabilityChecksNoCrash1.ts(4,26): error TS1005: ',' expected. reachabilityChecksNoCrash1.ts(7,1): error TS1109: Expression expected. -reachabilityChecksNoCrash1.ts(7,1): error TS1128: Declaration or statement expected. -==== reachabilityChecksNoCrash1.ts (37 errors) ==== +==== reachabilityChecksNoCrash1.ts (35 errors) ==== export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { ~~~~~~~~~~~~~~ !!! error TS7010: 'arrayFromAsync', which lacks return-type annotation, implicitly has an 'any' return type. @@ -86,8 +84,6 @@ reachabilityChecksNoCrash1.ts(7,1): error TS1128: Declaration or statement expec !!! error TS1005: ':' expected. ~~~~~ !!! error TS1109: Expression expected. - ~~~~~ -!!! error TS1135: Argument expression expected. ~ !!! error TS1005: ':' expected. ~ @@ -121,6 +117,4 @@ reachabilityChecksNoCrash1.ts(7,1): error TS1128: Declaration or statement expec } ~ !!! error TS1109: Expression expected. - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types b/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types index e688ec7b9..e3b5e5c0c 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types +++ b/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types @@ -49,15 +49,15 @@ line 2"; var stringLiteralWithLineSeparator = "line 1\ >stringLiteralWithLineSeparator : string ->"line 1\
line 2" : "line 1âline 2" +>"line 1\
line 2" : "line 1line 2" line 2"; var stringLiteralWithParagraphSeparator = "line 1\ >stringLiteralWithParagraphSeparator : string ->"line 1\
line 2" : "line 1âline 2" +>"line 1\
line 2" : "line 1line 2" line 2"; var stringLiteralWithNextLine = "line 1\…line 2"; >stringLiteralWithNextLine : string ->"line 1\…line 2" : "line 1Âline 2" +>"line 1\…line 2" : "line 1\u0085line 2" diff --git a/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types.diff b/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types.diff deleted file mode 100644 index 8a4e10b55..000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMap-LineBreaks(target=es2015).types.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.sourceMap-LineBreaks(target=es2015).types -+++ new.sourceMap-LineBreaks(target=es2015).types -@@= skipped -48, +48 lines =@@ - - var stringLiteralWithLineSeparator = "line 1\ - >stringLiteralWithLineSeparator : string -->"line 1\
line 2" : "line 1line 2" -+>"line 1\
line 2" : "line 1âline 2" - - line 2"; - var stringLiteralWithParagraphSeparator = "line 1\ - >stringLiteralWithParagraphSeparator : string -->"line 1\
line 2" : "line 1line 2" -+>"line 1\
line 2" : "line 1âline 2" - - line 2"; - var stringLiteralWithNextLine = "line 1\…line 2"; - >stringLiteralWithNextLine : string -->"line 1\…line 2" : "line 1\u0085line 2" -+>"line 1\…line 2" : "line 1Âline 2" diff --git a/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types b/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types index 020eb3dbb..1261dd44f 100644 --- a/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types +++ b/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types @@ -74,7 +74,7 @@ STRING_CONTENT STRING_CONTENT", `\ ->`\
` : "â" +>`\
` : "" `, ' diff --git a/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types.diff b/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types.diff deleted file mode 100644 index 334ce77db..000000000 --- a/testdata/baselines/reference/submodule/conformance/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types -+++ new.allowUnescapedParagraphAndLineSeparatorsInStringLiteral.types -@@= skipped -73, +73 lines =@@ - - STRING_CONTENT", - `\ -->`\
` : "" -+>`\
` : "â" - - `, - ' \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types b/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types index da805aefa..5bddfd987 100644 --- a/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types +++ b/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types @@ -79,7 +79,7 @@ enum E5 { >0.0 : 0 e = NaN, ->e : E5.e +>e : E5.d >NaN : number f = Infinity, @@ -120,7 +120,7 @@ const enum E6 { >0.0 : 0 e = NaN, ->e : E6.e +>e : E6.d >NaN : number f = Infinity, diff --git a/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types.diff b/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types.diff deleted file mode 100644 index d7977f842..000000000 --- a/testdata/baselines/reference/submodule/conformance/enumConstantMembers.types.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.enumConstantMembers.types -+++ new.enumConstantMembers.types -@@= skipped -78, +78 lines =@@ - >0.0 : 0 - - e = NaN, -->e : E5.d -+>e : E5.e - >NaN : number - - f = Infinity, -@@= skipped -41, +41 lines =@@ - >0.0 : 0 - - e = NaN, -->e : E6.d -+>e : E6.e - >NaN : number - - f = Infinity, \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitGlobalThisPreserved.js.diff b/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitGlobalThisPreserved.js.diff deleted file mode 100644 index 1a66a3a0f..000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitGlobalThisPreserved.js.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.declarationEmitGlobalThisPreserved.js -+++ new.declarationEmitGlobalThisPreserved.js -@@= skipped -121, +121 lines =@@ - a4: (isNaN: number) => typeof globalThis.isNaN; - }; - export type a4Return = ReturnType>; --export type a4oReturn = ReturnType>; -+export type a4oReturn = ReturnType>; - export declare const b1: (isNaN: typeof globalThis.isNaN) => typeof globalThis.isNaN; - export declare const b2: (isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN) => typeof globalThis.isNaN; - export declare const b3: (isNaN: number, bar: typeof globalThis.isNaN) => typeof globalThis.isNaN; -@@= skipped -12, +12 lines =@@ - b4: (isNaN: number) => typeof globalThis.isNaN; - }; - export type b4Return = ReturnType>; --export type b4oReturn = ReturnType>; -+export type b4oReturn = ReturnType>; - export declare function c1(isNaN: typeof globalThis.isNaN): typeof globalThis.isNaN; - export declare function c2(isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN): typeof globalThis.isNaN; - export declare function c3(isNaN: number, bar: typeof globalThis.isNaN): typeof globalThis.isNaN; -@@= skipped -12, +12 lines =@@ - c4(isNaN: number): typeof globalThis.isNaN; - }; - export type c4Return = ReturnType>; --export type c4oReturn = ReturnType>; -+export type c4oReturn = ReturnType>; - export declare function d1(): () => (isNaN: typeof globalThis.isNaN) => typeof globalThis.isNaN; - export declare function d2(): () => (isNaN: typeof globalThis.isNaN, bar?: typeof globalThis.isNaN) => typeof globalThis.isNaN; - export declare function d3(): () => (isNaN: number, bar: typeof globalThis.isNaN) => typeof globalThis.isNaN; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitResolveTypesIfNotReusable.js.diff b/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitResolveTypesIfNotReusable.js.diff index 98fc27ee8..77812febf 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitResolveTypesIfNotReusable.js.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitResolveTypesIfNotReusable.js.diff @@ -10,7 +10,7 @@ -export declare const o4: (o: keyof A["a"]) => void; +export declare const o1: (o: A['a']['b']) => void; +export declare const o2: (o: (typeof a)['a']) => void; -+export declare const o3: (o: (typeof a)['a']) => void; ++export declare const o3: (o: typeof a['a']) => void; +export declare const o4: (o: keyof (A['a'])) => void; export {}; //// [main.d.ts] diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/reachabilityChecksNoCrash1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/reachabilityChecksNoCrash1.errors.txt.diff index ff9b9d54b..c014d5869 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/reachabilityChecksNoCrash1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/reachabilityChecksNoCrash1.errors.txt.diff @@ -9,38 +9,7 @@ reachabilityChecksNoCrash1.ts(1,84): error TS2304: Cannot find name 'T'. reachabilityChecksNoCrash1.ts(1,86): error TS1011: An element access expression should take an argument. reachabilityChecksNoCrash1.ts(2,11): error TS1005: ':' expected. -@@= skipped -8, +8 lines =@@ - reachabilityChecksNoCrash1.ts(2,19): error TS1005: ',' expected. - reachabilityChecksNoCrash1.ts(3,9): error TS1005: ':' expected. - reachabilityChecksNoCrash1.ts(3,16): error TS1109: Expression expected. -+reachabilityChecksNoCrash1.ts(3,16): error TS1135: Argument expression expected. - reachabilityChecksNoCrash1.ts(3,22): error TS1005: ':' expected. - reachabilityChecksNoCrash1.ts(3,22): error TS2304: Cannot find name 'v'. - reachabilityChecksNoCrash1.ts(3,24): error TS1005: ',' expected. -@@= skipped -13, +14 lines =@@ - reachabilityChecksNoCrash1.ts(4,24): error TS2304: Cannot find name 'v'. - reachabilityChecksNoCrash1.ts(4,26): error TS1005: ',' expected. - reachabilityChecksNoCrash1.ts(7,1): error TS1109: Expression expected. -- -- --==== reachabilityChecksNoCrash1.ts (35 errors) ==== -+reachabilityChecksNoCrash1.ts(7,1): error TS1128: Declaration or statement expected. -+ -+ -+==== reachabilityChecksNoCrash1.ts (37 errors) ==== - export async function arrayFromAsync(asyncIterable!: AsyncIterable): Promise { - ~~~~~~~~~~~~~~ - !!! error TS7010: 'arrayFromAsync', which lacks return-type annotation, implicitly has an 'any' return type. -@@= skipped -51, +52 lines =@@ - !!! error TS1005: ':' expected. - ~~~~~ - !!! error TS1109: Expression expected. -+ ~~~~~ -+!!! error TS1135: Argument expression expected. - ~ - !!! error TS1005: ':' expected. - ~ -@@= skipped -28, +30 lines =@@ +@@= skipped -100, +100 lines =@@ !!! error TS1005: ',' expected. } ~~~~~ @@ -48,8 +17,4 @@ +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ const: never[]; for: any; of: any; asyncIterable: any; out: any; "": any; }'. return out; } - ~ - !!! error TS1109: Expression expected. -+ ~ -+!!! error TS1128: Declaration or statement expected. - \ No newline at end of file + ~ \ No newline at end of file diff --git a/testdata/submoduleAccepted.txt b/testdata/submoduleAccepted.txt index f4ce04238..c5df3f724 100644 --- a/testdata/submoduleAccepted.txt +++ b/testdata/submoduleAccepted.txt @@ -436,7 +436,6 @@ compiler/declarationEmitFirstTypeArgumentGenericFunctionType.js.diff compiler/declarationEmitFirstTypeArgumentGenericFunctionType.types.diff compiler/declarationEmitFunctionDuplicateNamespace.symbols.diff compiler/declarationEmitFunctionDuplicateNamespace.types.diff -compiler/declarationEmitGlobalThisPreserved.js.diff compiler/declarationEmitHigherOrderRetainedGenerics.js.diff compiler/declarationEmitHigherOrderRetainedGenerics.types.diff compiler/declarationEmitMappedTypeDistributivityPreservesConstraints.js.diff diff --git a/testdata/tests/cases/compiler/anonymousClassDecoratorEs2022.ts b/testdata/tests/cases/compiler/anonymousClassDecoratorEs2022.ts new file mode 100644 index 000000000..9562481b9 --- /dev/null +++ b/testdata/tests/cases/compiler/anonymousClassDecoratorEs2022.ts @@ -0,0 +1,8 @@ +// @target: es2022 + +class { + @x + m() { + // ... + } +}; diff --git a/testdata/tests/cases/compiler/awaitObjectLiteral.ts b/testdata/tests/cases/compiler/awaitObjectLiteral.ts new file mode 100644 index 000000000..d63cf68d1 --- /dev/null +++ b/testdata/tests/cases/compiler/awaitObjectLiteral.ts @@ -0,0 +1,9 @@ +// @target: esnext +// @module: esnext + +// @filename: fileA.ts +export {} +const foo = await { bar: 42 } + +// @filename: fileB.ts +export const baz = await { x: 1, y: "hello" } diff --git a/testdata/tests/cases/compiler/backslashBeforeNonSpecialChar.ts b/testdata/tests/cases/compiler/backslashBeforeNonSpecialChar.ts new file mode 100644 index 000000000..e7a547281 --- /dev/null +++ b/testdata/tests/cases/compiler/backslashBeforeNonSpecialChar.ts @@ -0,0 +1,7 @@ +// @target: esnext + +const enum Currency { + Euro = "\€", +} + +const currency = Currency.Euro; diff --git a/testdata/tests/cases/compiler/catchClauseRestProperties.ts b/testdata/tests/cases/compiler/catchClauseRestProperties.ts new file mode 100644 index 000000000..8ca49fcb9 --- /dev/null +++ b/testdata/tests/cases/compiler/catchClauseRestProperties.ts @@ -0,0 +1,7 @@ +// @target: es2017 + +try { + // ... +} catch ({ ...rest }) { + // ... +} diff --git a/testdata/tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts b/testdata/tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts new file mode 100644 index 000000000..2dfa28d09 --- /dev/null +++ b/testdata/tests/cases/compiler/contextuallyTypedFunctionOptionalAndRest.ts @@ -0,0 +1,3 @@ +// @strict: true + +const f: () => void = (a?, ...b) => {}; diff --git a/testdata/tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts b/testdata/tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts new file mode 100644 index 000000000..a92ff25dd --- /dev/null +++ b/testdata/tests/cases/compiler/declarationEmitNonAsciiStringLiteralType.ts @@ -0,0 +1,21 @@ +// @declaration: true +// @emitDeclarationOnly: true + +export const IconEmojis = { + alert_low: "⚠️", +} as const; + +export const singleEmoji = "⚠️" as const; + +export const tuple = ["⚠️", "日本語"] as const; + +export function returnsEmoji(): "⚠️" { + return "⚠️"; +} + +export const templateEmoji = `⚠️` as const; + +export const templateObj = { + alert: `⚠️`, + greet: `日本語`, +} as const; diff --git a/testdata/tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts b/testdata/tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts new file mode 100644 index 000000000..67ab01d58 --- /dev/null +++ b/testdata/tests/cases/compiler/declarationEmitPrivateAsyncMethod.ts @@ -0,0 +1,15 @@ +// @declaration: true +// @filename: a.ts +export class C { + /** + * Non Async function + */ + private a(): void { + } + + /** + * Async function + */ + private async b(): Promise { + } +} diff --git a/testdata/tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts b/testdata/tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts new file mode 100644 index 000000000..989228b6b --- /dev/null +++ b/testdata/tests/cases/compiler/declarationEmitTypeofIndexedAccessNoParens.ts @@ -0,0 +1,23 @@ +// @declaration: true +// @emitDeclarationOnly: true + +export const C = { A: 1 }; +export type C = typeof C[keyof typeof C]; + +// Parenthesized form should also round-trip +export type C2 = (typeof C)[keyof typeof C]; + +// IndexedAccessType: index access of a parsed typeof should preserve source +export const arr = [C]; +export type ArrAlias = typeof arr[number]; + +// ArrayType: array of a parsed typeof should preserve source +export type CArr = typeof C[]; +// Parenthesized array form should also round-trip +export type CArr2 = (typeof C)[]; + +// OptionalType (tuple element): optional of a parsed typeof should preserve source +export type CTuple = [typeof C?]; +// Parenthesized optional form should also round-trip +export type CTuple2 = [(typeof C)?]; + diff --git a/testdata/tests/cases/compiler/destructuringEmptyBinding.ts b/testdata/tests/cases/compiler/destructuringEmptyBinding.ts new file mode 100644 index 000000000..bd2c3cb1e --- /dev/null +++ b/testdata/tests/cases/compiler/destructuringEmptyBinding.ts @@ -0,0 +1,3 @@ +// @target: es2017 +// @filename: a.ts +export var {...{ }} = x; diff --git a/testdata/tests/cases/compiler/emitIncompleteDoStatement.ts b/testdata/tests/cases/compiler/emitIncompleteDoStatement.ts new file mode 100644 index 000000000..7fdadb335 --- /dev/null +++ b/testdata/tests/cases/compiler/emitIncompleteDoStatement.ts @@ -0,0 +1,2 @@ +// @filename: a.ts +do \ No newline at end of file diff --git a/testdata/tests/cases/compiler/emitReactJsxSelfClosingElement.tsx b/testdata/tests/cases/compiler/emitReactJsxSelfClosingElement.tsx new file mode 100644 index 000000000..488c3d322 --- /dev/null +++ b/testdata/tests/cases/compiler/emitReactJsxSelfClosingElement.tsx @@ -0,0 +1,3 @@ +// @jsx: react-jsx +// @filename: a.tsx +const app = ; diff --git a/testdata/tests/cases/compiler/enumNaNValues.ts b/testdata/tests/cases/compiler/enumNaNValues.ts new file mode 100644 index 000000000..33c0d0374 --- /dev/null +++ b/testdata/tests/cases/compiler/enumNaNValues.ts @@ -0,0 +1,15 @@ +// @strict: true + +enum E { + A = NaN, + B = NaN, +} + +const a: E.A = E.B; +const b: E.B = E.A; + +enum F { + X = NaN, +} + +const c: E.A = F.X; // Error expected - different enums diff --git a/testdata/tests/cases/compiler/forAwaitInAsyncAccessor.ts b/testdata/tests/cases/compiler/forAwaitInAsyncAccessor.ts new file mode 100644 index 000000000..35804dc85 --- /dev/null +++ b/testdata/tests/cases/compiler/forAwaitInAsyncAccessor.ts @@ -0,0 +1,7 @@ +// @filename: a.ts +class C { + async get x() { + for await (const y of []) { + } + } +} diff --git a/testdata/tests/cases/compiler/inferFromTupleRestAndVariadic.ts b/testdata/tests/cases/compiler/inferFromTupleRestAndVariadic.ts new file mode 100644 index 000000000..b040b8c8e --- /dev/null +++ b/testdata/tests/cases/compiler/inferFromTupleRestAndVariadic.ts @@ -0,0 +1,23 @@ +// @strict: true +// Crash when inferring from tuple types with rest and variadic elements +// where the variadic element's constraint consumes all source tuple elements. +// The pattern [...rest, ...T] where T is constrained by a fixed-size tuple +// calls getElementTypeOfSliceOfTupleType which can return nil when the +// source tuple is entirely consumed by T's implied arity. + +type SubTup = T extends [ + ...(infer C)[], + ...infer B extends [any, any] +] ? B : never; +type Trigger = SubTup<[1, 2]>; + +// Also test the [...T, ...rest] pattern +type SubTup2 = T extends [ + ...infer A extends [any, any], + ...(infer D)[], +] ? A : never; +type Trigger2 = SubTup2<[1, 2]>; + +// Test with more elements than implied arity (should work fine) +type Trigger3 = SubTup<[1, 2, 3, 4]>; +type Trigger4 = SubTup2<[1, 2, 3, 4]>; diff --git a/testdata/tests/cases/compiler/inferRestTupleShortSource.ts b/testdata/tests/cases/compiler/inferRestTupleShortSource.ts new file mode 100644 index 000000000..9b3811884 --- /dev/null +++ b/testdata/tests/cases/compiler/inferRestTupleShortSource.ts @@ -0,0 +1,9 @@ +// @strict: true + +// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint + +function f(args: [...string[], ...T]) { + // ... +} + +f([]) diff --git a/testdata/tests/cases/compiler/jsDocAugmentsEmptyExtends.ts b/testdata/tests/cases/compiler/jsDocAugmentsEmptyExtends.ts new file mode 100644 index 000000000..bc909354d --- /dev/null +++ b/testdata/tests/cases/compiler/jsDocAugmentsEmptyExtends.ts @@ -0,0 +1,11 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @filename: file.js + +/** @augments X */ +class C extends {} + +/** @extends X */ +class D extends {} diff --git a/testdata/tests/cases/compiler/jsDocTypedefWithThisTag.ts b/testdata/tests/cases/compiler/jsDocTypedefWithThisTag.ts new file mode 100644 index 000000000..a188ba3ba --- /dev/null +++ b/testdata/tests/cases/compiler/jsDocTypedefWithThisTag.ts @@ -0,0 +1,7 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @filename: bug.js +/** @typedef T @this {object} */ +const x = 1; diff --git a/testdata/tests/cases/compiler/jsdocCallbackParamQualifiedName.ts b/testdata/tests/cases/compiler/jsdocCallbackParamQualifiedName.ts new file mode 100644 index 000000000..98f5575ff --- /dev/null +++ b/testdata/tests/cases/compiler/jsdocCallbackParamQualifiedName.ts @@ -0,0 +1,29 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @filename: bug.js +/** + * @callback cb + * @param x.y + */ + +/** + * @callback cb2 + * @param {object} x + * @param {string} x.y + */ + +/** + * @overload + * @param {object} x + * @param {string} x.y + * @returns {string} + */ +/** + * @param {object} x + * @returns {string} + */ +function foo(x) { + return x.y; +} diff --git a/testdata/tests/cases/compiler/jsdocThisTagWithThisParameter.ts b/testdata/tests/cases/compiler/jsdocThisTagWithThisParameter.ts new file mode 100644 index 000000000..80f9dbd0b --- /dev/null +++ b/testdata/tests/cases/compiler/jsdocThisTagWithThisParameter.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @filename: bug.js + +/** @this {object} */ +function f(this) {} diff --git a/testdata/tests/cases/compiler/jsxAttributeValueBinaryExpression.tsx b/testdata/tests/cases/compiler/jsxAttributeValueBinaryExpression.tsx new file mode 100644 index 000000000..2ca93eee6 --- /dev/null +++ b/testdata/tests/cases/compiler/jsxAttributeValueBinaryExpression.tsx @@ -0,0 +1,4 @@ +// @jsx: preserve +// @noTypesAndSymbols: true + + /> diff --git a/testdata/tests/cases/compiler/jsxElementTypeUnexpectedType.tsx b/testdata/tests/cases/compiler/jsxElementTypeUnexpectedType.tsx new file mode 100644 index 000000000..c0bfc8a3b --- /dev/null +++ b/testdata/tests/cases/compiler/jsxElementTypeUnexpectedType.tsx @@ -0,0 +1,9 @@ +// @jsx: react + +declare namespace JSX { + enum ElementType {} +} + +declare const C: () => any; + +const x = ; diff --git a/testdata/tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx b/testdata/tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx new file mode 100644 index 000000000..79db45435 --- /dev/null +++ b/testdata/tests/cases/compiler/jsxEntityDecoderAfterNonEntityAmpersand.tsx @@ -0,0 +1,8 @@ +// @jsx: react +// @target: esnext + +const a =
&&
; +const b =
a&b&c&d<e
; +const c =
&&
; +const d =
&&&
; +const e =
a&b&c&
; diff --git a/testdata/tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx b/testdata/tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx new file mode 100644 index 000000000..0e4301d40 --- /dev/null +++ b/testdata/tests/cases/compiler/jsxLibraryManagedAttributesUnexpectedType.tsx @@ -0,0 +1,9 @@ +// @jsx: react + +declare namespace JSX { + enum LibraryManagedAttributes {} +} + +declare const C: () => any; + +const x = ; diff --git a/testdata/tests/cases/compiler/jsxSpreadWithAssertion.tsx b/testdata/tests/cases/compiler/jsxSpreadWithAssertion.tsx new file mode 100644 index 000000000..590fd9f01 --- /dev/null +++ b/testdata/tests/cases/compiler/jsxSpreadWithAssertion.tsx @@ -0,0 +1,15 @@ +// @strict: false +// @jsx: react-jsx +// @target: esnext + +declare const EntryTextDialog: any; + +const c = diff --git a/testdata/tests/cases/compiler/numericExportNameDeclaration.ts b/testdata/tests/cases/compiler/numericExportNameDeclaration.ts new file mode 100644 index 000000000..8255adf5d --- /dev/null +++ b/testdata/tests/cases/compiler/numericExportNameDeclaration.ts @@ -0,0 +1,8 @@ +// @declaration: true +// @emitDeclarationOnly: true +// @allowJs: true + +// @filename: bug.js +exports[1] = 2; +module.exports[1] = 2; +Object.defineProperty(exports, 1, {}); diff --git a/testdata/tests/cases/compiler/objectNameCollisionCommonJS.ts b/testdata/tests/cases/compiler/objectNameCollisionCommonJS.ts new file mode 100644 index 000000000..9bd8ce2e8 --- /dev/null +++ b/testdata/tests/cases/compiler/objectNameCollisionCommonJS.ts @@ -0,0 +1,4 @@ +// @module: commonjs,esnext + +let Object = 0; +export const x = 1; diff --git a/testdata/tests/cases/compiler/templateLiteralTypeTooComplex.ts b/testdata/tests/cases/compiler/templateLiteralTypeTooComplex.ts new file mode 100644 index 000000000..e1569f9d4 --- /dev/null +++ b/testdata/tests/cases/compiler/templateLiteralTypeTooComplex.ts @@ -0,0 +1,5 @@ +// @strict: true + +// Large template literal types with combinatorial explosion should produce an error, not hang. +type N = 0 | 1 | 2 | 3; +type T = `${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}${N}`; diff --git a/testdata/tests/cases/compiler/tsconfigMalformedNonObject.ts b/testdata/tests/cases/compiler/tsconfigMalformedNonObject.ts new file mode 100644 index 000000000..9f90fa0f1 --- /dev/null +++ b/testdata/tests/cases/compiler/tsconfigMalformedNonObject.ts @@ -0,0 +1,4 @@ +// @filename: tsconfig.json +[{"compilerOptions": {"types": ["nonexistent"]}}] +// @filename: index.ts +export const x = 1; diff --git a/testdata/tests/cases/compiler/typeOnlyExportAsIfBody.ts b/testdata/tests/cases/compiler/typeOnlyExportAsIfBody.ts new file mode 100644 index 000000000..5c025ff04 --- /dev/null +++ b/testdata/tests/cases/compiler/typeOnlyExportAsIfBody.ts @@ -0,0 +1,4 @@ +// @module: esnext +// @moduleResolution: bundler + +if (true) export type {}; diff --git a/testdata/tests/cases/compiler/typeRootsRelativePath.ts b/testdata/tests/cases/compiler/typeRootsRelativePath.ts new file mode 100644 index 000000000..a23c34c3f --- /dev/null +++ b/testdata/tests/cases/compiler/typeRootsRelativePath.ts @@ -0,0 +1,5 @@ +// @typeRoots: t +// @types: n +// @noEmit: true + +let x = 1; diff --git a/testdata/tests/cases/compiler/typeofSwitchEmptyStringCase.ts b/testdata/tests/cases/compiler/typeofSwitchEmptyStringCase.ts new file mode 100644 index 000000000..5c86c47ce --- /dev/null +++ b/testdata/tests/cases/compiler/typeofSwitchEmptyStringCase.ts @@ -0,0 +1,12 @@ +// @noEmit: true + +// https://github.com/microsoft/typescript-go/issues/3909 + +function f(x: string | number) { + switch (typeof x) { + case "": + case "string": + x.charAt(0); + break; + } +}