Skip to content

Commit fdb104b

Browse files
committed
Merge branch 'master' into watchImprovements
2 parents 5739b68 + eb80799 commit fdb104b

File tree

600 files changed

+34125
-16019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+34125
-16019
lines changed

.mailmap

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Andy Hanson <[email protected]> Andy <[email protected]>
1717
Anil Anar <[email protected]>
1818
Anton Tolmachev <[email protected]>
1919
Anubha Mathur <[email protected]> anubmat <[email protected]>
20+
Armando Aguirre <[email protected]>
21+
Arnaud Tournier <[email protected]>
2022
Arnavion <[email protected]> # Arnav Singh
2123
Arthur Ozga <[email protected]> Arthur Ozga <[email protected]> Arthur Ozga <[email protected]> Arthur Ozga <[email protected]> Arthur Ozga <[email protected]>
2224
Asad Saeeduddin <[email protected]>
@@ -26,6 +28,7 @@ Bill Ticehurst <[email protected]> Bill Ticehurst <[email protected]>
2628
Ben Duffield <[email protected]>
2729
Ben Mosher <[email protected]>
2830
Benjamin Bock <[email protected]>
31+
Benjamin Lichtman <[email protected]> uniqueiniquity <[email protected]>
2932
Blake Embrey <[email protected]>
3033
Bowden Kelly <[email protected]>
3134
Brett Mayen <[email protected]>
@@ -59,6 +62,7 @@ Evan Sebastian <[email protected]>
5962
Eyas <[email protected]> # Eyas Sharaiha
6063
Fabian Cook <[email protected]>
6164
falsandtru <[email protected]> # @falsandtru
65+
Filipe Silva <[email protected]>
6266
flowmemo <[email protected]> # @flowmemo
6367
Frank Wallis <[email protected]>
6468
František Žiacik <[email protected]> František Žiacik <[email protected]>
@@ -192,7 +196,7 @@ TruongSinh Tran-Nguyen <[email protected]>
192196
vilicvane <[email protected]> # Vilic Vane
193197
Vladimir Matveev <[email protected]> vladima <[email protected]> v2m <[email protected]>
194198
Vadi Taslim <[email protected]>
195-
Wesley Wigham <[email protected]> Wesley Wigham <[email protected]>
199+
Wesley Wigham <[email protected]> Wesley Wigham <[email protected]> Wesley Wigham <[email protected]>
196200
197201
Yuichi Nukiyama <[email protected]> YuichiNukiyama <[email protected]>
198202
Zev Spitz <[email protected]>
@@ -267,4 +271,9 @@ Reiner Dolp <[email protected]>
267271
268272
TravCav <[email protected]> # @TravCav
269273
Vladimir Kurchatkin <[email protected]>
270-
William Orr <[email protected]>
274+
William Orr <[email protected]>
275+
Francois Wouts <[email protected]>
276+
Jan Melcher <[email protected]> Jan Melcher <[email protected]>
277+
Matt Mitchell <[email protected]>
278+
Maxwell Paul Brickner <[email protected]>
279+
Tycho Grouwstra <[email protected]>

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ matrix:
1616
branches:
1717
only:
1818
- master
19+
- release-2.5
1920

2021
install:
2122
- npm uninstall typescript --no-save

AUTHORS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ TypeScript is authored by:
2525
* Anton Khlynovskiy
2626
* Anton Tolmachev
2727
* Anubha Mathur
28+
* Armando Aguirre
29+
* Arnaud Tournier
2830
* Arnav Singh
2931
* Arthur Ozga
3032
* Asad Saeeduddin
@@ -33,6 +35,7 @@ TypeScript is authored by:
3335
* Ben Duffield
3436
* Ben Mosher
3537
* Benjamin Bock
38+
* Benjamin Lichtman
3639
* Benny Neugebauer
3740
* Bill Ticehurst
3841
* Blaine Bublitz
@@ -85,7 +88,9 @@ TypeScript is authored by:
8588
* Eyas Sharaiha
8689
* Fabian Cook
8790
* @falsandtru
91+
* Filipe Silva
8892
* @flowmemo
93+
* Francois Wouts
8994
* Frank Wallis
9095
* Franklin Tse
9196
* František Žiacik
@@ -112,6 +117,7 @@ TypeScript is authored by:
112117
* Jakub Młokosiewicz
113118
* James Henry
114119
* James Whitney
120+
* Jan Melcher
115121
* Jason Freeman
116122
* Jason Jarrett
117123
* Jason Killian
@@ -162,9 +168,11 @@ TypeScript is authored by:
162168
* Masahiro Wakame
163169
* Matt Bierner
164170
* Matt McCutchen
171+
* Matt Mitchell
165172
* Mattias Buelens
166173
* Mattias Buelens
167174
* Max Deepfield
175+
* Maxwell Paul Brickner
168176
* Micah Zoltu
169177
* Michael
170178
* Michael Bromley
@@ -243,6 +251,7 @@ TypeScript is authored by:
243251
* Torben Fitschen
244252
* @TravCav
245253
* TruongSinh Tran-Nguyen
254+
* Tycho Grouwstra
246255
* Vadi Taslim
247256
* Vidar Tonaas Fauske
248257
* Viktor Zozulyak

