Skip to content

Commit eb5936b

Browse files
Merge branch 'master' into baseZero
Conflicts: src/harness/harnessLanguageService.ts
2 parents 990bbb2 + 5c1ef11 commit eb5936b

651 files changed

Lines changed: 13883 additions & 1544 deletions

File tree

Some content is hidden

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

Jakefile

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var child_process = require("child_process");
88
// Variables
99
var compilerDirectory = "src/compiler/";
1010
var servicesDirectory = "src/services/";
11+
var serverDirectory = "src/server/";
1112
var harnessDirectory = "src/harness/";
1213
var libraryDirectory = "src/lib/";
1314
var scriptsDirectory = "scripts/";
@@ -64,6 +65,7 @@ var servicesSources = [
6465
return path.join(compilerDirectory, f);
6566
}).concat([
6667
"breakpoints.ts",
68+
"navigateTo.ts",
6769
"navigationBar.ts",
6870
"outliningElementsCollector.ts",
6971
"services.ts",
@@ -90,6 +92,16 @@ var servicesSources = [
9092
return path.join(servicesDirectory, f);
9193
}));
9294

95+
var serverSources = [
96+
"node.d.ts",
97+
"editorServices.ts",
98+
"protocol.d.ts",
99+
"session.ts",
100+
"server.ts"
101+
].map(function (f) {
102+
return path.join(serverDirectory, f);
103+
});
104+
93105
var definitionsRoots = [
94106
"compiler/types.d.ts",
95107
"compiler/scanner.d.ts",
@@ -130,6 +142,13 @@ var harnessSources = [
130142
"services/preProcessFile.ts"
131143
].map(function (f) {
132144
return path.join(unittestsDirectory, f);
145+
})).concat([
146+
"protocol.d.ts",
147+
"session.ts",
148+
"client.ts",
149+
"editorServices.ts",
150+
].map(function (f) {
151+
return path.join(serverDirectory, f);
133152
}));
134153

135154
var librarySourceMap = [
@@ -327,6 +346,7 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
327346
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
328347

329348
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
349+
var nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
330350
compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources),
331351
/*prefixes*/ [copyright],
332352
/*useBuiltCompiler*/ true,
@@ -336,7 +356,10 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
336356
/*preserveConstEnums*/ true,
337357
/*keepComments*/ false,
338358
/*noResolve*/ false,
339-
/*stripInternal*/ false);
359+
/*stripInternal*/ false,
360+
/*callback*/ function () {
361+
jake.cpR(servicesFile, nodePackageFile, {silent: true});
362+
});
340363

341364
var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
342365
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
@@ -378,9 +401,12 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
378401
jake.rmRf(tempDirPath, {silent: true});
379402
});
380403

404+
var serverFile = path.join(builtLocalDirectory, "tsserver.js");
405+
compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true);
406+
381407
// Local target to build the compiler and services
382408
desc("Builds the full compiler and services");
383-
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile]);
409+
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile]);
384410

385411
// Local target to build only tsc.js
386412
desc("Builds only the compiler");
@@ -435,7 +461,7 @@ task("generate-spec", [specMd])
435461
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
436462
desc("Makes a new LKG out of the built js files");
437463
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
438-
var expectedFiles = [tscFile, servicesFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
464+
var expectedFiles = [tscFile, servicesFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
439465
var missingFiles = expectedFiles.filter(function (f) {
440466
return !fs.existsSync(f);
441467
});
@@ -542,7 +568,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
542568
}
543569

544570
if (tests && tests.toLocaleLowerCase() === "rwc") {
545-
testTimeout = 50000;
571+
testTimeout = 100000;
546572
}
547573

548574
colors = process.env.colors || process.env.color

bin/tsserver

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('./tsserver.js')

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
"url": "https://github.com/Microsoft/TypeScript.git"
2626
},
2727
"preferGlobal": true,
28-
"main": "./bin/typescriptServices.js",
28+
"main": "./bin/typescript.js",
2929
"bin": {
30-
"tsc": "./bin/tsc"
30+
"tsc": "./bin/tsc",
31+
"tsserver": "./bin/tsserver"
3132
},
3233
"engines": {
3334
"node": ">=0.8.0"

src/compiler/binder.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ module ts {
5151
}
5252
}
5353

54-
/**
55-
* A declaration has a dynamic name if both of the following are true:
56-
* 1. The declaration has a computed property name
57-
* 2. The computed name is *not* expressed as Symbol.<name>, where name
58-
* is a property of the Symbol constructor that denotes a built in
59-
* Symbol.
60-
*/
61-
export function hasDynamicName(declaration: Declaration): boolean {
62-
return declaration.name && declaration.name.kind === SyntaxKind.ComputedPropertyName;
63-
}
64-
6554
export function bindSourceFile(file: SourceFile): void {
6655
var start = new Date().getTime();
6756
bindSourceFileWorker(file);
@@ -98,13 +87,18 @@ module ts {
9887
if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node;
9988
}
10089

101-
// Should not be called on a declaration with a computed property name.
90+
// Should not be called on a declaration with a computed property name,
91+
// unless it is a well known Symbol.
10292
function getDeclarationName(node: Declaration): string {
10393
if (node.name) {
10494
if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) {
10595
return '"' + (<LiteralExpression>node.name).text + '"';
10696
}
107-
Debug.assert(!hasDynamicName(node));
97+
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
98+
var nameExpression = (<ComputedPropertyName>node.name).expression;
99+
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
100+
return getPropertyNameForKnownSymbolName((<PropertyAccessExpression>nameExpression).name.text);
101+
}
108102
return (<Identifier | LiteralExpression>node.name).text;
109103
}
110104
switch (node.kind) {
@@ -495,6 +489,7 @@ module ts {
495489
case SyntaxKind.CatchClause:
496490
case SyntaxKind.ForStatement:
497491
case SyntaxKind.ForInStatement:
492+
case SyntaxKind.ForOfStatement:
498493
case SyntaxKind.SwitchStatement:
499494
bindChildren(node, 0, /*isBlockScopeContainer*/ true);
500495
break;

0 commit comments

Comments
 (0)