Commit Graph

44 Commits

Author SHA1 Message Date
Sheetal Nandi
5ecdcef4ce Remove unnecessary requirement for createHash since we already handle absence of it (#40891) 2020-10-02 10:56:33 -07:00
Tim van der Lippe
070cf1112f Remove duplicate comment (#40667) 2020-09-30 09:41:31 -07:00
Andrew Branch
98ab3a788f Fix tsc --watch crash on module augmentations when module resolution changes (#39604)
* Add failing test

* Ensure source files are bound before analyzing them
2020-07-14 15:05:10 -07:00
Ron Buckton
7b942b4fa8 Revert the type change to ts.Map (#39366) 2020-07-01 17:00:26 -07:00
Ron Buckton
eb2f4e2337 Switch to ES Map/Set internally (#33771)
* Add full implemention of Map and Set to shims

* Update default Map interface

* Remove WeakMap/WeakSet

* Add tests for set shim

* Update most usages of Map<K, true> to Set

* PR Feedback

* Fix lint issues

* Change key in fsWatchCallback

* Simpler shim, more tests

* Fix typo in collection shim
2020-06-26 10:12:47 -07:00
Sheetal Nandi
f0da6d1203 Some changes to tsc baselines for clarity (#38850)
* Baseline programs in tsc -b and tsc -incremental mode as well

* Refactor outFile

* Tests

* Distinct input and output

* Add helper to baseline serialized invocations of tsc on incremental edits

* Input and output in watch mode

* Update src/testRunner/unittests/tsbuild/helpers.ts

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2020-06-02 11:49:21 -07:00
Sheetal Nandi
fd9e602fcf When the global file is deleted mark all files as changed (#37538)
* Add test case when the errors are not refreshed if global file is deleted
Testcase for #36728

* When the global file is deleted mark all files as changed
Fixes #36728

* Update other baselines to fix file info
2020-03-25 16:26:10 -07:00
Sheetal Nandi
8f64d667f2 If emitting declaration file, update the d.ts signature in state to not have to save all files when different file changes without changing its shape (#37483)
* Add test that calling getAffectedFiles on two different files (even if the second one is saved) returns all files

* If emitting declaration file, update the d.ts signature in state to not have to save all files when different file changes without changing its shape
Fixes #30508
2020-03-20 10:16:41 -07:00
Sheetal Nandi
7e07a2b5d1 Allow rich response for compile on save (#37462)
Fixes #30739
2020-03-19 14:03:21 -07:00
Ron Buckton
177713ef45 Switch Debug.assertX functions to use asserts conditions (#36995)
* Switch Debug.assertX functions to use asserts conditions

* Replace assert functions with ts.noop when assertion level too low
2020-02-24 18:20:58 -08:00
Sheetal Nandi
ec84392f2e Use resolvedPath consistently in the builder (#35757)
* Add baseline for #35468

* Use resolvedPath consistently in the builder
Fixes #35468
2019-12-19 10:10:17 -08:00
Wesley Wigham
c447ebc59c Refactor: No more than 1 namespace declaration per file (#35373)
* Refactor: No more than 1 namespace declaration per file

* Simplify refs where possible
2019-11-27 13:44:31 -08:00
Sheetal Nandi
0019cee6de Handle --isolatedModules and d.ts emit in the builder 2019-09-11 12:52:23 -07:00
Sheetal Nandi
c0f0d9f798 Merge branch 'master' into dtsOnlyEmit 2019-09-11 12:42:48 -07:00
Sheetal Nandi
11fd654cf9 Separate emitOnlyDtsFiles and forcing dts emit (for builder signature detection where we want it irrespective of settings) 2019-09-09 16:22:50 -07:00
Alexander
b1d748b644 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-08-31 22:12:41 +03:00
Sheetal Nandi
79bcb3d547 Handle seenEmittedFiles which was not being set when emit of a file was complete (#33145)
* Add test that fails because file is written multiple times
Reported from #33061

* Handle seenEmittedFiles which was not being set when emit of a file was complete.
It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles)
If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly
Fixes #31398

* make baselining source map optional

* Handle emitDeclarationOnly in --build scenario

* Ensure we are using d.ts emit as signature even when --declarationMap is on (map files are emitted before d.ts)

* Move module specifiers to verifyTsBuildOutput

* implement create Hash to be default hashing plus data so we can verify it easily in baseline

* Remove failing baseline

* Accept correct baseline name
2019-08-30 16:33:44 -07:00
Alexander
e30266598e remove spaces from @internal tag 2019-08-10 10:26:33 +03:00
Alexander
023e4c6249 disable no-redeclare 2019-08-09 07:30:40 +03:00
Alexander
ceccfd8867 array-type: [ default: array, generic: array ] 2019-08-08 21:30:18 +03:00
Alexander T
4defd1d635 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-04 12:49:33 +03:00
Ron Buckton
e8bf9584aa Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Alexander T
136f4cfc0f no-redeclare 2019-06-27 12:29:32 +03:00
Sheetal Nandi
17d2c8bcfb Handle dts change as well as signature update when exported module affects dts but not js file 2019-04-16 13:27:51 -07:00
Sheetal Nandi
684c531386 Always assert that source files are versioned when program is used with Builder 2019-03-26 11:55:12 -07:00
Sheetal Nandi
e3f8c34bc9 Add mechanism to dump and read program to build info 2019-02-07 12:10:15 -08:00
Matthew Aynalem
f30e8a284a fix spelling errors 2019-01-27 20:33:33 -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
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
941d97c45a Handle global augmentation in the module 2018-11-09 16:41:18 -08:00
Sheetal Nandi
d352b8c2c7 Use reference map from declaration file as exported map to handle deep import semantic diagnostics invalidation
Fixes #27973
2018-10-18 12:04:14 -07:00
Sheetal Nandi
03a3978d65 Use ambient modules as references to keep track of reporting and usage of modules correctly
Fixes #27585
2018-10-08 15:56:39 -07:00
Sheetal Nandi
d51b8d940c Use originalFileName (fileName of input project reference file) to resolve module/typereferences/reference paths in it instead of output decl file path
This also ensures that originalFileName, resolvedPath are set correctly even when we are reusing program structure
Fixes #26036
2018-09-17 19:00:30 -07:00
Sheetal Nandi
aac961e60d Builder to use project reference redirects to output in the dependencies instead of source files 2018-09-17 12:18:59 -07:00
Sheetal Nandi
51837bb59a Make ExportedModulesFromDeclarationEmit as ReadonlyArray of symbols combining exportSpecifiers emitted and dynamic import type nodes written 2018-08-01 12:37:39 -07:00
Sheetal Nandi
50b75e7585 Optimize the deletion and calculation of bigger set of semantic diagnostics to be calculated 2018-07-12 13:44:56 -07:00
Sheetal Nandi
585acb1990 Use exported modules through declaration emit to invalidate the semantic diagnostics
Fixes #24986
2018-07-11 16:43:02 -07:00
Andy
e53e56cf82 Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Ryan Cavanaugh
8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Sheetal Nandi
2611c9b339 Merge branch 'master' into builderApi 2017-12-07 20:23:15 -08:00
Sheetal Nandi
965f40f213 Use builder state in the semantic/emit builder as well 2017-12-07 17:11:36 -08:00
Sheetal Nandi
bb0fc0d2bc Convert builder state to mutable data, so that later we can create builder Program out of this 2017-12-07 14:15:59 -08:00
Sheetal Nandi
2586bb303c From builder use the builderState containing references and file infos 2017-12-07 12:39:26 -08:00
Sheetal Nandi
4c21cbf145 Create builderState so that when FilesAffectedBy is only api needed, we arent tracking changed files 2017-12-07 11:47:49 -08:00