Commit Graph
12969 Commits
Author SHA1 Message Date
Sheetal Nandi c909becdd5 Rename indexing variable 2019-01-14 12:44:37 -08:00
Sheetal Nandi c1edbb8522 Merge branch 'master' into incrementalBuild 2019-01-11 14:34:45 -08:00
Wesley Wigham fadd95f72b Fix unneeded cast lints (#29383) 2019-01-11 14:24:49 -08:00
Sheetal Nandi 9f19c06dbf Merge pull request #29372 from JoshuaKGoldberg/codefix-enable-decorators
Added codefix to enable experimentalDecorators in the user's config file
2019-01-11 12:45:28 -08:00
Sheetal Nandi fb99d552ea Merge pull request #29022 from mprobst/no-resolve-libref
Do not process library reference directives with noLib set.
2019-01-11 09:03:46 -08:00
Josh Goldberg 8d28f9230c Added codefix to enable experimentalDecorators in the user's config file
Starts on #29035 by creating a codefix to enable the `experimentalDecorators` setting in a user's config file, if one exists. The issue's discussion also mentions giving a more precise error message if the user has a jsconfig or tsconfig or creating one if not; I'd rather tackle those in separate PRs to keep this one small.

Doesn't create the code action if no config file is present. Otherwise keeps to the precedent of returning without action when the config file contents aren't the expected JSON structure (looking at `fixCannotFindModule.ts`).  Moves a couple JSON helpers from that file into the sibling `helpers.ts` so both codefixes can use them.
2019-01-11 09:20:12 -05:00
Martin Probst 11b150129a Do not process library reference directives with noLib set.
When a user sets `noLib`, this indicates that they will supply their own
list of `lib*.d.ts` files as part of input sources. In this situation,
TypeScript should not try to resolve library reference directives.

This avoids a problem where TypeScript loads a file that e.g. contains
`/// <reference lib="es2015.symbol"/>`. Previously, TypeScript would use
its builtin ts.libMap and attempt to load builtin libraries from the
TypeScript installation, instead of respecting the user-supplied set of
libraries.
2019-01-11 09:02:49 +01:00
王文璐 9d16225bc2 emit jsx type arguments 2019-01-11 13:34:18 +08:00
Sheetal Nandi abc861862a Fix typo 2019-01-10 15:18:02 -08:00
Wesley Wigham aba0b700b6 Allow circular umd-merged-with-augmentation refs to resolve to the module as intended (#29335) 2019-01-10 14:48:15 -08:00
Wesley Wigham 76f444e338 Allow nonnull assertions in references (#29351) 2019-01-10 14:45:19 -08:00
Anders Hejlsberg 52b82560e8 Merge pull request #29338 from Microsoft/fixConditionalTypeResolution
Fix conditional type resolution
2019-01-09 17:18:12 -08:00
Anders Hejlsberg 70148a4b55 Improve logic that determines when to resolve conditional types 2019-01-09 16:10:28 -08:00
Wesley Wigham d0aff9bdcd Fix crash (#29333) 2019-01-09 14:23:57 -08:00
Daniel Rosenwasser 6bfb935929 Merge pull request #25445 from a-tarasyuk/bug/24542-bad-error-message-for-import-ing-an-export
24542 - bad error message for `import *`-ing an `export=`
2019-01-09 11:02:14 -08:00
Sheetal Nandi 1b37830615 Merge branch 'master' into incrementalBuild 2019-01-09 10:40:01 -08:00
Klaus Meinhardt b52a7fc3ea Exclude JSDoc @extends from 'super()' checks (#29308)
* Exclude JSDoc @extends from 'super()' checks

This fixes a similar problem as #29244 where JSDoc `@extends`

* fix check 'super can only be referenced in a derived class'
2019-01-09 10:35:22 -08:00
Wesley Wigham 19c72c758a Allow untyped calls on unions of untyped things (#29265) 2019-01-08 11:05:55 -08:00
Alexander T 52057ac4f6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into bug/24542-bad-error-message-for-import-ing-an-export 2019-01-08 10:55:11 +02:00
Alexander T 945eed8d9b PR feedback: change error #2497 message 2019-01-08 10:54:08 +02:00
Martin Probst 7a2b2cebbf Do not emit code for @extends tags in JS. (#29244)
When transpiling JavaScript, TS3.1+ emits `@extends` tags as code. E.g.

    /** @extends {SuperClass} */
    class SubClass {}

Causes an ES5 emit that references SuperClass:

    /**
    * @extends {SomeBase}
    */
    var SubClass = /** @class */ (function (_super) {
        __extends(SubClass, _super);
        function SubClass() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return SubClass;
    }(SomeBase));

Note the literal references to `SomeBase`.

This appears to be an accidental effect of 0f55566cf4. It refactored
`getEffectiveBaseTypeNode` for type checking, but missed an instance
where it is also used for emit logic. This change fixes the problem by
specifically getting the heritage clauses directly off the AST.

Change-Id: I3128a757e5924e2528c61230a90ac13650852542
2019-01-04 08:13:14 -08:00
Sheetal Nandi b7d7d5f7b3 Merge pull request #29252 from Microsoft/tscWatchIsolatedModules
Do not cache semantic diagnostics with --isolated modules
2019-01-03 14:35:19 -08:00
Sheetal Nandi a633f95da7 Do not cache semantic diagnostics with --isolated modules
Fixes #28332
2019-01-03 14:07:25 -08:00
Sheetal Nandi bce9e2c11c Merge pull request #29250 from Microsoft/hasContextSensitiveReturnExpression
Fix function declaration without body to be checked as context sensitive
2019-01-03 14:06:13 -08:00
Sheetal Nandi f4a6fb79da Replace ternary expression 2019-01-03 13:29:43 -08:00
Sheetal Nandi d8ee4116ef Fix function declaration without body to be checked as context sensitive
Fixes #29032
2019-01-03 12:46:39 -08:00
Sheetal Nandi c426fc6868 Merge branch 'master' into tscWatchExportUpdate 2019-01-03 11:35:54 -08:00
Benjamin Lichtman 048d04684b use existing util functions 2018-12-31 15:56:54 -08:00
Daniel Rosenwasser 0dbb9760c0 Merge pull request #29147 from Kingwl/type_query_completions
fix typeof completions broken
2018-12-31 10:36:39 -08:00
Anders Hejlsberg beebda3574 Merge pull request #29110 from Microsoft/fixDiscriminantCheck
Fix discriminant property check
2018-12-30 17:46:01 -10:00
Anders Hejlsberg 8570a67572 Merge pull request #29121 from Microsoft/mappedTypeConstraints
Improve constraints for non-homomorphic mapped types
2018-12-30 17:44:41 -10:00
Anders Hejlsberg fd3af78b8b Merge pull request #29179 from Microsoft/typeParameterDefaultForwardReference
No self or forward references in type parameter defaults
2018-12-30 17:43:57 -10:00
Anders Hejlsberg 0165e80e7c Don't widen contextually typed literals in initializer expressions 2018-12-28 09:30:14 -10:00
Anders Hejlsberg 3f7a9a906b Type parameter defaults can only reference previously declared type parameters 2018-12-27 13:45:13 -10:00
Sheetal Nandi 42484b504e Use DirectoryStructureHost for fileExists and readFile 2018-12-27 10:36:18 -08:00
Sheetal Nandi 69abc12494 Handle declaration emit errors in tsbuild mode by backing up builder state
This helps us revert to state where we pretend as if emit is not done (since we do not do emit if there are errors)
2018-12-26 12:25:27 -08:00
王文璐 7c93affd7d fix typeof completions broken 2018-12-25 17:30:04 +08:00
Sheetal Nandi 0d9038c30a Handle prepend in incremental build. Always emit when program uses project reference with prepend since it cant tell changes in js/map files 2018-12-21 17:22:17 -08:00
Sheetal Nandi 7b290fdbd4 Update the timestamps of outputs that dont need to be written because of incremental build
This ensures that after `tsbuild` after incremental build of `tsbuild -w` doesnt result in unnecessary rebuilds
2018-12-21 12:56:03 -08:00
Sheetal Nandi f1949bbae8 Use emit builder to emit only changed files. 2018-12-21 12:53:26 -08:00
Sheetal Nandi 47f51060e9 Use oldProgram to create the new Program.
This helps in storing the semantic diagnostics
2018-12-21 12:53:26 -08:00
Sheetal Nandi 69193d9c20 Add method to release held Program in BuilderProgram 2018-12-21 12:53:25 -08:00
Sheetal Nandi 56a76d8b62 Revert BuilderProgram to be redirected object to Program in preparation to set Program in state to undefined for storing. 2018-12-21 12:53:25 -08:00
Sheetal Nandi 48baa42d65 Make SolutionBuilder handle BuilderProgram in preparation to handle incremental builds 2018-12-21 12:53:25 -08:00
Sheetal Nandi 9e05abcfd3 Make BuilderProgram as Program 2018-12-21 12:53:15 -08:00
Sheetal Nandi 0cabb00b34 Use watch factory instead of direct host functions in tsbuild to provide detailed information on watch invokations 2018-12-21 12:53:14 -08:00
Anders Hejlsberg 565ab7a971 Properly compute lower bound of key type in a mapped type 2018-12-21 12:50:53 -08:00
Anders Hejlsberg 93acaac087 Fix discriminant property check 2018-12-20 07:17:42 -08:00
Wesley Wigham 08022d57c8 Allow calls on unions of dissimilar signatures (#29011)
* Add core of new union signature logic and test - needs intersection signature logic to fully work

* Add inversion of variance for class props lookup from union sig returns

* Fix lints

* Combine parameter names for nicer quick info

* PR feedback 1

* Fix miscopy

* PR feedback round 2

* Remove argument name combining because loc :(

* Nit cleanup round 3

* Reinline getTupleTypeForArgumentAtPos

* Remove a tad more

* No step on sneky off-by-one error
2018-12-19 16:35:01 -08:00
Daniel Rosenwasser ab2a38ebef Merge pull request #29102 from Microsoft/declarationEmitForDefaultExportClassExtendingExpression
Declaration emit for default exported class extending expression
2018-12-19 16:19:36 -08:00