Commit Graph
1431 Commits
Author SHA1 Message Date
Ron BucktonandGitHub 3f248ecfe1 Merge pull request #19452 from Microsoft/compareStrings
Clean up outdated string comparison logic
2017-11-06 18:48:15 -08:00
AndyandGitHub 0a7b7e07ee Apply 'variable-name' tslint rule (#19743) 2017-11-06 09:23:47 -08:00
Ron Buckton 31c3d444f1 Merge branch 'master' into compareStrings 2017-11-03 23:01:51 -07:00
AndyandGitHub cc2a2a79b5 Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors (#17831)
* Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors

* Set context flags on tokens

* Remove 'isDeclarationFile' parameter to 'initializeState' and move to 'parseSourceFileWorker'

* Changes based on code review

* Update API baselines
2017-11-03 08:08:48 -07:00
uniqueiniquity 3ebb2e8a34 Merge branch 'master' into jsxFragment 2017-10-31 10:53:57 -07:00
Ron Buckton c0ed26e605 Simplify comparers 2017-10-25 17:46:39 -07:00
Ron Buckton 130c407708 More control over which collator to use in each situation 2017-10-25 16:30:19 -07:00
Ron Buckton dee77ced7c Added 'equateStrings' for string equality comparisons (rather than sorting) 2017-10-24 16:14:49 -07:00
uniqueiniquity fb058868de Respond to CR 2017-10-24 13:24:11 -07:00
AndyandGitHub 159a0a2197 Use NodeFlags to detect nodes inside with statements instead of climbing ancestors (#17721)
* Use NodeFlags to detect nodes inside with statements instead of climbing ancestors

* Add to ContextFlags
2017-10-23 13:38:50 -07:00
uniqueiniquity 75665294a9 Respond to CR 2017-10-17 13:39:16 -07:00
uniqueiniquity abb3f58db2 Add support for JSX fragment syntax 2017-10-17 09:38:09 -07:00
Arthur OzgaandGitHub 1db762356e Merge pull request #18706 from aozgaa/dev/aozgaa/JsDocExtendsSupport
support @extends in jsdoc
2017-10-09 15:08:58 -07:00
AndyandGitHub 8a55baf9a3 In @typedef tag, handle property with no type (#19013) 2017-10-09 09:58:02 -07:00
Arthur Ozga 5ea3ca4ef9 Merge branch 'master' into dev/aozgaa/JsDocExtendsSupport 2017-10-06 14:25:31 -07:00
AndyandGitHub 46e135b098 Fix parsing of qualified name in @augments (#18914) 2017-10-03 13:47:01 -07:00
Nathan Shively-SandersandGitHub 4d8663c378 Merge pull request #18117 from Microsoft/jsdoc-dotdotdot-binds-tighter-than-postfix
Jsdoc ... binds tighter than postfix ?!
2017-10-03 08:45:26 -07:00
AndyandGitHub 3a2c723a69 Allow parsing a qualified type name containing a reserved word (#18888) 2017-10-02 17:04:28 -07:00
AndyandGitHub 1a2de721b5 Fixes to @augments handling (#18775)
* Fixes to @augments handling

* Renames and diagnostic changes

* Add test for < > characters

* Use more specific return type
2017-09-28 12:34:54 -07:00
AndyandGitHub 024b1fd913 Make it a parse error for an @augments jsdoc tag to not include a type (#18745) 2017-09-25 09:26:59 -07:00
Arthur Ozga b21c46b9b5 support @extends in jsdoc 2017-09-22 16:21:31 -07:00
AndyandGitHub 2399bac377 Make it a parse error for an @type jsdoc tag to not include a type (#18664)
* Make it a parse error for an `@type` jsdoc tag to not include a type

* Rename parameter
2017-09-22 10:45:43 -07:00
AndyandGitHub 1a383ec290 Remove unnecessary "@internal" (#18665) 2017-09-22 07:09:29 -07:00
AndyandGitHub 30839378ac Remove unnecessary 'tryParse' (#18663) 2017-09-21 14:42:13 -07:00
Armando AguirreandGitHub 1989b70374 Merge pull request #18192 from armanio123/FixExpressionExpectedAtEOF
Added logic to check for EOF when creating a missing node.
2017-09-19 10:13:20 -07:00
Nathan Shively-SandersandGitHub b934c8bcbd Merge pull request #18417 from Microsoft/fail-spec-lambda-parsing-on-parameter-initialiser-missing-=
Fail speculative parsing of arrow functions when their parameter initialisers are missing a =
2017-09-14 13:01:51 -07:00
AndyandGitHub e91af7d30d Allow template string with no substitutions to be used as a string literal type (#18452) 2017-09-14 11:19:54 -07:00
Nathan Shively-Sanders 5d51a42030 Use createMissingNode for sentinel node 2017-09-13 10:26:11 -07:00
Nathan Shively-Sanders d8ace9ddfb Don't parse param init when = is required but missing
Makes another test case pass that was taking exponential time to parse,
because now it notices that the = is not present and doesn't even try to
parse the initialiser expression.
2017-09-12 14:41:51 -07:00
Nathan Shively-Sanders 4c4316da72 Fail spec parsing lambdas on parameter missing a =
Fail speculative parsing of arrow function expressions whenever it has a
parameter with an initialiser that is missing '='. Ordinarily this is
allowed for better error recovery in the language service, but for
speculative parsing, the errors can compound. When the initialiser is an
error, and when the '=>' is missing (which is also allowed), what is
putatively an arrow function may actually be something else.

For example, `(a / 8) + function ()
{ }` is currently parsed as if someone had intended to write

`(a = /8)+function()/) => { }` but they forgot the `=` of the
initialiser, the `=>` of the lambda, forgot to close the regular
expression, and mistakenly inserted a newline right after the regular
expression.
2017-09-12 14:01:49 -07:00
Nathan Shively-SandersandGitHub d4e3e19763 Merge pull request #18333 from Microsoft/fix-forEachChild-JSDocTypedefTag
Fix forEachChild jsdoc `@typedef` tag
2017-09-08 08:52:46 -07:00
Nathan Shively-Sanders 34a8c8423e Merge branch 'master' into jsdoc-dotdotdot-binds-tighter-than-postfix 2017-09-08 08:37:38 -07:00
Nathan Shively-Sanders cab05ddd3f Inline variable to aid control flow 2017-09-08 08:33:17 -07:00
Nathan Shively-Sanders fb5e8c6110 Fix forEachChild's visit of JSDocTypedefTag
Also remove JSDocTypeLiteral.jsdocTypeTag, which made no sense since it
was only useful when storing information for its parent `@typedef` tag.
2017-09-07 16:37:13 -07:00
Anders HejlsbergandGitHub 8c64937888 Merge pull request #18153 from Microsoft/optimizeArrays
Optimize array operations to reduce memory footprint
2017-09-07 22:26:48 +01:00
Nathan Shively-SandersandGitHub 2bc9ecb4fd Merge pull request #18296 from Microsoft/disable-lookahead-isStartOfParameter
Disable isStartOfType's lookahead when called from isStartOfParameter
2017-09-07 13:57:28 -07:00
Nathan Shively-Sanders c81a941303 Refactor parsePostfixTypeOrHigher
Inline the switch, but extract the function that creates jsdoc nodes.
2017-09-07 13:45:59 -07:00
Wesley WighamandGitHub c1f2afd645 Add typedef declaration space, unify typedef name gathering (#18172)
* Add typedef declaration space, unify typedef name gathering, strengthen errorUnusedLocal

* Bonus round: make jsdoc presence way mroe typesafe

* Be exhaustive in nameForNamelessJSDocTypedef

* Remove nonrequired casts

* Replace more casts with guards

* Cannot be internal

* Debug.fail returns never, assert never no longer needs unreachable throw to satisfy checker

* Rename type

* Add replacement message as in 18287
2017-09-07 10:28:58 -07:00
Nathan Shively-Sanders 90d9f3d4ba Rename isStartOfType parameter used by isStartOfParameter 2017-09-07 09:07:59 -07:00
Nathan Shively-Sanders a5c2eac2ee Test:disable lookahead in isStartOfParameter 2017-09-06 15:54:14 -07:00
Nathan Shively-Sanders 7c69dd84b9 Disable lookahead in isStartOfParameter/isStartOfType 2017-09-06 13:11:35 -07:00
Nathan Shively-SandersandGitHub 541920eb31 Merge pull request #18014 from Microsoft/allow-bang+dotdotdot-as-start-of-type
Allow bang+dotdotdot as start of type
2017-09-01 14:26:16 -07:00
AndyandGitHub 7a4c3da239 Simplify return type parsing (#18206)
* Simplify return type parsing

* Make control flow clearer
2017-09-01 10:58:49 -07:00
Nathan Shively-Sanders 68ea88402a Make getPostfixSyntaxKind easier to read 2017-09-01 10:52:48 -07:00
Armando Aguirre c2168cb94a Added logic to check for EOF when creating a missing node. 2017-08-31 14:05:41 -07:00
Anders Hejlsberg 3f090114ff Optimize array operations to reduce memory footprint 2017-08-30 09:44:51 -07:00
Nathan Shively-Sanders ffe49428d8 Parse postfix [] ! ? at the same precedence level
This combines parseArrayType and parseJSDocPostfixType into
parsePostfixType.
2017-08-30 08:39:28 -07:00
Nathan Shively-Sanders c746477d81 JSDoc:... binds tighter than *n* postfix jsdocs
1. Previously ...X? mistakenly parsed as ...(X?) instead of (...X)?
2. Previously X?!?!? mistakenly failed to parse the postfix tokens
   ? ! ? ! ? at the same level of precedence.

The fix is to
1. Make ... parsing call parseNonArrayType instead of parseType.
2. Make postfix jsdoc parsing parse in a loop instead of only parsing
one token.
2017-08-29 12:59:34 -07:00
Nathan Shively-Sanders 377ac06050 Allow ! and ... as start-of-type tokens
Which allows the rest of the jsdoc types to be used in type argument
lists
2017-08-24 08:56:36 -07:00
Nathan Shively-Sanders 71c5b1b354 Parsing:Allow QuestionToken as start of type 2017-08-23 15:00:12 -07:00