Commit Graph
2303 Commits
Author SHA1 Message Date
Daniel 8eab5caaba Don't have to differentiate cmdline and tsconfig.json description
This reverts commit efe57733ca and 94f9e67a24.
2018-01-14 05:55:28 +07:00
Daniel efe57733ca Add a way to override description for tsconfig.json 2018-01-13 17:58:04 +07:00
Sheetal Nandi 69bb5ea8f0 Do not trigger the failed lookup location invalidation for creation of program emit files
Handles #20934
2018-01-11 12:34:58 -08:00
Andy 8bce69e6bd Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module

* Code review

* includeGlobals -> excludeGlobals

* Improve handling of `module.exports = require("...")`

* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
2018-01-09 13:15:47 -08:00
Wesley Wigham 7e6315075d Synthesize namespace records for proper esm interop (#19675)
* Integrate importStar and importDefault helpers

* Accept baselines

* Support dynamic imports, write helpers for umd module (and amd is possible) kinds

* Accept baselines

* Support AMD, use same helper initialization as is normal

* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix

* Overhaul allowSyntheticDefaultExports to be safer

* Put the new behavior behind a flag

* Rename strictESM to ESMInterop

* ESMInterop -> ESModuleInterop, make default for tsc --init

* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)

* Remove erroneous semicolons from helper

* Reword diagnostic

* Change style

* Edit followup diagnostic

* Add secondary quickfix for call sites, tests forthcoming

* Add synth default to namespace import type, enhance quickfix

* Pair of spare tests for good measure

* Fix typos in diagnostic message

* Improve comment clarity

* Actually accept the updated changes to the esmodule interop description

* ESModule -> esModule

* Use find and not forEach

* Use guard

* Rely on implicit falsiness of Result.False

