Skip to content

Commit 77e96b6

Browse files
committed
Update LKG
1 parent ff643f2 commit 77e96b6

File tree

6 files changed

+1164
-1178
lines changed

6 files changed

+1164
-1178
lines changed

lib/tsc.js

Lines changed: 171 additions & 202 deletions
Large diffs are not rendered by default.

lib/tsserver.js

Lines changed: 197 additions & 226 deletions
Large diffs are not rendered by default.

lib/tsserverlibrary.js

Lines changed: 193 additions & 224 deletions
Large diffs are not rendered by default.

lib/typescript.js

Lines changed: 284 additions & 261 deletions
Large diffs are not rendered by default.

lib/typescriptServices.js

Lines changed: 284 additions & 261 deletions
Large diffs are not rendered by default.

lib/typingsInstaller.js

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,20 @@ var ts;
304304
return undefined;
305305
}
306306
ts.forEach = forEach;
307+
function findAncestor(node, callback) {
308+
while (node) {
309+
var result = callback(node);
310+
if (result === "quit") {
311+
return undefined;
312+
}
313+
else if (result) {
314+
return node;
315+
}
316+
node = node.parent;
317+
}
318+
return undefined;
319+
}
320+
ts.findAncestor = findAncestor;
307321
function zipWith(arrayA, arrayB, callback) {
308322
Debug.assert(arrayA.length === arrayB.length);
309323
for (var i = 0; i < arrayA.length; i++) {
@@ -2460,7 +2474,7 @@ var ts;
24602474
Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: { code: 1055, category: ts.DiagnosticCategory.Error, key: "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", message: "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value." },
24612475
Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", message: "Accessors are only available when targeting ECMAScript 5 and higher." },
24622476
An_async_function_or_method_must_have_a_valid_awaitable_return_type: { code: 1057, category: ts.DiagnosticCategory.Error, key: "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057", message: "An async function or method must have a valid awaitable return type." },
2463-
Type_used_as_operand_to_await_or_the_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "Type_used_as_operand_to_await_or_the_return_type_of_an_async_function_must_either_be_a_valid_promise_1058", message: "Type used as operand to 'await' or the return type of an async function must either be a valid promise or must not contain a callable 'then' member." },
2477+
The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1058, category: ts.DiagnosticCategory.Error, key: "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", message: "The return type of an async function must either be a valid promise or must not contain a callable 'then' member." },
24642478
A_promise_must_have_a_then_method: { code: 1059, category: ts.DiagnosticCategory.Error, key: "A_promise_must_have_a_then_method_1059", message: "A promise must have a 'then' method." },
24652479
The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: { code: 1060, category: ts.DiagnosticCategory.Error, key: "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", message: "The first parameter of the 'then' method of a promise must be a callback." },
24662480
Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum_member_must_have_initializer_1061", message: "Enum member must have initializer." },
@@ -2633,6 +2647,9 @@ var ts;
26332647
A_parameter_property_cannot_be_declared_using_a_rest_parameter: { code: 1317, category: ts.DiagnosticCategory.Error, key: "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", message: "A parameter property cannot be declared using a rest parameter." },
26342648
An_abstract_accessor_cannot_have_an_implementation: { code: 1318, category: ts.DiagnosticCategory.Error, key: "An_abstract_accessor_cannot_have_an_implementation_1318", message: "An abstract accessor cannot have an implementation." },
26352649
A_default_export_can_only_be_used_in_an_ECMAScript_style_module: { code: 1319, category: ts.DiagnosticCategory.Error, key: "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", message: "A default export can only be used in an ECMAScript-style module." },
2650+
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1320, category: ts.DiagnosticCategory.Error, key: "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", message: "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member." },
2651+
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1321, category: ts.DiagnosticCategory.Error, key: "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", message: "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member." },
2652+
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: { code: 1322, category: ts.DiagnosticCategory.Error, key: "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", message: "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member." },
26362653
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_2300", message: "Duplicate identifier '{0}'." },
26372654
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", message: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
26382655
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static_members_cannot_reference_class_type_parameters_2302", message: "Static members cannot reference class type parameters." },
@@ -3212,6 +3229,7 @@ var ts;
32123229
Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: { code: 6179, category: ts.DiagnosticCategory.Message, key: "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", message: "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'." },
32133230
Enable_all_strict_type_checking_options: { code: 6180, category: ts.DiagnosticCategory.Message, key: "Enable_all_strict_type_checking_options_6180", message: "Enable all strict type-checking options." },
32143231
List_of_language_service_plugins: { code: 6181, category: ts.DiagnosticCategory.Message, key: "List_of_language_service_plugins_6181", message: "List of language service plugins." },
3232+
Scoped_package_detected_looking_in_0: { code: 6182, category: ts.DiagnosticCategory.Message, key: "Scoped_package_detected_looking_in_0_6182", message: "Scoped package detected, looking in '{0}'" },
32153233
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." },
32163234
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." },
32173235
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." },
@@ -6657,7 +6675,7 @@ var ts;
66576675
}
66586676
directoryPathMap.set(parent, result);
66596677
current = parent;
6660-
if (current == commonPrefix) {
6678+
if (current === commonPrefix) {
66616679
break;
66626680
}
66636681
}
@@ -7079,8 +7097,21 @@ var ts;
70797097
}
70807098
nodeModulesAtTypesExists = false;
70817099
}
7082-
return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, moduleName, nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state);
7100+
return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, failedLookupLocations, state);
7101+
}
7102+
}
7103+
function mangleScopedPackage(moduleName, state) {
7104+
if (ts.startsWith(moduleName, "@")) {
7105+
var replaceSlash = moduleName.replace(ts.directorySeparator, "__");
7106+
if (replaceSlash !== moduleName) {
7107+
var mangled = replaceSlash.slice(1);
7108+
if (state.traceEnabled) {
7109+
trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);
7110+
}
7111+
return mangled;
7112+
}
70837113
}
7114+
return moduleName;
70847115
}
70857116
function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) {
70867117
var result = cache && cache.get(containingDirectory);
@@ -7558,7 +7589,7 @@ var ts;
75587589
return FileLog;
75597590
}());
75607591
function getNPMLocation(processName) {
7561-
if (path.basename(processName).indexOf("node") == 0) {
7592+
if (path.basename(processName).indexOf("node") === 0) {
75627593
return "\"" + path.join(path.dirname(process.argv[0]), "npm") + "\"";
75637594
}
75647595
else {

0 commit comments

Comments
 (0)