Skip to content

Commit d65d9b2

Browse files
merge master
2 parents 5252cd9 + e54828f commit d65d9b2

File tree

251 files changed

+28306
-8546
lines changed

Some content is hidden

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

251 files changed

+28306
-8546
lines changed

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Jakefile.js
1616
.gitattributes
1717
.settings/
1818
.travis.yml
19-
.vscode/
19+
.vscode/
20+
test.config

.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

Gulpfile.ts

Lines changed: 14 additions & 4 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]);
@@ -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: 16 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",
@@ -140,6 +142,7 @@ var harnessSources = harnessCoreSources.concat([
140142
"transform.ts",
141143
"customTransforms.ts",
142144
"programMissingFiles.ts",
145+
"symbolWalker.ts",
143146
].map(function (f) {
144147
return path.join(unittestsDirectory, f);
145148
})).concat([
@@ -423,6 +426,7 @@ var buildProtocolTs = path.join(scriptsDirectory, "buildProtocol.ts");
423426
var buildProtocolJs = path.join(scriptsDirectory, "buildProtocol.js");
424427
var buildProtocolDts = path.join(builtLocalDirectory, "protocol.d.ts");
425428
var typescriptServicesDts = path.join(builtLocalDirectory, "typescriptServices.d.ts");
429+
var typesMapJson = path.join(builtLocalDirectory, "typesMap.json");
426430

427431
file(buildProtocolTs);
428432

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

610624
// Local target to build the language service server library
611625
desc("Builds language service server library");
612-
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
626+
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile, typesMapOutputPath]);
613627

614628
desc("Emit the start of the build fold");
615629
task("build-fold-start", [], function () {
@@ -638,7 +652,6 @@ task("release", function () {
638652
// Set the default task to "local"
639653
task("default", ["local"]);
640654

641-
642655
// Cleans the built directory
643656
desc("Cleans the compiler output, declare files, and tests");
644657
task("clean", function () {
@@ -1086,7 +1099,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
10861099

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

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

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)