Gulpfile.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,11 @@ gulp.task(serverFile, /*help*/ false, [servicesFile, typingsInstallerJs, cancell
463463
.pipe(gulp.dest("src/server"));
464464
});
465465

466+
const typesMapJson = path.join(builtLocalDirectory, "typesMap.json");
466467
const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
467468
const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
468469

469-
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
470+
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (done) => {
470471
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({}, /*useBuiltCompiler*/ true));
471472
const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src()
472473
.pipe(sourcemaps.init())
@@ -485,6 +486,15 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
485486
]);
486487
});
487488

489+
gulp.task(typesMapJson, /*help*/ false, [], () => {
490+
return gulp.src("src/server/typesMap.json")
491+
.pipe(insert.transform((contents, file) => {
492+
JSON.parse(contents);
493+
return contents;
494+
}))
495+
.pipe(gulp.dest(builtLocalDirectory));
496+
});
497+
488498
gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile]);
489499
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
490500
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);
@@ -776,7 +786,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
776786
const file = new Vinyl({ contents, path: bundlePath });
777787
console.log(`Fixing sourcemaps for ${file.path}`);
778788
// assumes contents is a Buffer, since that's what browserify yields
779-
const maps = convertMap.fromSource(stringContent, /*largeSource*/ true).toObject();
789+
const maps = convertMap.fromSource(stringContent).toObject();
780790
delete maps.sourceRoot;
781791
maps.sources = maps.sources.map(s => path.resolve(s === "_stream_0.js" ? "built/local/_stream_0.js" : s));
782792
// Strip browserify's inline comments away (could probably just let sorcery do this, but then we couldn't fix the paths)
@@ -968,7 +978,7 @@ const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
968978
const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
969979
gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
970980
const settings: tsc.Settings = getCompilerSettings({
971-
outFile: instrumenterJsPath,
981+
module: "commonjs",
972982
target: "es5",
973983
lib: [
974984
"es6",
@@ -980,8 +990,8 @@ gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
980990
.pipe(newer(instrumenterJsPath))
981991
.pipe(sourcemaps.init())
982992
.pipe(tsc(settings))
983-
.pipe(sourcemaps.write("."))
984-
.pipe(gulp.dest("."));
993+
.pipe(sourcemaps.write(builtLocalDirectory))
994+
.pipe(gulp.dest(builtLocalDirectory));
985995
});
986996

987997
gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {

Jakefile.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/t
8888
var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json"))
8989
var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json"));
9090

91+
var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json');
92+
9193
var harnessCoreSources = [
9294
"harness.ts",
9395
"virtualFileSystem.ts",
@@ -141,6 +143,8 @@ var harnessSources = harnessCoreSources.concat([
141143
"transform.ts",
142144
"customTransforms.ts",
143145
"programMissingFiles.ts",
146+
"symbolWalker.ts",
147+
"languageService.ts",
144148
].map(function (f) {
145149
return path.join(unittestsDirectory, f);
146150
})).concat([
@@ -423,6 +427,7 @@ var buildProtocolTs = path.join(scriptsDirectory, "buildProtocol.ts");
423427
var buildProtocolJs = path.join(scriptsDirectory, "buildProtocol.js");
424428
var buildProtocolDts = path.join(builtLocalDirectory, "protocol.d.ts");
425429
var typescriptServicesDts = path.join(builtLocalDirectory, "typescriptServices.d.ts");
430+
var typesMapJson = path.join(builtLocalDirectory, "typesMap.json");
426431

427432
file(buildProtocolTs);
428433

@@ -587,6 +592,16 @@ var serverFile = path.join(builtLocalDirectory, "tsserver.js");
587592
compileFile(serverFile, serverSources, [builtLocalDirectory, copyright, cancellationTokenFile, typingsInstallerFile, watchGuardFile].concat(serverSources).concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, { types: ["node"], preserveConstEnums: true, lib: "es6" });
588593
var tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
589594
var tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
595+
file(typesMapOutputPath, function() {
596+
var content = fs.readFileSync(path.join(serverDirectory, 'typesMap.json'));
597+
// Validate that it's valid JSON
598+
try {
599+
JSON.parse(content);
600+
} catch (e) {
601+
console.log("Parse error in typesMap.json: " + e);
602+
}
603+
fs.writeFileSync(typesMapOutputPath, content);
604+
});
590605
compileFile(
591606
tsserverLibraryFile,
592607
languageServiceLibrarySources,
@@ -609,7 +624,7 @@ compileFile(
609624

610625
// Local target to build the language service server library
611626
desc("Builds language service server library");
612-
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
627+
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile, typesMapOutputPath]);
613628

614629
desc("Emit the start of the build fold");
615630
task("build-fold-start", [], function () {
@@ -638,7 +653,6 @@ task("release", function () {
638653
// Set the default task to "local"
639654
task("default", ["local"]);
640655

641-
642656
// Cleans the built directory
643657
desc("Cleans the compiler output, declare files, and tests");
644658
task("clean", function () {
@@ -1086,7 +1100,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
10861100

10871101
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
10881102
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
1089-
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"] });
1103+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true, { lib: "es6", types: ["node"], noOutFile: true, outDir: builtLocalDirectory });
10901104

10911105
desc("Builds an instrumented tsc.js");
10921106
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function () {

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
For the latest stable version:
1414

15-
```
15+
```bash
1616
npm install -g typescript
1717
```
1818

1919
For our nightly builds:
2020

21-
```
21+
```bash
2222
npm install -g typescript@next
2323
```
2424

@@ -50,19 +50,19 @@ In order to build the TypeScript compiler, ensure that you have [Git](https://gi
5050

5151
Clone a copy of the repo:
5252

53-
```
53+
```bash
5454
git clone https://github.com/Microsoft/TypeScript.git
5555
```
5656

5757
Change to the TypeScript directory:
5858

59-
```
59+
```bash
6060
cd TypeScript
6161
```
6262

6363
Install Gulp tools and dev dependencies:
6464

65-
```
65+
```bash
6666
npm install -g gulp
6767
npm install
6868
```
@@ -88,7 +88,7 @@ gulp help # List the above commands.
8888

8989
## Usage
9090

91-
```shell
91+
```bash
9292
node built/local/tsc.js hello.ts
9393
```
9494

lib/cancellationToken.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/lib.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ interface ObjectConstructor {
236236
* Returns the names of the enumerable properties and methods of an object.
237237
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
238238
*/
239-
keys(o: any): string[];
239+
keys(o: {}): string[];
240240
}
241241

242242
/**
@@ -1000,12 +1000,12 @@ interface ReadonlyArray<T> {
10001000
* Combines two or more arrays.
10011001
* @param items Additional items to add to the end of array1.
10021002
*/
1003-
concat(...items: T[][]): T[];
1003+
concat(...items: ReadonlyArray<T>[]): T[];
10041004
/**
10051005
* Combines two or more arrays.
10061006
* @param items Additional items to add to the end of array1.
10071007
*/
1008-
concat(...items: (T | T[])[]): T[];
1008+
concat(...items: (T | ReadonlyArray<T>)[]): T[];
10091009
/**
10101010
* Adds all the elements of an array separated by the specified separator string.
10111011
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -1119,12 +1119,12 @@ interface Array<T> {
11191119
* Combines two or more arrays.
11201120
* @param items Additional items to add to the end of array1.
11211121
*/
1122-
concat(...items: T[][]): T[];
1122+
concat(...items: ReadonlyArray<T>[]): T[];
11231123
/**
11241124
* Combines two or more arrays.
11251125
* @param items Additional items to add to the end of array1.
11261126
*/
1127-
concat(...items: (T | T[])[]): T[];
1127+
concat(...items: (T | ReadonlyArray<T>)[]): T[];
11281128
/**
11291129
* Adds all the elements of an array separated by the specified separator string.
11301130
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

lib/lib.es2015.symbol.wellknown.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ interface Map<K, V> {
130130
readonly [Symbol.toStringTag]: "Map";
131131
}
132132

133-
interface WeakMap<K extends object, V>{
133+
interface WeakMap<K extends object, V> {
134134
readonly [Symbol.toStringTag]: "WeakMap";
135135
}
136136

0 commit comments

Comments
 (0)