Commit Graph

19387 Commits

Author SHA1 Message Date
Sheetal Nandi
c739defe25 Handle prologues in prepend outputs 2019-01-25 14:31:40 -08:00
Sheetal Nandi
a90ff10d8a Tests for multiple prologues 2019-01-25 14:31:39 -08:00
Sheetal Nandi
6e5770928f Handle shebang when using prepend nodes 2019-01-25 14:31:39 -08:00
Sheetal Nandi
607891b78e Generate readable source map baselines for -b --out scenario 2019-01-25 14:31:39 -08:00
Sheetal Nandi
edfc91a6a0 Write testcase to baseline with strict, prologues, shebangs 2019-01-25 14:31:38 -08:00
Sheetal Nandi
1b12a855e8 Merge branch 'master' into inputFiles 2019-01-24 15:44:45 -08:00
Wesley Wigham
0ddcab3469 Fix master: handle generating type name for late bound dupe message more nicely (#29572)
* Fix master: handle generating type name for late bound dupe message more nicely

* Make literal type casts more specific in many places to better reflect the checks performed
2019-01-24 15:37:13 -08:00
Sheetal Nandi
ec817f55f3 Fix unnecessary union 2019-01-24 15:27:39 -08:00
Ryan Cavanaugh
c779fc7998 Merge pull request #28034 from disisisid/master
Typo fix in src/lib/README.md
2019-01-24 14:45:31 -08:00
Ryan Cavanaugh
1a742e6f27 Merge pull request #27918 from collin5/b27914
Improve error message for duplicate property with computed name
2019-01-24 14:35:51 -08:00
Sheetal Nandi
399f987918 Add todos for sourcemap that accidently got reverted. 2019-01-24 13:54:45 -08:00
Sheetal Nandi
216ed1b385 Get dts content from sourceFile if present 2019-01-24 13:47:27 -08:00
Ryan Cavanaugh
d85c4e551e Merge pull request #27121 from xl1/26977-typedarray
Allow non-number source for TypedArray.from
2019-01-24 13:42:43 -08:00
Sheetal Nandi
50d98aee0e Create getters for js sourcemap, dts and dts map text getters in prepend nodes 2019-01-24 13:38:25 -08:00
Ryan Cavanaugh
16b6706ee1 Merge pull request #29463 from jack-williams/check-in-expression-with-union
Fix #29457
2019-01-24 13:07:22 -08:00
Sheetal Nandi
9acff37947 Add test to test the readFile called on prepend input file for emitting and verifying emit 2019-01-24 12:17:45 -08:00
Sheetal Nandi
61b95fea5a Merge pull request #29555 from petebacondarwin/external-skip-trivia-fix
Use the correct source when skipping trivia
2019-01-24 12:09:10 -08:00
Anders Hejlsberg
71d70ef161 Merge pull request #29563 from Microsoft/fixSwitchControlFlow
Fix switch statement control flow logic
2019-01-24 10:36:52 -08:00
Anders Hejlsberg
9844436231 Match control flow logic for switch statements to conditional expressions 2019-01-24 09:30:36 -08:00
Pete Bacon Darwin
331b9bcfde Use the correct source when skipping trivia
A custom `SourceMapSource` can optionally provide its own `skipTrivia`
function. If this is not provided then the compiler will use the default
function designed for TypeScript source files.

Previously, when calling this default function we were passing the current
`sourceMapSource` rather than the specified `source` whose trivia needs
to be skipped. This resulted in the `pos` being incorrectly calculated for
external source files that need mapping.

**Side note:**

There are actually two possible constructors available for creating
`SourceMapSource` objects. One of them defaults to an identity function
for the `skipTrivia` function if it is not provided (see
49689894d7/src/compiler/utilities.ts (L6972-L6976))
and the other one leaves the `skipTrivia` field `undefined` (see
5fc8f1dd80/src/services/services.ts (L776-L797))

Unfortunately, it appears that the second of these two constructors is the
one available when importing the "typescript" module in node.js code.
2019-01-24 10:28:10 +00:00
xiaofa
d7601b755f fix trailing comma should not allowed in dynamic import argument 2019-01-24 18:16:34 +08:00
Ryan Cavanaugh
2f6c65e691 Merge pull request #26653 from Kingwl/improve_type_arguments_parser_1
parse less than token rather than left shift in context of type argum…
2019-01-23 16:21:12 -08:00
Sheetal Nandi
73fe3fc0f5 Merge pull request #29532 from Microsoft/umdModuleGlobalMerge
Handle find all references for symbol merged with UMD module and global var
2019-01-23 11:13:58 -08:00
Sheetal Nandi
d42185373a PR feedback 2019-01-23 10:48:17 -08:00
Ron Buckton
60487dc7cb Enable debug info by default when debugging the language server 2019-01-22 15:41:22 -08:00
Ron Buckton
76b78a4df5 Fix crash in signatureHelp 2019-01-22 15:02:30 -08:00
Sheetal Nandi
f0227ecb2c Handle find all references for symbol merged with UMD module and global var
Fixes #29093
2019-01-22 14:52:39 -08:00
kingwl
e8497096d8 Merge branch 'master' into improve_type_arguments_parser_1 2019-01-20 01:54:49 +08:00
Andrew Casey
3a2f6a3ed1 Merge pull request #29470 from amcasey/InterfaceImplementations
Don't treat interfaces as implementations
2019-01-18 16:28:49 -08:00
Pranav Senthilnathan
d38c616e29 Fix resolution of properties from prototype assignment in JS (#29302)
* fix type derived from prototype assignment

* accept new baselines

* remove direct intersection with object literal assigned to prototype

* add tests

* change webpack submodule commit

* fix submodule commits

* comment and simplify getJSDocTypeReference

* remove circularity guards that aren't hit anymore
2019-01-18 16:00:18 -08:00
Wesley Wigham
20285e66e9 Include all flow nodes made within try blocks as antecedents for catch or finally blocks (#29466)
* Include all flow nodes made within `try` blocks as antecedents for `catch` or `finally` blocks

* Fix typo
2019-01-18 14:43:31 -08:00
Andrew Casey
737fda928c Don't treat interfaces as implementations
...even if they're in ambient contexts.  Same for type aliases.
2019-01-17 15:45:01 -08:00
Wesley Wigham
addeff325b Make the relationship between partial mapped types and the empty object not apply for subtype relationship (#29384) 2019-01-17 15:42:58 -08:00
Wesley Wigham
b6ae492009 Add missing arity check on second inference pass (#29386) 2019-01-17 15:21:17 -08:00
Sheetal Nandi
9bd23652ef Merge pull request #29161 from Microsoft/incrementalBuild
Supports incremental build in tsc --b --w mode
2019-01-17 13:44:48 -08:00
Sheetal Nandi
900d6f7c90 renames 2019-01-17 12:29:23 -08:00
Jack Williams
5651789629 Fix #29457
Use allTypesAssignableToKind instead of isTypeAssignableToKind to
account for union types.
2019-01-17 20:03:46 +00:00
Sheetal Nandi
dbae2cba47 add missing type annotation 2019-01-17 11:54:43 -08:00
Wesley Wigham
045a450972 Merge branch 'fix-generic-types-intersections' of git://github.com/flapenguin/TypeScript into flapenguin-fix-generic-types-intersections 2019-01-17 10:49:04 -08:00
Andrew Casey
94ca50177a Merge pull request #29451 from amcasey/GH27937
Consider JSX namespace imports when moving statements between files
2019-01-17 10:19:02 -08:00
Sheetal Nandi
9f3b77a8bd PR feedback 2019-01-17 09:23:20 -08:00
Andrew Casey
3e256e14dc Add fourslash tests 2019-01-16 19:18:25 -08:00
Andrew Casey
7102de77d3 Consider JSX namespace imports when moving statements between files
Each of the old and new files should end up with a JSX namespace import
iff it contains JSX.

Fixes #27939
2019-01-16 18:55:27 -08:00
Benjamin Lichtman
5fc8f1dd80 Add opt-in user preference for prefix and suffix text on renames (#29314)
* Add user preference to control renaming through exports

* Only impact renaming

* Update baselines

* Use flag to control all prefix and suffix text and imports

* [WIP] add tests

* Only skip export import specifier with flag

* [WIP] Update tests

* Update test

* Pick up preference from host and update test

* Shorten flag name

* Add missing utility function

* Update comment

* [WIP] rename flag and respond to cr

* [WIP] Add flag for forRelatedSymbol

* Use larger search symbol set for old-style rename

* Respond to CR

* Fix small error

* Fix type mismatch

* Update comment and remove unnecessary exprot

* Respond to CR
2019-01-16 10:58:07 -08:00
Wesley Wigham
41a7bf4b73 Fake up value declaration for synthetic jsx children symbol so they get excess property checked (#29359) 2019-01-15 22:31:57 -08:00
Daniel Rosenwasser
adb4738cff Merge pull request #28132 from a-tarasyuk/feature/28086
28086 - "--downlevelIteration errors should mention using later targets"
2019-01-15 14:06:57 -08:00
Wesley Wigham
49689894d7 Elaborate jsx children elementwise (#29264)
* Heavy WIP, but has good contextual typing fix

* Add arity error, refine messages and spans

* Small error message change

* Better error messages, text-specific message
2019-01-15 11:32:36 -08:00
Andrew Casey
35f64fa894 Merge pull request #29421 from amcasey/DisabledLSHardening
Harden telemetryOnOpenFile against disabled projects
2019-01-15 11:23:05 -08:00
Andrew Casey
3fb09630a8 Add regression test 2019-01-15 10:55:15 -08:00
Benjamin Lichtman
c5948bf068 Merge pull request #29385 from uniqueiniquity/renameImportPref
Add user preference to opt-in to renaming import paths
2019-01-15 10:29:57 -08:00