Commit Graph

1529 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
37076b3536 Half of parsing (builds but does not pass tests) 2018-05-01 10:30:21 -07:00
Daniel Rosenwasser
bc0d3e1297 Look for top-level imports/exports before diving into the tree. 2018-04-27 17:25:23 -07:00
Daniel Rosenwasser
9672116d8c Merge remote-tracking branch 'origin/master' into importDotMeta 2018-04-25 22:21:56 -07:00
Andy
583bcea603 Always parse an argument for an ElementAccessExpression (#23683) 2018-04-25 10:08:35 -07:00
Daniel Rosenwasser
4bfb1a3aa1 Avoid breaking change by introducing overloads for 'createTaggedTemplate'/'updateTaggedTemplate'. 2018-04-17 14:09:42 -07:00
Daniel Rosenwasser
eb8eeafc22 Allow parsing tagged templates with type arguments in new expressions. 2018-04-15 16:04:25 -07:00
Daniel Rosenwasser
da7967a3cf Added basic support for parsing/emitting type arguments in tagged template expressions. 2018-04-13 23:45:16 -07:00
Ryan Cavanaugh
df95de3231 Merge branch 'master' into referencesDogfood_1 2018-04-11 16:17:38 -07:00
Ryan Cavanaugh
8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Wesley Wigham
8a2b4646f0 Include guards on comment kind in pragma extraction (#23313) 2018-04-10 20:50:31 -07:00
Daniel Rosenwasser
7c0f249619 Added semicolon. 2018-04-10 16:10:04 -07:00
Daniel Rosenwasser
9e2bbb6f8a Basic parsing/emitting support for 'import.meta'. 2018-04-10 12:55:43 -07:00
Andy
71b39014eb Fix bug: Include comment for @param tag with nested tag (#23276)
* Fix bug: Include comment for @param tag with nested tag

* Add another comment to test
2018-04-09 14:09:59 -07:00
Wesley Wigham
c676893dc9 SyntaxKind.ImportTypeNode -> SyntaxKind.ImportType (#23120) 2018-04-03 13:32:03 -07:00
Wesley Wigham
414bc49cc4 Module or import types (#22592)
* Type side of import types

* Value side of import types

* Accept library changes

* Refined implementation, more tests

* Allow resolutions to be performed late if the resolution still results in a file already in the build

* Add another test case

* Add some jsdoc usages

* Allow nodebuilder to use import types where appropriate

* Parse & check generic instantiations

* use import types in nodebuilder for typeof module symbols

* Wire up go to definition for import types

* Accept updated type/symbol baselines now that symbols are wired in

* PR feedback

* Fix changes from merge

* Walk back late import handling

* Remove unused diagnostic

* Remove unrelated changes

* Use recursive function over loop

* Emit type arguments

* undo unrelated change

* Test for and support import type nodes in bundled declaration emit
2018-04-02 10:18:23 -07:00
Nathan Shively-Sanders
eca3d68eb4 @typedef supports nested @property names (#22967)
Previously it did not, because this capability is not documented on
usejsdoc.org. However, several people requested this feature.
2018-03-29 09:39:23 -07:00
Sheetal Nandi
33e9ef60c4 Correct the incremental parsing when there is jsDoc node
Fixes #22924
2018-03-28 14:32:46 -07:00
Wenlu Wang
cb9f436b54 fix accessor parse with line terminator (#22893) 2018-03-28 10:59:09 -07:00
Andy
6118f211d1 Add 'isParameterPropertyModifier' helper (#22841) 2018-03-27 19:36:42 -07:00
Andy
07a890dbbb Reuse getBinaryOperatorPrecedence (#22844)
* Reuse getBinaryOperatorPrecedence

* Code review

* Consistently sort cases in ascending order
2018-03-27 16:38:39 -07:00
Andy
0e9364f48e Simplify functions for adding parse errors (#22513)
* Simplify functions for adding parse errors

* Prefer parseErrorAt over parseErrorAtRange
2018-03-23 08:34:04 -07:00
Wesley Wigham
a909000b62 Parse and check type arguments on JSX opening and self-closing tags (#22415)
* Parse and check type arguments on JSX opening like elements

* Fix nits
2018-03-22 15:07:36 -07:00
Andy
6d82a20109 Combine getLastChild helpers (#22418) 2018-03-22 09:32:05 -07:00
Nathan Shively-Sanders
ab8233c5d3 Two JSdoc parsing fixes (#22705)
* Correctly parse JSDoc type *=

* Allow `markdown` quoted param names in JSDoc

* Add tests and update baselines

* Get correct span for the type '*'

* Fix whitespace lint

* Add unbracketed type test
2018-03-20 09:23:08 -07:00
Nathan Shively-Sanders
bb23e9601f Parse JSDoc ...T and T= only at top-level JSDoc (#22661)
* Parse JSDoc ...T and T= only at top-level JSDoc

...T and T= should only be legal at the top level of a type, and only in
JSDoc, since at least T= is ambiguous elsewhere. This PR changes parsing
to make that happen. The resulting parse tree is now simpler, allowing
me to get rid of some code I had to add in the checker.

* Extract JSDoc type parsing into its own function

* PR comments:return from parseJSDocType
2018-03-16 16:08:42 -07:00
Wesley Wigham
19ec83fcdf Refactor declaration emitter into declaration transformer (#21930)
* Refactor declaration emitter into declaration transformer

* Slight cleanup from code review feedback

* Incorporate fix for new test

* Swaths of PR feedback

* Merge public methods

* Per-file output

* Preserve input import ordering more often

* Unify jsdoc comment start detection under more lenient rule

* Move to per-file transformations to reduce the memory that msut be retained

* Fix typo
2018-03-15 22:23:10 -07:00
Andy
0c6ef348ce Simplify parseJsxChildren (#22511) 2018-03-13 12:28:21 -07:00
Josh Goldberg
7826b38426 Apply 'no-unnecessary-initializer' lint rule (#22014)
* Apply 'no-unnecessary-initializer' lint rule

Forbids `let`/`const` statements to be initialized to `undefined`, since that's the initial value by default anyway.
The auto-fixer also happened to remove two unnecessary `as number` casts in `src/harness/parallel/worker.ts`.

For historical data: to run with `--fix`, I modified the line in `Jakefile.js` that declared the `cmd` for running TSLint.

* Moved worker.ts type assertions to parameters
2018-03-06 07:30:40 -08:00
Andy
4ddf045d6a For <div a= >, after =, do not try to parse an expression (#21373) 2018-03-05 14:38:55 -08:00
Benjamin Lichtman
dfa1a90b25 Merge pull request #22135 from uniqueiniquity/jsxFragmentHash
Allow characters in JsxText inside JsxFragment that usually don't scan
2018-03-01 16:50:09 -08:00
Andy
a564912d9a Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
Wesley Wigham
32c63a2628 Add support for transpiling per-file jsx pragmas (#21218)
* Add support for per-file jsx pragmas

* Add error for using jsx factory pragma with fragments

* More tests, use different regex class for pragma capture

* Unify all pragma parsing machinery
2018-02-26 16:10:00 -08:00
uniqueiniquity
71ff6dd91e Allow characters in JsxText inside JsxFragment that would not normally scan 2018-02-22 15:56:34 -08:00
Andy
b3edc8f9f4 Apply 'no-unnecessary-type-assertion' lint rule (#22005)
* Apply 'no-unnecessary-type-assertion' lint rule

* Fix type error

* Fix tsconfig.json

* Add --format back
2018-02-16 18:38:00 -08:00
Anders Hejlsberg
a629acd8fd Allow +/- to prefix 'readonly' and '?' modifiers in mapped types 2018-02-12 16:20:49 -08:00
Anders Hejlsberg
0d3f2166e3 Automatic semicolon insertion before 'extends' in conditional type 2018-02-05 13:56:10 -08:00
Anders Hejlsberg
7c241ba2f7 Merge branch 'conditionalTypes' into inferTypes
# Conflicts:
#	src/compiler/checker.ts
#	tests/cases/fourslash/completionInJSDocFunctionNew.ts
#	tests/cases/fourslash/completionInJSDocFunctionThis.ts
2018-01-30 13:40:16 -08:00
Anders Hejlsberg
4f2b5f32f9 Merge branch 'master' into conditionalTypes 2018-01-30 06:42:14 -08:00
Anders Hejlsberg
ef0c3b7667 Change precedence of 'infer T' to match 'keyof T' 2018-01-25 12:43:07 -08:00
Anders Hejlsberg
d608941480 Implement type inference in conditional types 2018-01-25 12:25:00 -08:00
Anders Hejlsberg
0e73240ea4 Disallow conditional type following 'extends' 2018-01-19 14:44:48 -08:00
Anders Hejlsberg
c360c24b9b Fix parsing 2018-01-19 13:01:27 -08:00
Andy
9436b1cc0b Fix formatter crash for const { ...a: b } = {};: forEachChild and emitBindingElement should handle ... before the propertyName (#21268) 2018-01-18 10:36:41 -08:00
Andy
466557cafb Support parsing @template {T} in addition to @template T (#21270) 2018-01-18 09:45:29 -08:00
Anders Hejlsberg
4ec6fdd96f Merge branch 'master' into conditionalTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/types.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
2018-01-17 13:12:36 -08:00
Anders Hejlsberg
5094f7677c Remove 'T extends U' type constructor 2018-01-15 08:11:05 -08:00
Anders Hejlsberg
53b1572ed6 Revert to extends check being part of conditional type 2018-01-15 07:59:46 -08:00
Andy
a77c6014b3 Parse comment on @property tag and use as documentation comment (#21119)
* Parse comment on @property tag and use as documentation comment

* Fix comment parsing bug -- back up after seeing `@` character

* Add test for indent

* Don't default comment to ""
2018-01-11 10:49:39 -08:00
Andy
7a1deae6aa AsteriskToken should always have length 1 (#21126) 2018-01-10 12:52:35 -08:00
Andy
102368332e Use 'append' helper more (#21125) 2018-01-10 11:31:13 -08:00