Commit Graph
10965 Commits
Author SHA1 Message Date
Wesley WighamandGitHub b8e0009c9b Set syntheticLiteralTypeOrigin on synthetic undefined-type members (#22216)
* Have getNameOfSymbolAsWritten quote nonidentifier nonnumeric symbols all the time

* Revert checker changes

* Reuse synthetic origin to indicate that derived declaration name may need to be quoted
2018-02-28 16:03:05 -08:00
Wesley WighamandGitHub 1a43ad01a7 Lookup JSX namespace within factory function (#22207)
* Lookup JSX namespace within factory function

* Rename functions
2018-02-28 15:48:33 -08:00
Wesley WighamandGitHub 62185673fd Emit unqiue symbols with typeof if possible before issuing an error (#21403) 2018-02-28 15:44:12 -08:00
Wesley WighamandGitHub 7a31192ecb Stop binding type predicate types twice (#22210) 2018-02-28 15:43:13 -08:00
Sheetal NandiandGitHub 005a50f587 Merge pull request #22136 from Microsoft/moduleResolution
Use cache for the non-relative module resolution and enhance the watches for failed lookup locations
2018-02-28 14:39:22 -08:00
Benjamin LichtmanandGitHub ca12cdcb5f Merge pull request #22138 from uniqueiniquity/conflictingDefinitionsError
Update category for TS4090 to Error
2018-02-28 14:22:41 -08:00
AndyandGitHub fa4619c5c1 Add 'info' diagnostics (#22204)
* Add 'info' diagnostics

* Code review
2018-02-28 11:16:32 -08:00
Wesley WighamandGitHub c1128d6957 Fix declaration emitted crash on mapped type with no type (#22213) 2018-02-27 16:12:03 -08:00
Wesley WighamandGitHub dafa7321c6 Add semicolons to import helpers (#22212) 2018-02-27 16:11:33 -08:00
AndyandGitHub f4af74aae1 Simplify TextChanges#getChanges (#22157)
* Simplify TextChanges#getChanges

* Rename function and improve assert
2018-02-27 12:26:05 -08:00
Wesley WighamandGitHub 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
Wesley WighamandGitHub 0dc5f18bdb Remove excess comment ranges from initialized and property parameter emit (#22152) 2018-02-26 12:43:31 -08:00
AndyandGitHub 95dfd271e2 Make some internal types @internal (#22190) 2018-02-26 12:37:45 -08:00
AndyandGitHub e4e4b17669 Improve error message for untyped import of scoped package (#22189) 2018-02-26 10:38:54 -08:00
Andrew CaseyandGitHub b31aa4e012 Merge pull request #22087 from amcasey/AmbientModuleImports
Organize imports in ambient modules
2018-02-23 17:43:28 -08:00
Daniel RosenwasserandGitHub 4d284d617f Merge pull request #22098 from alexeagle/pretty
fix --pretty output when context is multi-line
2018-02-23 12:51:01 -08:00
Wenlu WangandAndy 30a96ba335 add support of codefix for Strict Class Initialization (#21528)
* add support of add undefined type to propertyDeclaration

* add support of add Definite Assignment Assertions to propertyDeclaration

* add support of add Initializer to propertyDeclaration

* remove useless parameter

* fix PropertyDeclaration emit missing exclamationToken

* merge fixes and fix

* fix unnecessary type assert
2018-02-23 07:25:50 -08:00
Alex Eagle 2e66e74e14 fix --pretty output when context is multi-line
Fixes #22097
2018-02-22 22:56:00 -08:00
uniqueiniquity 96441abce6 Update category for TS4090 to Error 2018-02-22 17:01:31 -08:00
Andrew Casey 427e6ed3e6 Tidy isAmbientModule 2018-02-22 16:30:55 -08:00
Sheetal NandiandGitHub 86dca7bada Merge pull request #22090 from Microsoft/fileDeletedWatchClose
In tsc--watch, fix the leaking watch when old source file is not part of program any more
2018-02-22 16:04:17 -08:00
Sheetal Nandi 9569b13174 Use refcounts on the resolution so we arent going through failed lookup locations when resolutions are cached. 2018-02-22 16:04:00 -08:00
AndyandGitHub a299d2dd1c isDeclarationName: support ComputedPropertyName (#22123)
* isDeclarationName: support ComputedPropertyName

* update additional baseline
2018-02-22 15:53:49 -08:00
Sheetal Nandi fdb5e95f0a Use the module cache to resolve non relative module name as well 2018-02-22 15:44:13 -08:00
Wesley WighamandGitHub 66fa9f6cd7 Just map type variables to constraints at certain positions for narrowing so that we do not map primitives (#21384)
* Use a limited version of getApparentType that doesnt map primitives

* Reuse [most of]  getBaseConstraintOfType, since it does the needed behaviors

* Move new function next to the very similar function
2018-02-21 12:51:26 -08:00
AndyandGitHub 8a52eade2e Make getTextOfIdentifierOrLiteral and getEscapedTextOfIdentifierOrLiteral only accept Identifier | StringLiteralLike | NumericLiteral (#22002) 2018-02-21 11:05:43 -08:00
Sheetal Nandi 2777c3a890 Close the file watcher if present for the source file 2018-02-21 11:01:58 -08:00
AndyandGitHub dd47f2492b getSemanticDocumentHighlights: Use toMultiMap helper (#22059)
* getSemanticDocumentHighlights: Use `toMultiMap` helper

* Rename to arrayToMultiMap and follow pattern of arrayToMap and arrayToNumericMap
2018-02-21 10:02:34 -08:00
AndyandGitHub 4833657c33 Use 'append' in chunkObjectLiteralElements (#22068) 2018-02-20 15:30:12 -08:00
Daniel RosenwasserandGitHub 0559151eb2 Merge pull request #21990 from Microsoft/documentExportAssignment
Document 'ExportAssignment' slightly.
2018-02-20 15:03:32 -08:00
AndyandGitHub 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
AndyandGitHub 69abe49930 Supports more locations for completions contextual types (#21946) 2018-02-16 16:48:03 -08:00
AndyandGitHub 9ee51fadd9 Have Symbol#isReferenced check the SymbolFlags of the reference (#21996) 2018-02-16 16:47:13 -08:00
Andrew CaseyandGitHub 70e9a5e6dc Merge pull request #21909 from amcasey/OrganizeImports
Introduce an organizeImports command
2018-02-16 12:49:02 -08:00
Andrew Casey 5c278cee17 Address PR feedback
Eliminate cancellation token

Add organizeImports.ts to tsconfig.json

Simplify ts.OrganizeImports.organizeImports

Simplify sortImports

Semantic change: all invalid module specifiers are now considered to be
equal.

Simplify comparisons using ||

Pull out imports with invalid modules specifiers

...for separate processing.  They are tacked on to the end of the
organized imports in their original order.

Bonus: downstream functions can now assume imports have valid module
specifiers.

Rename baseline folder with leading lowercase

Simplify coalesceImports

Remove some unnecessary null checks

Simplify baseline generation
2018-02-16 10:56:16 -08:00
AndyandGitHub b70aa229c6 getTextOfPropertyName: Assert input value is a PropertyName (#21981) 2018-02-16 10:48:57 -08:00
Daniel Rosenwasser 06286e760a Document 'ExportAssignment' slightly. 2018-02-16 01:17:45 -08:00
AndyandGitHub 347bff14a9 textChanges: Simplify getChanges (#21971)
* textChanges: Simplify getChanges

* Return ReadonlyArray
2018-02-15 13:02:45 -08:00
Anders HejlsbergandGitHub 0f697c376b Merge pull request #21947 from Microsoft/fixKeyofWildcard
Fix issue with 'keyof T' and conditional types
2018-02-15 12:44:51 -08:00
AndyandGitHub a133cec246 Fix bug: Interface type parameter merged with property is not unused (#21966) 2018-02-15 09:30:58 -08:00
AndyandGitHub 1b6aa1386f Handle non-preserved const enums in debug messages (#21945) 2018-02-15 09:21:33 -08:00
AndyandGitHub 8518343dc8 Add isStringLiteralLike helper (#21953) 2018-02-14 13:25:04 -08:00
AndyandGitHub 2ee92948d8 Support @param tag on property declaration initializer (#21907)
* Support @param tag on property declaration initializer

* Update test

* Finish updating test
2018-02-14 10:12:38 -08:00
Anders Hejlsberg 3a61f638ba Instantiation of 'keyof T' for wildcard type produces wildcard type 2018-02-14 09:19:47 -08:00
AndyandGitHub 8c2756fdf6 Support getting string literal completions based on a type argument constraint (#21168)
* Support getting string literal completions based on a type argument constraint

* Fix bug: look for require call before argument info

* Code review

* @sandersn code review

* Remove test cast

* Reduce completions.ts diff

* @weswigham review

* Remove getTypeArgumentConstraint's dependence on checkTypeArgumentConstraints

* Remove TODO
2018-02-13 15:18:26 -08:00
Anders Hejlsberg a629acd8fd Allow +/- to prefix 'readonly' and '?' modifiers in mapped types 2018-02-12 16:20:49 -08:00
AndyandGitHub 74f01abfcf Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903) 2018-02-12 14:42:16 -08:00
Anders HejlsbergandGitHub d07523e9e5 Merge pull request #21866 from Microsoft/fixIndexedAccessWildcard
Fix indexed access issue with conditional types
2018-02-12 14:18:44 -08:00
Adrian LeonhardandMohamed Hegazy 6ab5d97a5d Changed "Duplicate Identifier" to "enum cannot be merged..." (#18579)
* Changed "Duplicate Identifier" to "enum can only be merged..."
when either declaration of the identifier is an enum.

Partial (?) fix for #529

Not sure if the new test is necessary, all the cases seem to have been covered by others tests.

* picked a nit
2018-02-12 13:38:08 -08:00
Ron BucktonandGitHub 2ff8fae5da Merge pull request #21900 from Microsoft/fix21620
Fix emit when binder treats exported const as namespace
2018-02-12 13:34:54 -08:00