TypeScript/tests/cases/conformance/jsdoc
Nathan Shively-Sanders 6ca9d04b60
Constructor functions as classes (#32944)
* Initial implementation

The original test passes but I haven't run any other tests yet, so I
assume the world is now broken.

* Append constructor function construct sigs

Instead of overwriting them

* Grab bag of improvements.

1. Mark @class-tagged functions with Class too.
2. Only gather local type parameters of constructor functions.
3. Remove getJSClassType calls with getDeclaredTypeOfSymbol.
4. Add a couple more failing tests.

getDeclaredTypeOfClassOrInterface now needs to understand prototype
assignment. That's next, I think.

* Prototype assignments work now

1. Binder marks prototype assignments as Class now.
2. Checker merges prototype assignments using the same merge code as for
functions and their declarations. No more intersections.

Many fewer failing tests now.

* Mark prototype-property assignments as Class

Even if there are no this-property assignments in them. (Then why are
you using a class?).

* Simplify getJSClassType, remove calls to its guts

It's probably not needed because now it's just a conditional call to
getDeclaredTypeOfSymbol, and I think most callers already know whether
they have a JS constructor function beforehand.

* isJSDocConstructor doesn't need to check prototype anymore

Because all the properties are merged during getDeclaredTypeOfSymbol.

* outer type parameter lookup follow prototype assignment

* this-type and -expression support in ctor funcs

Pretty cool!

* Fix remaining tests

* Fix minor lint

* Delete now-unused code

* Add class flag to nested class declarations

Also remove old TODOs
2019-08-19 14:12:53 -07:00
..
callbackCrossModule.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag1.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag2.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTag3.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
callbackTagNamespace.ts Disallow nested object param syntax in callback tag (#24392) 2018-05-24 15:11:33 -07:00
checkExportsObjectAssignProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkExportsObjectAssignPrototypeProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkJsdocOnEndOfFile.ts Check EOF token to get errors for JSDoc (#28000) 2018-10-19 16:23:34 -07:00
checkJsdocParamOnVariableDeclaredFunctionExpression.ts More tests for getParameterSymbolFromJSDoc 2017-10-19 16:22:05 -07:00
checkJsdocParamTag1.ts
checkJsdocReturnTag1.ts
checkJsdocReturnTag2.ts
checkJsdocTypedefInParamTag1.ts
checkJsdocTypeTag1.ts Test JSDoc parsing using TS parser 2017-07-13 11:33:12 -07:00
checkJsdocTypeTag2.ts
checkJsdocTypeTag3.ts Test:jsdoc nullable syntax legal in type arguments 2017-08-23 15:00:40 -07:00
checkJsdocTypeTag4.ts Js/check type tags (#24967) 2018-06-14 13:11:52 -07:00
checkJsdocTypeTag5.ts Get return type from @type tag (#25580) 2018-07-12 10:49:41 -07:00
checkJsdocTypeTag6.ts Stricter test that JSDoc @type tag matches function signature (#25615) 2018-07-12 14:02:02 -07:00
checkJsdocTypeTagOnObjectProperty1.ts Add tests and update baselines 2017-06-13 15:24:05 -07:00
checkJsdocTypeTagOnObjectProperty2.ts Add tests and update baselines 2017-06-13 15:24:05 -07:00
checkObjectDefineProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
checkOtherObjectAssignProperty.ts Add new special assignment kinds for recognizing Object.defineProperty calls (#27208) 2018-10-19 14:31:55 -07:00
constructorTagOnClassConstructor.ts Only functions can be constructor functions (#27369) 2018-10-08 10:14:31 -07:00
constructorTagOnObjectLiteralMethod.ts Add getEffectiveConstructSignatures (#27561) 2018-10-15 12:47:57 -07:00
enumTag.ts Use nextToken() after parsing a tag name so we can parse type keywords (#26915) 2018-09-13 15:49:06 -07:00
enumTagCircularReference.ts Fix enum tag circular references (#27161) 2018-09-17 16:06:17 -07:00
enumTagImported.ts In JSDoc, resolve import types as values too (#26066) 2018-07-31 11:07:06 -07:00
enumTagUseBeforeDefCrash.ts Fix crash in use-before-def checking of enum tag (#27350) (#27354) 2018-09-26 09:05:18 -07:00
extendsTag1.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
extendsTagEmit.ts Always check extends clause of classes 2019-04-05 16:37:27 -07:00
jsdocAugments_errorInExtendsExpression.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_nameMismatch.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_noExtends.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_notAClass.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_qualifiedName.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugments_withTypeParameter.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocAugmentsMissingType.ts In JS, always check the extends tag of a class before its heritage clause (#25111) 2018-06-20 16:28:30 -07:00
jsdocBindingInUnreachableCode.ts Fix parent points in unreachable code (#27400) (#27406) 2018-09-28 08:31:56 -07:00
jsdocDisallowedInTypescript.ts Parse JSDoc ...T and T= only at top-level JSDoc (#22661) 2018-03-16 16:08:42 -07:00
jsdocFunctionType.ts Fixes #26128 - signature comp for jsdoc @class. (#26160) 2018-08-14 13:35:51 -07:00
jsdocImportType.ts module.exports = Entity is an alias, just like export = Entity (#23570) 2018-04-23 15:24:31 -07:00
jsdocImportType2.ts module.exports = Entity is an alias, just like export = Entity (#23570) 2018-04-23 15:24:31 -07:00
jsdocIndexSignature.ts Add a better test for jsdoc index signatures. 2017-10-18 13:06:15 -07:00
jsdocLiteral.ts
jsdocNeverUndefinedNull.ts
jsdocParamTag2.ts JSDoc:positional matching of destructured params (#23307) 2018-04-10 12:48:35 -07:00
jsdocParamTagTypeLiteral.ts checkJs: require JSDoc type argument for Array, Object, and Promise in noImplicitAny (#32829) 2019-08-16 12:41:09 -07:00
jsdocParseBackquotedParamName.ts Two JSdoc parsing fixes (#22705) 2018-03-20 09:23:08 -07:00
jsdocParseDotDotDotInJSDocFunction.ts Improve behaviour of ... inside JSDoc functions (#22809) 2018-03-22 16:17:16 -07:00
jsdocParseErrorsInTypescript.ts Update baselines 2017-07-14 09:34:35 -07:00
jsdocParseHigherOrderFunction.ts Fix parsing of parenthesized JSDoc parameters (#25799) 2018-07-19 12:50:36 -07:00
jsdocParseMatchingBackticks.ts JSDoc:Treat tokens between backticks as comments 2019-06-26 16:04:46 -07:00
jsdocParseParenthesizedJSDocParameter.ts Fix parsing of parenthesized JSDoc parameters (#25799) 2018-07-19 12:50:36 -07:00
jsdocParseStarEquals.ts Two JSdoc parsing fixes (#22705) 2018-03-20 09:23:08 -07:00
jsdocPostfixEqualsAddsOptionality.ts JSDoc ?Type adds optionality to parameters (#22646) 2018-03-16 13:28:24 -07:00
jsdocPrefixPostfixParsing.ts Parse JSDoc ...T and T= only at top-level JSDoc (#22661) 2018-03-16 16:08:42 -07:00
jsdocPrototypePropertyAccessWithType.ts Don't crash on property access with type (#25170) 2018-06-25 11:25:52 -07:00
jsdocReturnTag1.ts
jsdocTemplateClass.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateConstructorFunction.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateConstructorFunction2.ts Constructor functions as classes (#32944) 2019-08-19 14:12:53 -07:00
jsdocTemplateTag.ts Prototype-property assignment:fix name resolution crash (#23680) 2018-04-25 13:59:40 -07:00
jsdocTemplateTag2.ts Add callback tag, with type parameters (#23947) 2018-05-17 09:28:11 -07:00
jsdocTemplateTag3.ts Template tag allows specification of constraints (#24600) 2018-06-04 11:42:46 -07:00
jsdocTemplateTag4.ts Fixes for type parameter name resolution in JS (#26830) 2018-09-04 14:47:18 -07:00
jsdocTemplateTag5.ts Fixes for type parameter name resolution in JS (#26830) 2018-09-04 14:47:18 -07:00
jsdocTwoLineTypedef.ts Test: parsing of two-line @typedef jsdoc 2017-09-07 16:22:16 -07:00
jsdocTypeDefAtStartOfFile.ts
jsdocTypeFromChainedAssignment.ts Improve binding and jsdoc of chained special js assignments (#23038) 2018-04-02 09:47:01 -07:00
jsdocTypeFromChainedAssignment2.ts No error for require, module.exports or exports in Javascript (#23743) 2018-04-30 15:47:59 -07:00
jsdocTypeFromChainedAssignment3.ts Fix factorial jsdoc search:chained assignments (#23115) 2018-04-04 08:57:13 -07:00
jsdocTypeReferenceExports.ts Fix name resolution of exports in JS (#27394) 2018-10-08 13:01:14 -07:00
jsdocTypeReferenceUseBeforeDef.ts Fix bogus use before def in jsdoc (#25532) 2018-07-10 08:33:19 -07:00
jsdocTypeTag.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
jsdocTypeTagCast.ts Use jsdoc casts (#17251) 2017-07-17 23:39:20 -07:00
jsdocTypeTagParameterType.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
jsdocTypeTagRequiredParameters.ts Fix type when annotated with a JSDoc function type (#22692) 2018-03-19 16:00:45 -07:00
noAssertForUnparseableTypedefs.ts No assert for nameless typedefs (#26695) 2018-08-27 14:12:14 -07:00
noDuplicateJsdoc1.ts No dupe jsdoc for assignment inside an initializer (#24973) 2018-06-14 15:32:10 -07:00
paramTagBracketsAddOptionalUndefined.ts Brackets and postfix= in @param add undefined (#22514) 2018-03-13 15:56:38 -07:00
paramTagNestedWithoutTopLevelObject.ts Minor refactor in paramTagNestedWithoutTopLevelObject.ts 2019-01-10 14:05:10 -08:00
paramTagNestedWithoutTopLevelObject2.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagNestedWithoutTopLevelObject3.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagNestedWithoutTopLevelObject4.ts Add more tests for qualified name param without top level object error 2019-01-10 15:04:16 -08:00
paramTagOnCallExpression.ts No error on unmatchable @param tags (#22510) 2018-03-14 10:17:54 -07:00
paramTagOnFunctionUsingArguments.ts No error on unmatchable @param tags (#22510) 2018-03-14 10:17:54 -07:00
paramTagTypeResolution.ts Fix jsdoc type resolution [merge to master] (#24204) 2018-05-17 10:46:10 -07:00
paramTagWrapping.ts Skip whitespace or asterisk in JSDoc param type and name (#26067) 2018-08-16 16:16:09 -07:00
returnTagTypeGuard.ts Allow type predicates in JSDoc (#26343) 2018-08-10 15:31:39 -07:00
syntaxErrors.ts Test:ts-ignore works on jsdoc syntax errors 2017-11-17 10:40:16 -08:00
thisTag1.ts Support @this tags (#24927) 2018-06-13 10:11:12 -07:00
typedefCrossModule.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule2.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule3.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule4.ts Always export typedefs (#23723) 2018-04-30 14:55:26 -07:00
typedefCrossModule5.ts Adds related spans and error grouping for duplicate identifier errors (#25328) 2018-07-02 10:47:52 -07:00
typedefInnerNamepaths.ts Fix crash when binding jsdoc-style inner namepaths (#25106) 2018-06-21 10:01:39 -07:00
typedefMultipleTypeParameters.ts Js/check type tags (#24967) 2018-06-14 13:11:52 -07:00
typedefTagNested.ts Parse nested prop and param tags the same way (#25139) 2018-06-21 16:12:55 -07:00
typedefTagTypeResolution.ts Fix jsdoc type resolution [merge to master] (#24204) 2018-05-17 10:46:10 -07:00
typedefTagWrapping.ts Skip asterisks after newline when parsing JSDoc types (#26528) 2018-09-04 15:41:08 -07:00
typeTagCircularReferenceOnConstructorFunction.ts Report circular JSDoc type references (#27404) 2018-10-08 08:56:29 -07:00
typeTagModuleExports.ts Better checking of assignment declarations (#28387) 2018-11-15 08:46:11 -08:00
typeTagPrototypeAssignment.ts Better checking of assignment declarations (#28387) 2018-11-15 08:46:11 -08:00
typeTagWithGenericSignature.ts Get [type] parameter types from @type tag (#26694) 2018-08-27 16:52:35 -07:00