Skip to content

Commit eb41b21

Browse files
Merge pull request #456 from Microsoft/newLanguageService
Initial port of the new language service work.
2 parents 92e3202 + 9aee22b commit eb41b21

40 files changed

+1182
-993
lines changed

src/compiler/core.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,11 @@ module ts {
188188

189189
export var localizedDiagnosticMessages: Map<string> = undefined;
190190

191-
function getLocaleSpecificMessage(message: string) {
191+
export function getLocaleSpecificMessage(message: string) {
192192
if (ts.localizedDiagnosticMessages) {
193193
message = localizedDiagnosticMessages[message];
194194
}
195195

196-
/* Check to see that we got an actual value back. */
197-
Debug.assert(message, "Diagnostic message does not exist in locale map.");
198-
199196
return message;
200197
}
201198

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module ts {
111111
Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." },
112112
Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." },
113113
Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" },
114-
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
114+
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
115115
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
116116
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
117117
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -389,5 +389,6 @@ module ts {
389389
Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." },
390390
Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." },
391391
Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." },
392+
You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." },
392393
};
393394
}

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,6 @@
13551355
"category": "Error",
13561356
"code": 5039
13571357
},
1358-
13591358
"Concatenate and emit output to single file.": {
13601359
"category": "Message",
13611360
"code": 6001
@@ -1552,5 +1551,9 @@
15521551
"Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": {
15531552
"category": "Error",
15541553
"code": 7020
1554+
},
1555+
"You cannot rename this element.": {
1556+
"category": "Error",
1557+
"code": 8000
15551558
}
15561559
}

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module ts {
99
export function getNodeConstructor(kind: SyntaxKind): new () => Node {
1010
return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind));
1111
}
12-
12+
1313
function createRootNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags): Node {
1414
var node = new (getNodeConstructor(kind))();
1515
node.pos = pos;
@@ -443,7 +443,7 @@ module ts {
443443
nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext;
444444
}
445445

446-
export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: number = 0, isOpen: boolean = false): SourceFile {
446+
export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: string, isOpen: boolean = false): SourceFile {
447447
var file: SourceFile;
448448
var scanner: Scanner;
449449
var token: SyntaxKind;

src/compiler/tsc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ module ts {
142142
}
143143
text = "";
144144
}
145-
return text !== undefined ? createSourceFile(filename, text, languageVersion) : undefined;
145+
return text !== undefined ? createSourceFile(filename, text, languageVersion, /*version:*/ "0") : undefined;
146146
}
147147

148148
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) {

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ module ts {
535535
identifierCount: number;
536536
symbolCount: number;
537537
isOpen: boolean;
538-
version: number;
538+
version: string;
539539
languageVersion: ScriptTarget;
540540
}
541541

0 commit comments

Comments
 (0)