* These should have been emit flags
2018-01-08 16:36:23 -08:00
Andy a23bbe65e6 Use substring instead of substr (#20578)
* Use substring instead of substr

* Remove unused scanning of SyntaxKind.DotDotDotToken in jsdoc

* Remove other unnecessary jsdoc syntax kinds

* Move all pos++ together
2018-01-08 14:54:18 -08:00
Andy 50fa0f61f5 Fix bug: Resolve module symbol before checking whether module export is a re-export (#20989)
* Fix bug: Resolve module symbol before checking whether module export is a re-export

* Remove unnecessary @nolib
2018-01-08 11:33:57 -08:00
Andy 76eafe0e75 Fix invalid cast (#20426) 2018-01-08 10:37:48 -08:00
Andy 6f2ba15446 Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
Klaus Meinhardt bc2983def9 API: fix types to undefined union (#20909) 2018-01-05 17:36:33 -08:00
Nathan Shively-Sanders f8c86552bc Better name for deferred mapped type:ReverseMapped 2018-01-05 15:44:38 -08:00
Nathan Shively-Sanders a43adad080 Simplify DeferredMappedType construction 2018-01-03 14:44:34 -08:00
Nathan Shively-Sanders 35244230d5 Add deferred mapped types
This allows index signature inference to be inferred as well.
2018-01-03 14:20:14 -08:00
Nathan Shively-Sanders 7393433593 Merge branch 'master' into defer-inference-for-recursive-mapped-types 2018-01-03 12:19:21 -08:00
Andy 1562a278f8 Don't add completion for method if the this parameter doesn't match (#20616) 2017-12-18 11:28:04 -08:00
Andrew Casey 5e2dec7727 Merge pull request #20729 from amcasey/GH19839
Refine Extract Local
2017-12-15 16:51:25 -08:00
Wesley Wigham dd933f4413 Fix get symbol at location to behave correctly for parameter assignments and jsx attributes (#20706)
* Fix get symbol at location to behave correctly got parameter assignments and jsx attributes

* Handle all those edge cases that weren;t explicitly handled

* Fix part of bug WRT getTypeAtLocation and for loops

* Baseline corrections pursuant to #20710

* Restore jsdoc tag interpretation

* Clean up some code, revert fourslash tests

* Cleanup types used by PR feedback
2017-12-15 15:50:22 -08:00
Andrew Casey 9efab94dfd Annotate fewer extracted constants with types
Expose `isContextSensitive` from the checker and omit type annotations
for expressions for which it returns false.
2017-12-15 15:11:17 -08:00
Nathan Shively-Sanders 5b45cf3db1 Update spelling 2017-12-14 15:11:29 -08:00
Nathan Shively-Sanders 05de0a7da3 Get it working:
1. Actually return the cached result!
2. Unnest worker function.
3. Improve all the names.
4. Pre-set the cache to undefined to avoid loops. (Not sure this is
needed, though.)
5. Make the new type internal to avoid baseline changes.
6. Cut off recursion in the printing of recursive deferred mapped types.

Note that (6) required introducing a new stack that is exactly like
mappedTypeStack. I think the cache may actually be needed here, not in
the creation of the deferred type.
2017-12-14 13:33:02 -08:00
Nathan Shively-Sanders 7d1a980ad2 First attempt. Basically broken. 2017-12-13 16:29:36 -08:00
Wesley Wigham eba15b5990 Preserve literal types in contextual unions (#19966)
* Cherrypick non-comparability related changes from prolific literals PR

* Renames and other style changes

* Accept changes to new tests

* Exclude the domain root from contextual typing literals except for type variables

* Readd simple preservation fix

* Add huge map test

* Revert changes to widening on destructuring initalizers

* Use tristate for subtype-reduction type

* Rename type and argument

* Move longer-running test to user suite
2017-12-11 18:03:38 -05:00
Wesley Wigham 9e51882d9c Numeric separators (#20324)
* Add support into octal and binary literals

* Add hex support

* And finally support all numeric literals and fix spelling

* Update error message

* Refactor error in scanner to take a position

* Scan no separators in escape sequences, add escape sequence tests

* More decimal tests from the spec presentation examples

* Permissive scanning of excess separators

* Remove unnecessary assignment

* Make code easier to follow
2017-12-08 20:20:18 -05:00
Andy 19ea189b42 Support a "getCombinedCodeFix" service (#20338)
* Support a "getCombinedCodeFix" service

* Rename things

* Code review

* Rename things

* Update API baselines

* CodeActionAll -> CombinedCodeActions

* Take a `scope` parameter instead of `fileName` for flexibility

* Renames and bugfixes

* Make API changes internal

* Code review

* Update comment
2017-12-07 12:14:18 -08:00
Andy 18a7c3fb53 For import fix, prefer symlink over a real path (#20395)
* For import fix, prefer symlink over a real path

* fixes

* Use best result from all symlinks

* Make originalPath optional more

* Only include real path if a symlink isn't available
2017-12-06 11:27:38 -08:00
Andy 8153397e91 Lazily compute signature type predicates (#17600)
* Lazily compute signature type predicates

* Use an instance of IdentifierTypePredicate to represent an unresolved type predicate

* Simplify `getMaybeTypePredicate`

* Invert representation of `resolvedTypePredicate`

* Remove `__unresolvedTypePredicate` type and remember to use `noTypePredicate` instead of `undefined` when in all `createSignature` calls

* Fix style of getTypePredicateOfSignature

* Use in createGetSymbolWalker

* Fix bugs for unions of type predicates

* Code review

* Make noTypePredicate purely an implementation detail of getTypePredictateOfSignature

* Add test

* Add test for #19642

* Add test with reversed order
2017-12-05 08:32:34 -08:00
benbraou 49a48ffd4d fix(es2018): add a target and an initial lib (#20385)
* run Jake LKG before es2018 addition

Fixes #20342

* fix(es2018): add a target and an initial lib

Fixes #20342
2017-12-02 11:16:59 -08:00
Andy fd4d8ab96e Support a 'recommended' completion entry (#20020)
* Support a 'recommended' completion entry

* Code review

* Restore duplicate comments
2017-12-01 13:00:01 -08:00
Nathan Shively-Sanders 69bbfedd63 Merge branch 'master' into jsdoc-values-as-namespaces 2017-11-30 10:34:50 -08:00
Nathan Shively-Sanders 665c2ecf91 Add SymbolFlag for containers of JS special decls
And update some doc comments
2017-11-30 10:27:38 -08:00
Klaus Meinhardt 0b9e4987f4 Make AccessorDeclaration.body optional (#20329)
* Make AccessorDeclaration.body optional

* Accept baselines
2017-11-29 13:59:40 -08:00
Nathan Shively-Sanders 61fe04ba0d Merge branch 'master' into jsdoc-values-as-namespaces 2017-11-28 15:01:40 -08:00
Andy 94ea38859b Disable import fix for method of 'export =' value (#20208)
* Disable import fix for method of 'export =' value

* Exclude primitives, but allow other interfaces

* Use type.flags

* Fix comment
2017-11-28 17:46:06 -05:00
Wesley Wigham 5ee640d2b6 Move utilities for getting type parameter constraints and defaults from public lazy members to services (#20162) 2017-11-28 13:37:42 -08:00
Nathan Shively-Sanders bee7d06761 Binder-based prop-assignment decls: messy version 2017-11-22 13:52:45 -08:00
Anders Hejlsberg 1624e1bc1a Definite assignment assertion '!' on variable and property declarations 2017-11-19 16:48:43 -08:00
Anders Hejlsberg 8c4c529d8e Merge branch 'master' into strictPropertyInitialization 2017-11-17 14:30:23 -08:00
Andy 74a44e09a7 Support semantic classification of alias (#20012) 2017-11-17 08:04:51 -08:00
Anders Hejlsberg c11969f804 Mark returnFlowNode property as internal 2017-11-16 10:57:15 -08:00
Anders Hejlsberg f1762a04ea Attach return control flow graph to contructor declaration nodes 2017-11-16 10:35:14 -08:00
Anders Hejlsberg b6f96052d8 Merge pull request #19976 from Microsoft/optimizeParser
Optimize parsing
2017-11-16 10:19:10 -08:00
Ron Buckton 804c7d3690 Merge branch 'master' into dynamicNames 2017-11-13 13:24:20 -08:00
Ron Buckton ae11ae55c5 Fix getReturnTypeFromBody widening 2017-11-13 13:19:49 -08:00
Anders Hejlsberg 3411318e6b Use TokenFlags.PrecedingJSDocComment to guide JSDoc comment processing 2017-11-13 09:51:56 -08:00
Anders Hejlsberg ddf0df9cbb Introduce TokenFlags enum 2017-11-12 09:11:09 -08:00
Anders Hejlsberg 2010c4cda1 Give lowest priority to inferences made from empty array literals 2017-11-10 08:30:59 -08:00
Andy 65a191fa2b For import completion of default import, convert module name to identifier (#19875)
* For import completion of default import, convert module name to identifier

* Suggestions from code review
2017-11-09 13:13:23 -08:00
Andy 90ae9ffe6e If there is an export default x; alias declaration, disallow other default exports (#19872) 2017-11-09 12:21:37 -08:00
Mohamed Hegazy 1de3bbac2e Merge branch 'update-types3' of https://github.com/ajafff/TypeScript into ajafff-update-types3 2017-11-07 15:23:38 -08:00
Ron Buckton 3f248ecfe1 Merge pull request #19452 from Microsoft/compareStrings
Clean up outdated string comparison logic
2017-11-06 18:48:15 -08:00