338 Commits

Author SHA1 Message Date
Ryan Cavanaugh
7a1de6142b Scaffold watch mode 2018-06-01 09:44:35 -07:00
Ryan Cavanaugh
f8c4301f14 Add more errors; commandline help for --build; invalid flag combo detection 2018-05-30 10:00:35 -07:00
Ryan Cavanaugh
8936b030cd Merge branch 'master' into tsbuild 2018-05-24 13:01:58 -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
6d04378e90 Testing WIP 2018-05-21 19:40:09 -07:00
Ryan Cavanaugh
7e0825a3e7 Clean, etc 2018-05-21 17:47:58 -07:00
Ryan Cavanaugh
ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Sheetal Nandi
44066d6c7a Handle the test case when tsconfig file changes without needing to update the program
Fixes #23687
2018-04-27 16:59:50 -07:00
Daniel Rosenwasser
320cb40f12 Address CR feedback. 2018-04-18 12:33:38 -07:00
Daniel Rosenwasser
6953fa1732 flags--; 2018-04-17 17:06:50 -07:00
Daniel Rosenwasser
299002d597 Fix spacing. 2018-04-14 11:53:27 -07:00
Daniel Rosenwasser
bd3e854b31 Automatically configure tsc output and provide a new 'diagnosticStyle' option. 2018-04-13 21:19:24 -07:00
Ryan Cavanaugh
df95de3231 Merge branch 'master' into referencesDogfood_1 2018-04-11 16:17:38 -07:00
Ryan Cavanaugh
8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Brandon Slade
82e8bcf3b2 Fix typeo: rename udpateReportDiagnostic to updateReportDiagnostic 2018-04-10 21:58:18 -06:00
Sheetal Nandi
7329eb1ab1 Make sure config file parsing errors are available through program
Fixes #22570, #21940
2018-03-15 14:58:50 -07:00
Mohamed Hegazy
708caf9a72 Do not use unguarded process in tsc.ts 2018-03-13 11:03:12 -07:00
Nathan Shively-Sanders
a81f264d70
Call process.stdout._handle.setBlocking(true) (#22389)
* Call process.stdout._handle.setBlocking(true)

This prevents output from being truncated when the compiler can output
errors to stdout faster than it can receive them. This may slow down
performance for compilations for many errors, but those were already
quite slow.

* Disable tslint no-unnnecessary-type-assertion-2

It is wrong. It *is* necessary.
2018-03-08 12:38:30 -08:00
Andy
a564912d9a
Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
Sheetal Nandi
2be231d339 Add createProgram on WatchCompilerHost 2018-01-19 15:52:21 -08:00
Sheetal Nandi
5bc78afcbb Merge branch 'master' into builderApi 2018-01-08 13:01:09 -08:00
Sheetal Nandi
9b54d2e458 Create api to create Watch<BuilderProgram> 2017-12-07 19:22:17 -08:00
Sheetal Nandi
14f66efcc5 Update the emitting file, reporting errors part of the watch api 2017-12-05 22:15:24 -08:00
Sheetal Nandi
e694b9e3ba Update the WatchCompilerHost creation 2017-12-05 17:51:35 -08:00
Sheetal Nandi
43c2610a69 More functions moved from system to WatchCompilerHost 2017-12-05 16:53:34 -08:00
Sheetal Nandi
944f8b8792 Instead of using system as object on WatchHost, create WatchCompilerHost that combines the functionality 2017-12-05 11:46:45 -08:00
Sheetal Nandi
576fe1e995 Expose the watch and builder API in the typescript.d.ts 2017-11-22 11:48:50 -08:00
Sheetal Nandi
a06f0c3d9f Use builder state to emit instead 2017-11-22 11:48:50 -08:00
Ron Buckton
31c3d444f1 Merge branch 'master' into compareStrings 2017-11-03 23:01:51 -07:00
Andy
d998e97d8c
Apply 'prefer-for-of' tslint rule (#19721) 2017-11-03 15:20:35 -07:00
Andy
5e0c71e6ba
The global "JSON" object should always exist (#19583) 2017-10-30 16:20:55 -07:00
Ron Buckton
3cb15378d7 Improve performance of deduplication of sorted arrays 2017-10-26 17:51:09 -07:00
Ron Buckton
24437774a8 Further simplification 2017-10-26 11:56:29 -07:00
Sheetal Nandi
14febe2113 Rename watchedProgram.ts to watch.ts 2017-09-26 10:46:32 -07:00
Sheetal Nandi
fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Andy
e2141ad469 Mark some arrays as readonly (#17725)
* Mark some arrays as readonly

* Avoid unnecessary allocations and style changes

* Fix lint
2017-08-24 09:55:01 -07:00
Sheetal Nandi
6385f7e3bb Get semantic diagnostics for the program from builder so that it caches the errors of unchanged files 2017-08-07 16:18:34 -07:00
Sheetal Nandi
031a63762f Switch back to have tsc.ts the only file thats different in tsc.js generation now that api has tests 2017-08-07 11:31:12 -07:00
Sheetal Nandi
c814d8e847 Add tests for the tsc --watch 2017-08-07 11:24:07 -07:00
Sheetal Nandi
85b9254a60 Refactor out the tsc logic into another file so we can use that to test it out 2017-08-07 11:24:06 -07:00
Sheetal Nandi
9b18f7b61c Use builder to emit the files from the tsc.js 2017-08-07 11:19:53 -07:00
Sheetal Nandi
ef5935b52c Initial refactoring so that watch from tsc follows the tsserver projects 2017-08-07 11:19:52 -07:00
Andy
bb34bce420 Set a high stack trace limit in command-line and server scenarios (#17464) 2017-08-02 12:40:39 -07:00
Daniel Rosenwasser
e8421827e0 Merge pull request #16600 from alexeagle/pretty2
Add missing newline in --pretty diagnostics formatter
2017-07-14 12:22:05 -07:00
Andrew Casey
569ecabb0a Address PR feedback
Make Program.getMissingFilePaths required

Assume getMissingFilePaths always returns a defined value

Make getMissingFilePaths internal

Replace nullable-bool with enum

Update type to reflect possibility of undefined

Use deepEqual to simplify tests

Make condition const

Don't bother cleaning up map before freeing it

Switch from foreach to for-of to simplify debugging

Use a Map, rather than a FileMap, to track open FileWatchers

Fix compilation errors

Introduce and consume arrayToSet

Fix lint warnings about misplaced braces

Delete incorrect comment

Delete from map during iteration

Eliminate unnecessary type annotations
2017-06-29 11:29:19 -07:00
Andrew Casey
4863ada22c Track missing files
1. Expose missing files from the `Program`.
2. In `tsc --watch` and `tsserver`, add file watchers to missing files.
3. When missing files are created, schedule compilation (tsc) or refresh
the containing projects (tsserver).
2017-06-29 10:39:31 -07:00
Alex Eagle
0123bd0e20 Add missing newline in --pretty diagnostics formatter
It was compensated in tsc.ts, but then other compilers are missing a newline.
2017-06-17 09:20:55 -07:00
Sheetal Nandi
09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Ron Buckton
4c65be8bad Enable debug info when running tests 2017-06-06 16:01:52 -07:00
Sheetal Nandi
7db76edbae Always return empty object when converting the json sourcefile into actual json object, allowing to continue compilation even if there are errors in the tsconfig files 2017-05-30 11:37:26 -07:00