Merge branch 'master' into factory-export-default

This commit is contained in:
Klaus Meinhardt
2018-07-06 08:40:12 +02:00
156 changed files with 36161 additions and 29339 deletions
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Deklarace oboru názvů nemůže být umístěná před třídou nebo funkcí, se kterou se slučuje.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Deklarace oboru názvů je povolená jenom v oboru názvů nebo v modulu.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Import stylu oboru názvů není možné vyvolat nebo konstruovat a způsobí selhání za běhu.",
"A_non_dry_build_would_build_project_0_6357": "Build nedodržující princip DRY by vytvořil projekt {0}.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Build nedodržující princip DRY by odstranil následující soubory: {0}",
"A_non_dry_build_would_build_project_0_6357": "Build bez příznaku -dry by vytvořil projekt {0}.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Build bez příznaku -dry by odstranil následující soubory: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Inicializátor parametru je povolený jenom v implementaci funkce nebo konstruktoru.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Vlastnost parametru se nedá deklarovat pomocí parametru rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Vlastnost parametru je povolená jenom v implementaci konstruktoru.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Eine Namespacedeklaration darf nicht vor der Klasse oder Funktion positioniert werden, mit der sie zusammengeführt wird.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Eine Namespacedeklaration ist nur in einem Namespace oder Modul zulässig.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Ein Import im Namespacestil kann nicht aufgerufen oder erstellt werden und verursacht zur Laufzeit einen Fehler.",
"A_non_dry_build_would_build_project_0_6357": "Bei einem echten Build würde das Projekt \"{0}\" erstellt.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Bei einem echten Build würden die folgenden Dateien gelöscht: {0}",
"A_non_dry_build_would_build_project_0_6357": "Bei einem Build mit dem Flag \"-dry\" würde das Projekt \"{0}\" erstellt.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Bei einem Build mit dem Flag \"-dry\" würden die folgenden Dateien gelöscht: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Ein Parameterinitialisierer ist nur in einer Funktions- oder Konstruktorimplementierung zulässig.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Eine Parametereigenschaft darf nicht mithilfe eines rest-Parameters deklariert werden.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Eine Parametereigenschaft ist nur in einer Konstruktorimplementierung zulässig.",
+122 -8
View File
@@ -363,6 +363,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_required_element_cannot_follow_an_optional_element_1257" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A required element cannot follow an optional element.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_required_parameter_cannot_follow_an_optional_parameter_1016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A required parameter cannot follow an optional parameter.]]></Val>
@@ -393,6 +399,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_rest_element_must_be_last_in_a_tuple_type_1256" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest element must be last in a tuple type.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_rest_element_type_must_be_an_array_type_2574" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest element type must be an array type.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_rest_parameter_cannot_be_optional_1047" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest parameter cannot be optional.]]></Val>
@@ -495,12 +513,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_tuple_type_element_list_cannot_be_empty_1122" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A tuple type element list cannot be empty.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
@@ -603,6 +615,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_imports_95064" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing imports]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_members_95022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing members]]></Val>
@@ -657,6 +675,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_enum_member_0_95063" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing enum member '{0}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call]]></Val>
@@ -1683,6 +1707,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Conflicts_are_in_this_file_6201" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Conflicts are in this file.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
@@ -1743,6 +1773,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_default_export_to_named_export_95061" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert default export to named export]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_function_0_to_class_95002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert function '{0}' to class]]></Val>
@@ -1755,6 +1791,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_export_to_default_export_95062" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named export to default export]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -1869,6 +1911,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_declarations_95024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused declarations]]></Val>
@@ -2805,6 +2853,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{0}`]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message]]></Val>
@@ -3405,9 +3459,9 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_1340" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here.]]></Val>
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4203,6 +4257,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_is_incompatible_with_rest_element_type_2573" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' is incompatible with rest element type.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_is_missing_in_type_1_2324" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' is missing in type '{1}'.]]></Val>
@@ -4257,6 +4317,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_is_used_before_its_initialization_2729" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' is used before its initialization.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' of JSX spread attribute is not assignable to target property.]]></Val>
@@ -4593,6 +4659,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rest_signatures_are_incompatible_2572" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rest signatures are incompatible.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rest_types_may_only_be_created_from_object_types_2700" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rest types may only be created from object types.]]></Val>
@@ -5109,6 +5181,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The expected type comes from property '{0}' which is declared here on type '{1}']]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";The_expected_type_comes_from_this_index_signature_6501" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The expected type comes from this index signature.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The expression of an export assignment must be an identifier or qualified name in an ambient context.]]></Val>
@@ -5355,6 +5439,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";This_constructor_function_may_be_converted_to_a_class_declaration_80002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[This constructor function may be converted to a class declaration.]]></Val>
@@ -5619,6 +5709,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type of computed property's value is '{0}', which is not assignable to type '{1}'.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
@@ -6177,6 +6273,18 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";_0_was_also_declared_here_6203" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['{0}' was also declared here.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";_0_was_declared_here_2728" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['{0}' was declared here.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['{0}', which lacks return-type annotation, implicitly has an '{1}' return type.]]></Val>
@@ -6189,6 +6297,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";and_here_6204" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[and here.]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";await_expression_is_only_allowed_within_an_async_function_1308" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['await' expression is only allowed within an async function.]]></Val>
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Una declaración de espacio de nombres no se puede situar antes que una clase o función con la que se combina.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Una declaración de espacio de nombres solo se permite en un espacio de nombres o en un módulo.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "No se puede llamar o construir una importación de estilo de espacio de nombres, y provocará un error en tiempo de ejecución.",
"A_non_dry_build_would_build_project_0_6357": "Una compilación no DRY compilaría el proyecto \"{0}\"",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Una compilación no DRY eliminaría los siguientes archivos: {0}",
"A_non_dry_build_would_build_project_0_6357": "Una compilación no -dry compilaría el proyecto \"{0}\"",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Una compilación no -dry eliminaría los archivos siguientes: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un inicializador de parámetros solo se permite en una implementación de función o de constructor.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Una propiedad de parámetro no se puede declarar mediante un parámetro rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Una propiedad de parámetro solo se permite en una implementación de constructor.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Une déclaration d'espace de noms ne peut pas se trouver avant une classe ou une fonction avec laquelle elle est fusionnée.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Une déclaration d'espace de noms est autorisée uniquement dans un espace de noms ou un module.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Impossible d'appeler ou de construire une importation de style d'espace de noms, ce qui va entraîner un échec au moment de l'exécution.",
"A_non_dry_build_would_build_project_0_6357": "Une build non-DRY générerait le projet '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Une build non-DRY supprimerait les fichiers suivants : {0}",
"A_non_dry_build_would_build_project_0_6357": "Une build non-dry va générer le projet '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Une build non-dry va supprimer les fichiers suivants : {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un initialiseur de paramètre est uniquement autorisé dans une implémentation de fonction ou de constructeur.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Impossible de déclarer une propriété de paramètre à l'aide d'un paramètre rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Une propriété de paramètre est uniquement autorisée dans une implémentation de constructeur.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Una dichiarazione di spazio dei nomi non può essere specificata prima di una classe o funzione con cui è stato eseguito il merge.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Una dichiarazione di spazio dei nomi è consentita solo in uno spazio dei nomi o in un modulo.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Non è possibile chiamare o costruire un'importazione in stile spazio dei nomi. Questo comporterà un errore in fase di runtime.",
"A_non_dry_build_would_build_project_0_6357": "Se si esegue una compilazione non di prova, verrà compilato il progetto '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Se si esegue una compilazione non di prova, i file seguenti verranno eliminati: {0}",
"A_non_dry_build_would_build_project_0_6357": "Se si esegue una compilazione senza flag -dry, verrà compilato il progetto '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Se si esegue una compilazione senza flag -dry, i file seguenti verranno eliminati: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un inizializzatore di parametro è consentito solo in un'implementazione di funzione o costruttore.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Non è possibile dichiarare una proprietà di parametro usando un parametro REST.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Una proprietà di parametro è consentita solo in un'implementazione di costruttore.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "名前空間宣言は、それとマージするクラスや関数より前に配置できません。",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "名前空間宣言は、名前空間かモジュールでのみ使用できます。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "名前空間スタイルのインポートを呼び出したり、構築したりすることはできません。実行時にエラーが発生する原因となります。",
"A_non_dry_build_would_build_project_0_6357": "非ドライ ビルドはプロジェクト '{0}' ビルドます",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非ドライ ビルドは、次のファイル削除ます: {0}",
"A_non_dry_build_would_build_project_0_6357": "非 -dry ビルドを実行した場合、プロジェクト '{0}' ビルドされます",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非 -dry ビルドを実行した場合、次のファイル削除されます: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "パラメーター初期化子は、関数またはコンストラクターの実装でのみ指定できます。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "パラメーター プロパティは、rest パラメーターを使用して宣言することはできません。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "パラメーター プロパティは、コンストラクターの実装でのみ指定できます。",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "네임스페이스 선언은 해당 선언이 병합된 클래스나 함수 앞에 있을 수 없습니다.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "네임스페이스 선언은 네임스페이스 또는 모듈에서만 사용할 수 있습니다.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "네임스페이스 스타일 가져오기를 호출하거나 생성할 수 없으며 런타임 시 오류가 발생합니다.",
"A_non_dry_build_would_build_project_0_6357": "DRY가 아닌 빌드는 프로젝트 '{0}'을(를) 빌드합니다.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "DRY가 아닌 빌드는 다음 파일을 삭제합니다. {0}",
"A_non_dry_build_would_build_project_0_6357": "-dry가 아닌 빌드는 프로젝트 '{0}'을(를) 빌드합니다.",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "-dry가 아닌 빌드는 다음 파일을 삭제합니다. {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "매개 변수 이니셜라이저는 함수 또는 생성자 구현에서만 허용됩니다.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "rest 매개 변수를 사용하여 매개 변수 속성을 선언할 수 없습니다.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "매개 변수 속성은 생성자 구현에서만 허용됩니다.",
+4 -8
View File
@@ -29,8 +29,7 @@ interface Map<K, V> {
}
interface MapConstructor {
new (): Map<any, any>;
new <K, V>(entries?: ReadonlyArray<[K, V]> | null): Map<K, V>;
new <K = any, V = any>(entries?: ReadonlyArray<[K, V]> | null): Map<K, V>;
readonly prototype: Map<any, any>;
}
declare var Map: MapConstructor;
@@ -50,8 +49,7 @@ interface WeakMap<K extends object, V> {
}
interface WeakMapConstructor {
new (): WeakMap<object, any>;
new <K extends object, V>(entries?: ReadonlyArray<[K, V]> | null): WeakMap<K, V>;
new <K extends object = object, V = any>(entries?: ReadonlyArray<[K, V]> | null): WeakMap<K, V>;
readonly prototype: WeakMap<object, any>;
}
declare var WeakMap: WeakMapConstructor;
@@ -66,8 +64,7 @@ interface Set<T> {
}
interface SetConstructor {
new (): Set<any>;
new <T>(values?: ReadonlyArray<T> | null): Set<T>;
new <T = any>(values?: ReadonlyArray<T> | null): Set<T>;
readonly prototype: Set<any>;
}
declare var Set: SetConstructor;
@@ -85,8 +82,7 @@ interface WeakSet<T extends object> {
}
interface WeakSetConstructor {
new (): WeakSet<object>;
new <T extends object>(values?: ReadonlyArray<T> | null): WeakSet<T>;
new <T extends object = object>(values?: ReadonlyArray<T> | null): WeakSet<T>;
readonly prototype: WeakSet<object>;
}
declare var WeakSet: WeakSetConstructor;
+2 -2
View File
@@ -155,7 +155,7 @@ interface MapConstructor {
interface WeakMap<K extends object, V> { }
interface WeakMapConstructor {
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
new <K extends object = object, V = any>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
}
interface Set<T> {
@@ -203,7 +203,7 @@ interface SetConstructor {
interface WeakSet<T extends object> { }
interface WeakSetConstructor {
new <T extends object>(iterable: Iterable<T>): WeakSet<T>;
new <T extends object = object>(iterable: Iterable<T>): WeakSet<T>;
}
interface Promise<T> { }
+1
View File
@@ -22,3 +22,4 @@ and limitations under the License.
/// <reference lib="esnext.asynciterable" />
/// <reference lib="esnext.array" />
/// <reference lib="esnext.symbol" />
/// <reference lib="esnext.intl" />
+32
View File
@@ -0,0 +1,32 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
declare namespace Intl {
type NumberFormatPartTypes = "currency" | "decimal" | "fraction" | "group" | "infinity" | "integer" | "literal" | "minusSign" | "nan" | "plusSign" | "percentSign";
interface NumberFormatPart {
type: NumberFormatPartTypes;
value: string;
}
interface NumberFormat {
formatToParts(number?: number): NumberFormatPart[];
}
}
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Deklaracja przestrzeni nazw nie może występować przed klasą lub funkcją, z którą ją scalono.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Deklaracja przestrzeni nazw jest dozwolona tylko w przestrzeni nazw lub module.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Nie można wywołać lub skonstruować importu stylu przestrzeni nazw. Spowoduje to błąd w czasie wykonania.",
"A_non_dry_build_would_build_project_0_6357": "Kompilacja inna niż DRY spowodowałaby skompilowanie projektu „{0}”",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Kompilacja inna niż DRY spowodowałaby usunięcie następujących plików: {0}",
"A_non_dry_build_would_build_project_0_6357": "Kompilacja inna niż -dry spowodowałaby skompilowanie projektu „{0}”",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Kompilacja inna niż -dry spowodowałaby usunięcie następujących plików: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Inicjator parametru jest dozwolony tylko w implementacji funkcji lub konstruktora.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Właściwości parametru nie można zadeklarować za pomocą parametru rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Właściwość parametru jest dozwolona tylko w implementacji konstruktora.",
+69 -19
View File
@@ -9,7 +9,9 @@ declare namespace ts.server.protocol {
GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
Change = "change",
Close = "close",
/** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
Completions = "completions",
CompletionInfo = "completionInfo",
CompletionDetails = "completionEntryDetails",
CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList",
CompileOnSaveEmitFile = "compileOnSaveEmitFile",
@@ -464,7 +466,8 @@ declare namespace ts.server.protocol {
command: CommandTypes.GetEditsForFileRename;
arguments: GetEditsForFileRenameRequestArgs;
}
interface GetEditsForFileRenameRequestArgs extends FileRequestArgs {
/** Note: Paths may also be directories. */
interface GetEditsForFileRenameRequestArgs {
readonly oldFilePath: string;
readonly newFilePath: string;
}
@@ -1343,6 +1346,10 @@ declare namespace ts.server.protocol {
* Optional prefix to apply to possible completions.
*/
prefix?: string;
/**
* Character that was responsible for triggering completion.
* Should be `undefined` if a user manually requested completion.
*/
triggerCharacter?: CompletionsTriggerCharacter;
/**
* @deprecated Use UserPreferences.includeCompletionsForModuleExports
@@ -1485,9 +1492,19 @@ declare namespace ts.server.protocol {
*/
source?: SymbolDisplayPart[];
}
/** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
interface CompletionsResponse extends Response {
body?: CompletionEntry[];
}
interface CompletionInfoResponse extends Response {
body?: CompletionInfo;
}
interface CompletionInfo {
readonly isGlobalCompletion: boolean;
readonly isMemberCompletion: boolean;
readonly isNewIdentifierLocation: boolean;
readonly entries: ReadonlyArray<CompletionEntry>;
}
interface CompletionDetailsResponse extends Response {
body?: CompletionEntryDetails[];
}
@@ -1570,10 +1587,50 @@ declare namespace ts.server.protocol {
*/
argumentCount: number;
}
type SignatureHelpTriggerCharacter = "," | "(" | "<";
type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
/**
* Arguments of a signature help request.
*/
interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
/**
* Reason why signature help was invoked.
* See each individual possible
*/
triggerReason?: SignatureHelpTriggerReason;
}
type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
/**
* Signals that the user manually requested signature help.
* The language service will unconditionally attempt to provide a result.
*/
interface SignatureHelpInvokedReason {
kind: "invoked";
triggerCharacter?: undefined;
}
/**
* Signals that the signature help request came from a user typing a character.
* Depending on the character and the syntactic context, the request may or may not be served a result.
*/
interface SignatureHelpCharacterTypedReason {
kind: "characterTyped";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter: SignatureHelpTriggerCharacter;
}
/**
* Signals that this signature help request came from typing a character or moving the cursor.
* This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
* The language service will unconditionally attempt to provide a result.
* `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
*/
interface SignatureHelpRetriggeredReason {
kind: "retrigger";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter?: SignatureHelpRetriggerCharacter;
}
/**
* Signature help request; value of command field is "signatureHelp".
@@ -1733,11 +1790,16 @@ declare namespace ts.server.protocol {
}
/**
* Represents additional spans returned with a diagnostic which are relevant to it
* Like DiagnosticWithLinePosition, this is provided in two forms:
* - start and length of the span
* - startLocation and endLocation a pair of Location objects storing the start/end line offset of the span
*/
interface DiagnosticRelatedInformation {
/**
* The category of the related information message, e.g. "error", "warning", or "suggestion".
*/
category: string;
/**
* The code used ot identify the related information
*/
code: number;
/**
* Text of related or additional information.
*/
@@ -1897,7 +1959,7 @@ declare namespace ts.server.protocol {
/**
* An item found in a navto response.
*/
interface NavtoItem {
interface NavtoItem extends FileSpan {
/**
* The symbol's name.
*/
@@ -1909,27 +1971,15 @@ declare namespace ts.server.protocol {
/**
* exact, substring, or prefix.
*/
matchKind?: string;
matchKind: string;
/**
* If this was a case sensitive or insensitive match.
*/
isCaseSensitive?: boolean;
isCaseSensitive: boolean;
/**
* Optional modifiers for the kind (such as 'public').
*/
kindModifiers?: string;
/**
* The file in which the symbol is found.
*/
file: string;
/**
* The location within file at which the symbol is found.
*/
start: Location;
/**
* One past the last character of the symbol.
*/
end: Location;
/**
* Name of symbol's container symbol (if any); for example,
* the class name if symbol is a class member.
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Uma declaração de namespace não pode estar localizada antes de uma classe ou função com a qual ela é mesclada.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Uma declaração de namespace só é permitida e um namespace ou módulo.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Uma importação de estilo do namespace não pode ser chamada nem construída e causará uma falha no tempo de execução.",
"A_non_dry_build_would_build_project_0_6357": "Um build não dry compilaria o projeto '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Um build não dry excluiria os seguintes arquivos: {0}",
"A_non_dry_build_would_build_project_0_6357": "Um build não -dry compilaria o projeto '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Um build não -dry excluiria os seguintes arquivos: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Um inicializador de parâmetro só é permitido em uma implementação de função ou de construtor.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Uma propriedade de parâmetro não pode ser declarada usando um parâmetro rest.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Uma propriedade de parâmetro somente é permitida em uma implementação de construtor.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Объявление пространства имен не может располагаться раньше класса или функции, с которыми оно объединено.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Объявление пространства имен разрешено использовать только в пространстве имен или модуле.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Импорт стиля пространства имен не может быть вызван или создан и приведет к сбою во время выполнения.",
"A_non_dry_build_would_build_project_0_6357": "При выполнении сборки в рабочем режиме будет собран проект \"{0}\"",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "При выполнении сборки в рабочем режиме будут удалены следующие файлы: {0}",
"A_non_dry_build_would_build_project_0_6357": "При сборке без флага -dry будет собран проект \"{0}\"",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "При сборке без флага -dry будут удалены следующие файлы: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Инициализатор параметра разрешено использовать только в реализации функции или конструктора.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Свойство параметра невозможно объявить с помощью параметра REST.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Свойство параметра допускается только в реализации конструктора.",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden önce gelemez.",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Ad alanı bildirimine yalnızca bir ad alanında veya modülde izin verilir.",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Bir ad alanı stili içeri aktarma işlemi çağrılamadığından veya oluşturulamadığından çalışma zamanında hataya yol açacak.",
"A_non_dry_build_would_build_project_0_6357": "DRY dışı bir derleme '{0}' projesini derler",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "DRY dışı bir derleme şu dosyaları siler: {0}",
"A_non_dry_build_would_build_project_0_6357": "non-dry bir derleme '{0}' projesini derler",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "non-dry bir derleme şu dosyaları siler: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Parametre başlatıcısına yalnızca bir işlevde veya oluşturucu uygulamasında izin verilir.",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Parametre özelliği, rest parametresi kullanılarak bildirilemez.",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Parametre özelliğine yalnızca bir oluşturucu uygulamasında izin verilir.",
+4818 -4073
View File
File diff suppressed because it is too large Load Diff
+7602 -6355
View File
File diff suppressed because it is too large Load Diff
+430 -284
View File
File diff suppressed because it is too large Load Diff
+249 -224
View File
@@ -242,144 +242,147 @@ declare namespace ts {
TypeLiteral = 166,
ArrayType = 167,
TupleType = 168,
UnionType = 169,
IntersectionType = 170,
ConditionalType = 171,
InferType = 172,
ParenthesizedType = 173,
ThisType = 174,
TypeOperator = 175,
IndexedAccessType = 176,
MappedType = 177,
LiteralType = 178,
ImportType = 179,
ObjectBindingPattern = 180,
ArrayBindingPattern = 181,
BindingElement = 182,
ArrayLiteralExpression = 183,
ObjectLiteralExpression = 184,
PropertyAccessExpression = 185,
ElementAccessExpression = 186,
CallExpression = 187,
NewExpression = 188,
TaggedTemplateExpression = 189,
TypeAssertionExpression = 190,
ParenthesizedExpression = 191,
FunctionExpression = 192,
ArrowFunction = 193,
DeleteExpression = 194,
TypeOfExpression = 195,
VoidExpression = 196,
AwaitExpression = 197,
PrefixUnaryExpression = 198,
PostfixUnaryExpression = 199,
BinaryExpression = 200,
ConditionalExpression = 201,
TemplateExpression = 202,
YieldExpression = 203,
SpreadElement = 204,
ClassExpression = 205,
OmittedExpression = 206,
ExpressionWithTypeArguments = 207,
AsExpression = 208,
NonNullExpression = 209,
MetaProperty = 210,
TemplateSpan = 211,
SemicolonClassElement = 212,
Block = 213,
VariableStatement = 214,
EmptyStatement = 215,
ExpressionStatement = 216,
IfStatement = 217,
DoStatement = 218,
WhileStatement = 219,
ForStatement = 220,
ForInStatement = 221,
ForOfStatement = 222,
ContinueStatement = 223,
BreakStatement = 224,
ReturnStatement = 225,
WithStatement = 226,
SwitchStatement = 227,
LabeledStatement = 228,
ThrowStatement = 229,
TryStatement = 230,
DebuggerStatement = 231,
VariableDeclaration = 232,
VariableDeclarationList = 233,
FunctionDeclaration = 234,
ClassDeclaration = 235,
InterfaceDeclaration = 236,
TypeAliasDeclaration = 237,
EnumDeclaration = 238,
ModuleDeclaration = 239,
ModuleBlock = 240,
CaseBlock = 241,
NamespaceExportDeclaration = 242,
ImportEqualsDeclaration = 243,
ImportDeclaration = 244,
ImportClause = 245,
NamespaceImport = 246,
NamedImports = 247,
ImportSpecifier = 248,
ExportAssignment = 249,
ExportDeclaration = 250,
NamedExports = 251,
ExportSpecifier = 252,
MissingDeclaration = 253,
ExternalModuleReference = 254,
JsxElement = 255,
JsxSelfClosingElement = 256,
JsxOpeningElement = 257,
JsxClosingElement = 258,
JsxFragment = 259,
JsxOpeningFragment = 260,
JsxClosingFragment = 261,
JsxAttribute = 262,
JsxAttributes = 263,
JsxSpreadAttribute = 264,
JsxExpression = 265,
CaseClause = 266,
DefaultClause = 267,
HeritageClause = 268,
CatchClause = 269,
PropertyAssignment = 270,
ShorthandPropertyAssignment = 271,
SpreadAssignment = 272,
EnumMember = 273,
SourceFile = 274,
Bundle = 275,
UnparsedSource = 276,
InputFiles = 277,
JSDocTypeExpression = 278,
JSDocAllType = 279,
JSDocUnknownType = 280,
JSDocNullableType = 281,
JSDocNonNullableType = 282,
JSDocOptionalType = 283,
JSDocFunctionType = 284,
JSDocVariadicType = 285,
JSDocComment = 286,
JSDocTypeLiteral = 287,
JSDocSignature = 288,
JSDocTag = 289,
JSDocAugmentsTag = 290,
JSDocClassTag = 291,
JSDocCallbackTag = 292,
JSDocParameterTag = 293,
JSDocReturnTag = 294,
JSDocThisTag = 295,
JSDocTypeTag = 296,
JSDocTemplateTag = 297,
JSDocTypedefTag = 298,
JSDocPropertyTag = 299,
SyntaxList = 300,
NotEmittedStatement = 301,
PartiallyEmittedExpression = 302,
CommaListExpression = 303,
MergeDeclarationMarker = 304,
EndOfDeclarationMarker = 305,
Count = 306,
OptionalType = 169,
RestType = 170,
UnionType = 171,
IntersectionType = 172,
ConditionalType = 173,
InferType = 174,
ParenthesizedType = 175,
ThisType = 176,
TypeOperator = 177,
IndexedAccessType = 178,
MappedType = 179,
LiteralType = 180,
ImportType = 181,
ObjectBindingPattern = 182,
ArrayBindingPattern = 183,
BindingElement = 184,
ArrayLiteralExpression = 185,
ObjectLiteralExpression = 186,
PropertyAccessExpression = 187,
ElementAccessExpression = 188,
CallExpression = 189,
NewExpression = 190,
TaggedTemplateExpression = 191,
TypeAssertionExpression = 192,
ParenthesizedExpression = 193,
FunctionExpression = 194,
ArrowFunction = 195,
DeleteExpression = 196,
TypeOfExpression = 197,
VoidExpression = 198,
AwaitExpression = 199,
PrefixUnaryExpression = 200,
PostfixUnaryExpression = 201,
BinaryExpression = 202,
ConditionalExpression = 203,
TemplateExpression = 204,
YieldExpression = 205,
SpreadElement = 206,
ClassExpression = 207,
OmittedExpression = 208,
ExpressionWithTypeArguments = 209,
AsExpression = 210,
NonNullExpression = 211,
MetaProperty = 212,
SyntheticExpression = 213,
TemplateSpan = 214,
SemicolonClassElement = 215,
Block = 216,
VariableStatement = 217,
EmptyStatement = 218,
ExpressionStatement = 219,
IfStatement = 220,
DoStatement = 221,
WhileStatement = 222,
ForStatement = 223,
ForInStatement = 224,
ForOfStatement = 225,
ContinueStatement = 226,
BreakStatement = 227,
ReturnStatement = 228,
WithStatement = 229,
SwitchStatement = 230,
LabeledStatement = 231,
ThrowStatement = 232,
TryStatement = 233,
DebuggerStatement = 234,
VariableDeclaration = 235,
VariableDeclarationList = 236,
FunctionDeclaration = 237,
ClassDeclaration = 238,
InterfaceDeclaration = 239,
TypeAliasDeclaration = 240,
EnumDeclaration = 241,
ModuleDeclaration = 242,
ModuleBlock = 243,
CaseBlock = 244,
NamespaceExportDeclaration = 245,
ImportEqualsDeclaration = 246,
ImportDeclaration = 247,
ImportClause = 248,
NamespaceImport = 249,
NamedImports = 250,
ImportSpecifier = 251,
ExportAssignment = 252,
ExportDeclaration = 253,
NamedExports = 254,
ExportSpecifier = 255,
MissingDeclaration = 256,
ExternalModuleReference = 257,
JsxElement = 258,
JsxSelfClosingElement = 259,
JsxOpeningElement = 260,
JsxClosingElement = 261,
JsxFragment = 262,
JsxOpeningFragment = 263,
JsxClosingFragment = 264,
JsxAttribute = 265,
JsxAttributes = 266,
JsxSpreadAttribute = 267,
JsxExpression = 268,
CaseClause = 269,
DefaultClause = 270,
HeritageClause = 271,
CatchClause = 272,
PropertyAssignment = 273,
ShorthandPropertyAssignment = 274,
SpreadAssignment = 275,
EnumMember = 276,
SourceFile = 277,
Bundle = 278,
UnparsedSource = 279,
InputFiles = 280,
JSDocTypeExpression = 281,
JSDocAllType = 282,
JSDocUnknownType = 283,
JSDocNullableType = 284,
JSDocNonNullableType = 285,
JSDocOptionalType = 286,
JSDocFunctionType = 287,
JSDocVariadicType = 288,
JSDocComment = 289,
JSDocTypeLiteral = 290,
JSDocSignature = 291,
JSDocTag = 292,
JSDocAugmentsTag = 293,
JSDocClassTag = 294,
JSDocCallbackTag = 295,
JSDocParameterTag = 296,
JSDocReturnTag = 297,
JSDocThisTag = 298,
JSDocTypeTag = 299,
JSDocTemplateTag = 300,
JSDocTypedefTag = 301,
JSDocPropertyTag = 302,
SyntaxList = 303,
NotEmittedStatement = 304,
PartiallyEmittedExpression = 305,
CommaListExpression = 306,
MergeDeclarationMarker = 307,
EndOfDeclarationMarker = 308,
Count = 309,
FirstAssignment = 58,
LastAssignment = 70,
FirstCompoundAssignment = 59,
@@ -391,7 +394,7 @@ declare namespace ts {
FirstFutureReservedWord = 108,
LastFutureReservedWord = 116,
FirstTypeNode = 161,
LastTypeNode = 179,
LastTypeNode = 181,
FirstPunctuation = 17,
LastPunctuation = 70,
FirstToken = 0,
@@ -405,10 +408,10 @@ declare namespace ts {
FirstBinaryOperator = 27,
LastBinaryOperator = 70,
FirstNode = 146,
FirstJSDocNode = 278,
LastJSDocNode = 299,
FirstJSDocTagNode = 289,
LastJSDocTagNode = 299
FirstJSDocNode = 281,
LastJSDocNode = 302,
FirstJSDocTagNode = 292,
LastJSDocTagNode = 302
}
enum NodeFlags {
None = 0,
@@ -767,6 +770,14 @@ declare namespace ts {
kind: SyntaxKind.TupleType;
elementTypes: NodeArray<TypeNode>;
}
interface OptionalTypeNode extends TypeNode {
kind: SyntaxKind.OptionalType;
type: TypeNode;
}
interface RestTypeNode extends TypeNode {
kind: SyntaxKind.RestType;
type: TypeNode;
}
type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
interface UnionTypeNode extends TypeNode {
kind: SyntaxKind.UnionType;
@@ -891,6 +902,11 @@ declare namespace ts {
asteriskToken?: AsteriskToken;
expression?: Expression;
}
interface SyntheticExpression extends Expression {
kind: SyntaxKind.SyntheticExpression;
isSpread: boolean;
type: Type;
}
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
@@ -1105,7 +1121,10 @@ declare namespace ts {
}
type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
expression: JsxTagNameExpression;
}
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent: JsxOpeningLikeElement;
}
@@ -1780,6 +1799,7 @@ declare namespace ts {
*/
getTypeChecker(): TypeChecker;
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
isSourceFileDefaultLibrary(file: SourceFile): boolean;
getProjectReferences(): (ResolvedProjectReference | undefined)[] | undefined;
}
interface ResolvedProjectReference {
@@ -1818,7 +1838,6 @@ declare namespace ts {
inputSourceFileNames: string[];
sourceMapNames?: string[];
sourceMapMappings: string;
sourceMapDecodedMappings: SourceMapSpan[];
}
/** Return code used by getEmitOutput function to indicate status of the function */
enum ExitStatus {
@@ -1838,7 +1857,7 @@ declare namespace ts {
getPropertiesOfType(type: Type): Symbol[];
getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
getSignaturesOfType(type: Type, kind: SignatureKind): ReadonlyArray<Signature>;
getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
getBaseTypes(type: InterfaceType): BaseType[];
getBaseTypeOfLiteralType(type: Type): Type;
@@ -1889,11 +1908,6 @@ declare namespace ts {
typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
/**
* @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead
* This will be removed in a future version.
*/
getSymbolDisplayBuilder(): SymbolDisplayBuilder;
getFullyQualifiedName(symbol: Symbol): string;
getAugmentedPropertiesOfType(type: Type): Symbol[];
getRootSymbols(symbol: Symbol): Symbol[];
@@ -1920,7 +1934,7 @@ declare namespace ts {
getAmbientModules(): Symbol[];
tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
getApparentType(type: Type): Type;
getSuggestionForNonexistentProperty(node: Identifier, containingType: Type): string | undefined;
getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined;
getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined;
getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined;
getBaseConstraintOfType(type: Type): Type | undefined;
@@ -1992,39 +2006,6 @@ declare namespace ts {
AllowAnyNodeKind = 4,
UseAliasDefinedOutsideCurrentScope = 8
}
/**
* @deprecated
*/
interface SymbolDisplayBuilder {
/** @deprecated */ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void;
/** @deprecated */ buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void;
/** @deprecated */ buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void;
/** @deprecated */ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
}
/**
* @deprecated Migrate to other methods of generating symbol names, ex symbolToEntityName + a printer or symbolToString
*/
interface SymbolWriter extends SymbolTracker {
writeKeyword(text: string): void;
writeOperator(text: string): void;
writePunctuation(text: string): void;
writeSpace(text: string): void;
writeStringLiteral(text: string): void;
writeParameter(text: string): void;
writeProperty(text: string): void;
writeSymbol(text: string, symbol: Symbol): void;
writeLine(): void;
increaseIndent(): void;
decreaseIndent(): void;
clear(): void;
}
enum TypePredicateKind {
This = 0,
Identifier = 1
@@ -2214,7 +2195,7 @@ declare namespace ts {
symbol: Symbol;
pattern?: DestructuringPattern;
aliasSymbol?: Symbol;
aliasTypeArguments?: Type[];
aliasTypeArguments?: ReadonlyArray<Type>;
}
interface LiteralType extends Type {
value: string | number;
@@ -2279,10 +2260,18 @@ declare namespace ts {
*/
interface TypeReference extends ObjectType {
target: GenericType;
typeArguments?: Type[];
typeArguments?: ReadonlyArray<Type>;
}
interface GenericType extends InterfaceType, TypeReference {
}
interface TupleType extends GenericType {
minLength: number;
hasRestElement: boolean;
associatedNames?: __String[];
}
interface TupleTypeReference extends TypeReference {
target: TupleType;
}
interface UnionOrIntersectionType extends Type {
types: Type[];
}
@@ -2339,8 +2328,8 @@ declare namespace ts {
}
interface Signature {
declaration?: SignatureDeclaration | JSDocSignature;
typeParameters?: TypeParameter[];
parameters: Symbol[];
typeParameters?: ReadonlyArray<TypeParameter>;
parameters: ReadonlyArray<Symbol>;
}
enum IndexKind {
String = 0,
@@ -2388,14 +2377,14 @@ declare namespace ts {
next?: DiagnosticMessageChain;
}
interface Diagnostic extends DiagnosticRelatedInformation {
category: DiagnosticCategory;
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
code: number;
source?: string;
relatedInformation?: DiagnosticRelatedInformation[];
}
interface DiagnosticRelatedInformation {
category: DiagnosticCategory;
code: number;
file: SourceFile | undefined;
start: number | undefined;
length: number | undefined;
@@ -2929,13 +2918,6 @@ declare namespace ts {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
}
/** @deprecated See comment on SymbolWriter */
interface SymbolTracker {
trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
reportInaccessibleThisError?(): void;
reportPrivateInBaseOfClassExpression?(propertyName: string): void;
reportInaccessibleUniqueSymbolError?(): void;
}
interface TextSpan {
start: number;
length: number;
@@ -3166,7 +3148,8 @@ declare namespace ts {
function isParameterPropertyDeclaration(node: Node): node is ParameterPropertyDeclaration;
function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
function isEmptyBindingElement(node: BindingElement): boolean;
function getCombinedModifierFlags(node: Node): ModifierFlags;
function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
function getCombinedModifierFlags(node: Declaration): ModifierFlags;
function getCombinedNodeFlags(node: Node): NodeFlags;
/**
* Checks to see if the locale is in the appropriate format,
@@ -3212,15 +3195,8 @@ declare namespace ts {
function unescapeLeadingUnderscores(identifier: __String): string;
function idText(identifier: Identifier): string;
function symbolName(symbol: Symbol): string;
/**
* Remove extra underscore from escaped identifier text content.
* @deprecated Use `id.text` for the unescaped text.
* @param identifier The escaped identifier text.
* @returns The unescaped identifier text.
*/
function unescapeIdentifier(id: string): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName;
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
*
@@ -3655,7 +3631,7 @@ declare namespace ts {
/** Create a unique name based on the supplied text. This does not consider names injected by the transformer. */
function createFileLevelUniqueName(text: string): Identifier;
/** Create a unique name generated for a node. */
function getGeneratedNameForNode(node: Node): Identifier;
function getGeneratedNameForNode(node: Node | undefined): Identifier;
function createToken<TKind extends SyntaxKind>(token: TKind): Token<TKind>;
function createSuper(): SuperExpression;
function createThis(): ThisExpression & Token<SyntaxKind.ThisKeyword>;
@@ -3710,7 +3686,11 @@ declare namespace ts {
function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
function createTupleTypeNode(elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTypleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTupleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
function createRestTypeNode(type: TypeNode): RestTypeNode;
function updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
function createUnionTypeNode(types: ReadonlyArray<TypeNode>): UnionTypeNode;
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
@@ -3763,7 +3743,7 @@ declare namespace ts {
function createFunctionExpression(modifiers: ReadonlyArray<Modifier> | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration> | undefined, type: TypeNode | undefined, body: Block): FunctionExpression;
function updateFunctionExpression(node: FunctionExpression, modifiers: ReadonlyArray<Modifier> | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: Block): FunctionExpression;
function createArrowFunction(modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
/** @deprecated */ function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, equalsGreaterThanToken: Token<SyntaxKind.EqualsGreaterThanToken>, body: ConciseBody): ArrowFunction;
function createDelete(expression: Expression): DeleteExpression;
function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression;
@@ -3781,7 +3761,7 @@ declare namespace ts {
function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken): BinaryExpression;
function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
/** @deprecated */ function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
function updateConditional(node: ConditionalExpression, condition: Expression, questionToken: Token<SyntaxKind.QuestionToken>, whenTrue: Expression, colonToken: Token<SyntaxKind.ColonToken>, whenFalse: Expression): ConditionalExpression;
function createTemplateExpression(head: TemplateHead, templateSpans: ReadonlyArray<TemplateSpan>): TemplateExpression;
function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: ReadonlyArray<TemplateSpan>): TemplateExpression;
@@ -3813,8 +3793,12 @@ declare namespace ts {
function createVariableStatement(modifiers: ReadonlyArray<Modifier> | undefined, declarationList: VariableDeclarationList | ReadonlyArray<VariableDeclaration>): VariableStatement;
function updateVariableStatement(node: VariableStatement, modifiers: ReadonlyArray<Modifier> | undefined, declarationList: VariableDeclarationList): VariableStatement;
function createEmptyStatement(): EmptyStatement;
function createStatement(expression: Expression): ExpressionStatement;
function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
function createExpressionStatement(expression: Expression): ExpressionStatement;
function updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
/** @deprecated Use `createExpressionStatement` instead. */
const createStatement: typeof createExpressionStatement;
/** @deprecated Use `updateExpressionStatement` instead. */
const updateStatement: typeof updateExpressionStatement;
function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
function createDo(statement: Statement, expression: Expression): DoStatement;
@@ -4504,12 +4488,12 @@ declare namespace ts {
*/
interface UpToDate {
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
newestInputFileTime: Date;
newestInputFileName: string;
newestDeclarationFileContentChangedTime: Date;
newestOutputFileTime: Date;
newestOutputFileName: string;
oldestOutputFileName: string;
newestInputFileTime?: Date;
newestInputFileName?: string;
newestDeclarationFileContentChangedTime?: Date;
newestOutputFileTime?: Date;
newestOutputFileName?: string;
oldestOutputFileName?: string;
}
/**
* One or more of the outputs of the project does not exist.
@@ -4629,8 +4613,8 @@ declare namespace ts {
getProperties(): Symbol[];
getProperty(propertyName: string): Symbol | undefined;
getApparentProperties(): Symbol[];
getCallSignatures(): Signature[];
getConstructSignatures(): Signature[];
getCallSignatures(): ReadonlyArray<Signature>;
getConstructSignatures(): ReadonlyArray<Signature>;
getStringIndexType(): Type | undefined;
getNumberIndexType(): Type | undefined;
getBaseTypes(): BaseType[] | undefined;
@@ -4771,7 +4755,7 @@ declare namespace ts {
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems | undefined;
getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
getRenameInfo(fileName: string, position: number): RenameInfo;
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] | undefined;
getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] | undefined;
@@ -4831,13 +4815,54 @@ declare namespace ts {
type OrganizeImportsScope = CombinedCodeFixScope;
type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<";
interface GetCompletionsAtPositionOptions extends UserPreferences {
/** If the editor is asking for completions because a certain character was typed, and not because the user explicitly requested them, this should be set. */
/**
* If the editor is asking for completions because a certain character was typed
* (as opposed to when the user explicitly requested them) this should be set.
*/
triggerCharacter?: CompletionsTriggerCharacter;
/** @deprecated Use includeCompletionsForModuleExports */
includeExternalModuleExports?: boolean;
/** @deprecated Use includeCompletionsWithInsertText */
includeInsertTextCompletions?: boolean;
}
type SignatureHelpTriggerCharacter = "," | "(" | "<";
type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
interface SignatureHelpItemsOptions {
triggerReason?: SignatureHelpTriggerReason;
}
type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
/**
* Signals that the user manually requested signature help.
* The language service will unconditionally attempt to provide a result.
*/
interface SignatureHelpInvokedReason {
kind: "invoked";
triggerCharacter?: undefined;
}
/**
* Signals that the signature help request came from a user typing a character.
* Depending on the character and the syntactic context, the request may or may not be served a result.
*/
interface SignatureHelpCharacterTypedReason {
kind: "characterTyped";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter: SignatureHelpTriggerCharacter;
}
/**
* Signals that this signature help request came from typing a character or moving the cursor.
* This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
* The language service will unconditionally attempt to provide a result.
* `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
*/
interface SignatureHelpRetriggeredReason {
kind: "retrigger";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter?: SignatureHelpRetriggerCharacter;
}
interface ApplyCodeActionCommandResult {
successMessage: string;
}
@@ -5025,7 +5050,7 @@ declare namespace ts {
name: string;
kind: ScriptElementKind;
kindModifiers: string;
matchKind: string;
matchKind: "exact" | "prefix" | "substring" | "camelCase";
isCaseSensitive: boolean;
fileName: string;
textSpan: TextSpan;
+7451 -6276
View File
File diff suppressed because it is too large Load Diff
+249 -224
View File
@@ -242,144 +242,147 @@ declare namespace ts {
TypeLiteral = 166,
ArrayType = 167,
TupleType = 168,
UnionType = 169,
IntersectionType = 170,
ConditionalType = 171,
InferType = 172,
ParenthesizedType = 173,
ThisType = 174,
TypeOperator = 175,
IndexedAccessType = 176,
MappedType = 177,
LiteralType = 178,
ImportType = 179,
ObjectBindingPattern = 180,
ArrayBindingPattern = 181,
BindingElement = 182,
ArrayLiteralExpression = 183,
ObjectLiteralExpression = 184,
PropertyAccessExpression = 185,
ElementAccessExpression = 186,
CallExpression = 187,
NewExpression = 188,
TaggedTemplateExpression = 189,
TypeAssertionExpression = 190,
ParenthesizedExpression = 191,
FunctionExpression = 192,
ArrowFunction = 193,
DeleteExpression = 194,
TypeOfExpression = 195,
VoidExpression = 196,
AwaitExpression = 197,
PrefixUnaryExpression = 198,
PostfixUnaryExpression = 199,
BinaryExpression = 200,
ConditionalExpression = 201,
TemplateExpression = 202,
YieldExpression = 203,
SpreadElement = 204,
ClassExpression = 205,
OmittedExpression = 206,
ExpressionWithTypeArguments = 207,
AsExpression = 208,
NonNullExpression = 209,
MetaProperty = 210,
TemplateSpan = 211,
SemicolonClassElement = 212,
Block = 213,
VariableStatement = 214,
EmptyStatement = 215,
ExpressionStatement = 216,
IfStatement = 217,
DoStatement = 218,
WhileStatement = 219,
ForStatement = 220,
ForInStatement = 221,
ForOfStatement = 222,
ContinueStatement = 223,
BreakStatement = 224,
ReturnStatement = 225,
WithStatement = 226,
SwitchStatement = 227,
LabeledStatement = 228,
ThrowStatement = 229,
TryStatement = 230,
DebuggerStatement = 231,
VariableDeclaration = 232,
VariableDeclarationList = 233,
FunctionDeclaration = 234,
ClassDeclaration = 235,
InterfaceDeclaration = 236,
TypeAliasDeclaration = 237,
EnumDeclaration = 238,
ModuleDeclaration = 239,
ModuleBlock = 240,
CaseBlock = 241,
NamespaceExportDeclaration = 242,
ImportEqualsDeclaration = 243,
ImportDeclaration = 244,
ImportClause = 245,
NamespaceImport = 246,
NamedImports = 247,
ImportSpecifier = 248,
ExportAssignment = 249,
ExportDeclaration = 250,
NamedExports = 251,
ExportSpecifier = 252,
MissingDeclaration = 253,
ExternalModuleReference = 254,
JsxElement = 255,
JsxSelfClosingElement = 256,
JsxOpeningElement = 257,
JsxClosingElement = 258,
JsxFragment = 259,
JsxOpeningFragment = 260,
JsxClosingFragment = 261,
JsxAttribute = 262,
JsxAttributes = 263,
JsxSpreadAttribute = 264,
JsxExpression = 265,
CaseClause = 266,
DefaultClause = 267,
HeritageClause = 268,
CatchClause = 269,
PropertyAssignment = 270,
ShorthandPropertyAssignment = 271,
SpreadAssignment = 272,
EnumMember = 273,
SourceFile = 274,
Bundle = 275,
UnparsedSource = 276,
InputFiles = 277,
JSDocTypeExpression = 278,
JSDocAllType = 279,
JSDocUnknownType = 280,
JSDocNullableType = 281,
JSDocNonNullableType = 282,
JSDocOptionalType = 283,
JSDocFunctionType = 284,
JSDocVariadicType = 285,
JSDocComment = 286,
JSDocTypeLiteral = 287,
JSDocSignature = 288,
JSDocTag = 289,
JSDocAugmentsTag = 290,
JSDocClassTag = 291,
JSDocCallbackTag = 292,
JSDocParameterTag = 293,
JSDocReturnTag = 294,
JSDocThisTag = 295,
JSDocTypeTag = 296,
JSDocTemplateTag = 297,
JSDocTypedefTag = 298,
JSDocPropertyTag = 299,
SyntaxList = 300,
NotEmittedStatement = 301,
PartiallyEmittedExpression = 302,
CommaListExpression = 303,
MergeDeclarationMarker = 304,
EndOfDeclarationMarker = 305,
Count = 306,
OptionalType = 169,
RestType = 170,
UnionType = 171,
IntersectionType = 172,
ConditionalType = 173,
InferType = 174,
ParenthesizedType = 175,
ThisType = 176,
TypeOperator = 177,
IndexedAccessType = 178,
MappedType = 179,
LiteralType = 180,
ImportType = 181,
ObjectBindingPattern = 182,
ArrayBindingPattern = 183,
BindingElement = 184,
ArrayLiteralExpression = 185,
ObjectLiteralExpression = 186,
PropertyAccessExpression = 187,
ElementAccessExpression = 188,
CallExpression = 189,
NewExpression = 190,
TaggedTemplateExpression = 191,
TypeAssertionExpression = 192,
ParenthesizedExpression = 193,
FunctionExpression = 194,
ArrowFunction = 195,
DeleteExpression = 196,
TypeOfExpression = 197,
VoidExpression = 198,
AwaitExpression = 199,
PrefixUnaryExpression = 200,
PostfixUnaryExpression = 201,
BinaryExpression = 202,
ConditionalExpression = 203,
TemplateExpression = 204,
YieldExpression = 205,
SpreadElement = 206,
ClassExpression = 207,
OmittedExpression = 208,
ExpressionWithTypeArguments = 209,
AsExpression = 210,
NonNullExpression = 211,
MetaProperty = 212,
SyntheticExpression = 213,
TemplateSpan = 214,
SemicolonClassElement = 215,
Block = 216,
VariableStatement = 217,
EmptyStatement = 218,
ExpressionStatement = 219,
IfStatement = 220,
DoStatement = 221,
WhileStatement = 222,
ForStatement = 223,
ForInStatement = 224,
ForOfStatement = 225,
ContinueStatement = 226,
BreakStatement = 227,
ReturnStatement = 228,
WithStatement = 229,
SwitchStatement = 230,
LabeledStatement = 231,
ThrowStatement = 232,
TryStatement = 233,
DebuggerStatement = 234,
VariableDeclaration = 235,
VariableDeclarationList = 236,
FunctionDeclaration = 237,
ClassDeclaration = 238,
InterfaceDeclaration = 239,
TypeAliasDeclaration = 240,
EnumDeclaration = 241,
ModuleDeclaration = 242,
ModuleBlock = 243,
CaseBlock = 244,
NamespaceExportDeclaration = 245,
ImportEqualsDeclaration = 246,
ImportDeclaration = 247,
ImportClause = 248,
NamespaceImport = 249,
NamedImports = 250,
ImportSpecifier = 251,
ExportAssignment = 252,
ExportDeclaration = 253,
NamedExports = 254,
ExportSpecifier = 255,
MissingDeclaration = 256,
ExternalModuleReference = 257,
JsxElement = 258,
JsxSelfClosingElement = 259,
JsxOpeningElement = 260,
JsxClosingElement = 261,
JsxFragment = 262,
JsxOpeningFragment = 263,
JsxClosingFragment = 264,
JsxAttribute = 265,
JsxAttributes = 266,
JsxSpreadAttribute = 267,
JsxExpression = 268,
CaseClause = 269,
DefaultClause = 270,
HeritageClause = 271,
CatchClause = 272,
PropertyAssignment = 273,
ShorthandPropertyAssignment = 274,
SpreadAssignment = 275,
EnumMember = 276,
SourceFile = 277,
Bundle = 278,
UnparsedSource = 279,
InputFiles = 280,
JSDocTypeExpression = 281,
JSDocAllType = 282,
JSDocUnknownType = 283,
JSDocNullableType = 284,
JSDocNonNullableType = 285,
JSDocOptionalType = 286,
JSDocFunctionType = 287,
JSDocVariadicType = 288,
JSDocComment = 289,
JSDocTypeLiteral = 290,
JSDocSignature = 291,
JSDocTag = 292,
JSDocAugmentsTag = 293,
JSDocClassTag = 294,
JSDocCallbackTag = 295,
JSDocParameterTag = 296,
JSDocReturnTag = 297,
JSDocThisTag = 298,
JSDocTypeTag = 299,
JSDocTemplateTag = 300,
JSDocTypedefTag = 301,
JSDocPropertyTag = 302,
SyntaxList = 303,
NotEmittedStatement = 304,
PartiallyEmittedExpression = 305,
CommaListExpression = 306,
MergeDeclarationMarker = 307,
EndOfDeclarationMarker = 308,
Count = 309,
FirstAssignment = 58,
LastAssignment = 70,
FirstCompoundAssignment = 59,
@@ -391,7 +394,7 @@ declare namespace ts {
FirstFutureReservedWord = 108,
LastFutureReservedWord = 116,
FirstTypeNode = 161,
LastTypeNode = 179,
LastTypeNode = 181,
FirstPunctuation = 17,
LastPunctuation = 70,
FirstToken = 0,
@@ -405,10 +408,10 @@ declare namespace ts {
FirstBinaryOperator = 27,
LastBinaryOperator = 70,
FirstNode = 146,
FirstJSDocNode = 278,
LastJSDocNode = 299,
FirstJSDocTagNode = 289,
LastJSDocTagNode = 299
FirstJSDocNode = 281,
LastJSDocNode = 302,
FirstJSDocTagNode = 292,
LastJSDocTagNode = 302
}
enum NodeFlags {
None = 0,
@@ -767,6 +770,14 @@ declare namespace ts {
kind: SyntaxKind.TupleType;
elementTypes: NodeArray<TypeNode>;
}
interface OptionalTypeNode extends TypeNode {
kind: SyntaxKind.OptionalType;
type: TypeNode;
}
interface RestTypeNode extends TypeNode {
kind: SyntaxKind.RestType;
type: TypeNode;
}
type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
interface UnionTypeNode extends TypeNode {
kind: SyntaxKind.UnionType;
@@ -891,6 +902,11 @@ declare namespace ts {
asteriskToken?: AsteriskToken;
expression?: Expression;
}
interface SyntheticExpression extends Expression {
kind: SyntaxKind.SyntheticExpression;
isSpread: boolean;
type: Type;
}
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
type MultiplicativeOperator = SyntaxKind.AsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken;
type MultiplicativeOperatorOrHigher = ExponentiationOperator | MultiplicativeOperator;
@@ -1105,7 +1121,10 @@ declare namespace ts {
}
type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess;
interface JsxTagNamePropertyAccess extends PropertyAccessExpression {
expression: JsxTagNameExpression;
}
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
parent: JsxOpeningLikeElement;
}
@@ -1780,6 +1799,7 @@ declare namespace ts {
*/
getTypeChecker(): TypeChecker;
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
isSourceFileDefaultLibrary(file: SourceFile): boolean;
getProjectReferences(): (ResolvedProjectReference | undefined)[] | undefined;
}
interface ResolvedProjectReference {
@@ -1818,7 +1838,6 @@ declare namespace ts {
inputSourceFileNames: string[];
sourceMapNames?: string[];
sourceMapMappings: string;
sourceMapDecodedMappings: SourceMapSpan[];
}
/** Return code used by getEmitOutput function to indicate status of the function */
enum ExitStatus {
@@ -1838,7 +1857,7 @@ declare namespace ts {
getPropertiesOfType(type: Type): Symbol[];
getPropertyOfType(type: Type, propertyName: string): Symbol | undefined;
getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined;
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
getSignaturesOfType(type: Type, kind: SignatureKind): ReadonlyArray<Signature>;
getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
getBaseTypes(type: InterfaceType): BaseType[];
getBaseTypeOfLiteralType(type: Type): Type;
@@ -1889,11 +1908,6 @@ declare namespace ts {
typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string;
typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
/**
* @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead
* This will be removed in a future version.
*/
getSymbolDisplayBuilder(): SymbolDisplayBuilder;
getFullyQualifiedName(symbol: Symbol): string;
getAugmentedPropertiesOfType(type: Type): Symbol[];
getRootSymbols(symbol: Symbol): Symbol[];
@@ -1920,7 +1934,7 @@ declare namespace ts {
getAmbientModules(): Symbol[];
tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined;
getApparentType(type: Type): Type;
getSuggestionForNonexistentProperty(node: Identifier, containingType: Type): string | undefined;
getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined;
getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined;
getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined;
getBaseConstraintOfType(type: Type): Type | undefined;
@@ -1992,39 +2006,6 @@ declare namespace ts {
AllowAnyNodeKind = 4,
UseAliasDefinedOutsideCurrentScope = 8
}
/**
* @deprecated
*/
interface SymbolDisplayBuilder {
/** @deprecated */ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void;
/** @deprecated */ buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void;
/** @deprecated */ buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void;
/** @deprecated */ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
/** @deprecated */ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
}
/**
* @deprecated Migrate to other methods of generating symbol names, ex symbolToEntityName + a printer or symbolToString
*/
interface SymbolWriter extends SymbolTracker {
writeKeyword(text: string): void;
writeOperator(text: string): void;
writePunctuation(text: string): void;
writeSpace(text: string): void;
writeStringLiteral(text: string): void;
writeParameter(text: string): void;
writeProperty(text: string): void;
writeSymbol(text: string, symbol: Symbol): void;
writeLine(): void;
increaseIndent(): void;
decreaseIndent(): void;
clear(): void;
}
enum TypePredicateKind {
This = 0,
Identifier = 1
@@ -2214,7 +2195,7 @@ declare namespace ts {
symbol: Symbol;
pattern?: DestructuringPattern;
aliasSymbol?: Symbol;
aliasTypeArguments?: Type[];
aliasTypeArguments?: ReadonlyArray<Type>;
}
interface LiteralType extends Type {
value: string | number;
@@ -2279,10 +2260,18 @@ declare namespace ts {
*/
interface TypeReference extends ObjectType {
target: GenericType;
typeArguments?: Type[];
typeArguments?: ReadonlyArray<Type>;
}
interface GenericType extends InterfaceType, TypeReference {
}
interface TupleType extends GenericType {
minLength: number;
hasRestElement: boolean;
associatedNames?: __String[];
}
interface TupleTypeReference extends TypeReference {
target: TupleType;
}
interface UnionOrIntersectionType extends Type {
types: Type[];
}
@@ -2339,8 +2328,8 @@ declare namespace ts {
}
interface Signature {
declaration?: SignatureDeclaration | JSDocSignature;
typeParameters?: TypeParameter[];
parameters: Symbol[];
typeParameters?: ReadonlyArray<TypeParameter>;
parameters: ReadonlyArray<Symbol>;
}
enum IndexKind {
String = 0,
@@ -2388,14 +2377,14 @@ declare namespace ts {
next?: DiagnosticMessageChain;
}
interface Diagnostic extends DiagnosticRelatedInformation {
category: DiagnosticCategory;
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
code: number;
source?: string;
relatedInformation?: DiagnosticRelatedInformation[];
}
interface DiagnosticRelatedInformation {
category: DiagnosticCategory;
code: number;
file: SourceFile | undefined;
start: number | undefined;
length: number | undefined;
@@ -2929,13 +2918,6 @@ declare namespace ts {
directoryExists?(directoryName: string): boolean;
getCurrentDirectory?(): string;
}
/** @deprecated See comment on SymbolWriter */
interface SymbolTracker {
trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void;
reportInaccessibleThisError?(): void;
reportPrivateInBaseOfClassExpression?(propertyName: string): void;
reportInaccessibleUniqueSymbolError?(): void;
}
interface TextSpan {
start: number;
length: number;
@@ -3166,7 +3148,8 @@ declare namespace ts {
function isParameterPropertyDeclaration(node: Node): node is ParameterPropertyDeclaration;
function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
function isEmptyBindingElement(node: BindingElement): boolean;
function getCombinedModifierFlags(node: Node): ModifierFlags;
function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
function getCombinedModifierFlags(node: Declaration): ModifierFlags;
function getCombinedNodeFlags(node: Node): NodeFlags;
/**
* Checks to see if the locale is in the appropriate format,
@@ -3212,15 +3195,8 @@ declare namespace ts {
function unescapeLeadingUnderscores(identifier: __String): string;
function idText(identifier: Identifier): string;
function symbolName(symbol: Symbol): string;
/**
* Remove extra underscore from escaped identifier text content.
* @deprecated Use `id.text` for the unescaped text.
* @param identifier The escaped identifier text.
* @returns The unescaped identifier text.
*/
function unescapeIdentifier(id: string): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName;
function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
/**
* Gets the JSDoc parameter tags for the node if present.
*
@@ -3655,7 +3631,7 @@ declare namespace ts {
/** Create a unique name based on the supplied text. This does not consider names injected by the transformer. */
function createFileLevelUniqueName(text: string): Identifier;
/** Create a unique name generated for a node. */
function getGeneratedNameForNode(node: Node): Identifier;
function getGeneratedNameForNode(node: Node | undefined): Identifier;
function createToken<TKind extends SyntaxKind>(token: TKind): Token<TKind>;
function createSuper(): SuperExpression;
function createThis(): ThisExpression & Token<SyntaxKind.ThisKeyword>;
@@ -3710,7 +3686,11 @@ declare namespace ts {
function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
function createTupleTypeNode(elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTypleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTupleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
function createRestTypeNode(type: TypeNode): RestTypeNode;
function updateRestTypeNode(node: RestTypeNode, type: TypeNode): RestTypeNode;
function createUnionTypeNode(types: ReadonlyArray<TypeNode>): UnionTypeNode;
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
@@ -3763,7 +3743,7 @@ declare namespace ts {
function createFunctionExpression(modifiers: ReadonlyArray<Modifier> | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration> | undefined, type: TypeNode | undefined, body: Block): FunctionExpression;
function updateFunctionExpression(node: FunctionExpression, modifiers: ReadonlyArray<Modifier> | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: Block): FunctionExpression;
function createArrowFunction(modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
/** @deprecated */ function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray<Modifier> | undefined, typeParameters: ReadonlyArray<TypeParameterDeclaration> | undefined, parameters: ReadonlyArray<ParameterDeclaration>, type: TypeNode | undefined, equalsGreaterThanToken: Token<SyntaxKind.EqualsGreaterThanToken>, body: ConciseBody): ArrowFunction;
function createDelete(expression: Expression): DeleteExpression;
function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression;
@@ -3781,7 +3761,7 @@ declare namespace ts {
function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken): BinaryExpression;
function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression;
function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
/** @deprecated */ function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression;
function updateConditional(node: ConditionalExpression, condition: Expression, questionToken: Token<SyntaxKind.QuestionToken>, whenTrue: Expression, colonToken: Token<SyntaxKind.ColonToken>, whenFalse: Expression): ConditionalExpression;
function createTemplateExpression(head: TemplateHead, templateSpans: ReadonlyArray<TemplateSpan>): TemplateExpression;
function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: ReadonlyArray<TemplateSpan>): TemplateExpression;
@@ -3813,8 +3793,12 @@ declare namespace ts {
function createVariableStatement(modifiers: ReadonlyArray<Modifier> | undefined, declarationList: VariableDeclarationList | ReadonlyArray<VariableDeclaration>): VariableStatement;
function updateVariableStatement(node: VariableStatement, modifiers: ReadonlyArray<Modifier> | undefined, declarationList: VariableDeclarationList): VariableStatement;
function createEmptyStatement(): EmptyStatement;
function createStatement(expression: Expression): ExpressionStatement;
function updateStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
function createExpressionStatement(expression: Expression): ExpressionStatement;
function updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
/** @deprecated Use `createExpressionStatement` instead. */
const createStatement: typeof createExpressionStatement;
/** @deprecated Use `updateExpressionStatement` instead. */
const updateStatement: typeof updateExpressionStatement;
function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement): IfStatement;
function updateIf(node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | undefined): IfStatement;
function createDo(statement: Statement, expression: Expression): DoStatement;
@@ -4504,12 +4488,12 @@ declare namespace ts {
*/
interface UpToDate {
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
newestInputFileTime: Date;
newestInputFileName: string;
newestDeclarationFileContentChangedTime: Date;
newestOutputFileTime: Date;
newestOutputFileName: string;
oldestOutputFileName: string;
newestInputFileTime?: Date;
newestInputFileName?: string;
newestDeclarationFileContentChangedTime?: Date;
newestOutputFileTime?: Date;
newestOutputFileName?: string;
oldestOutputFileName?: string;
}
/**
* One or more of the outputs of the project does not exist.
@@ -4629,8 +4613,8 @@ declare namespace ts {
getProperties(): Symbol[];
getProperty(propertyName: string): Symbol | undefined;
getApparentProperties(): Symbol[];
getCallSignatures(): Signature[];
getConstructSignatures(): Signature[];
getCallSignatures(): ReadonlyArray<Signature>;
getConstructSignatures(): ReadonlyArray<Signature>;
getStringIndexType(): Type | undefined;
getNumberIndexType(): Type | undefined;
getBaseTypes(): BaseType[] | undefined;
@@ -4771,7 +4755,7 @@ declare namespace ts {
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo | undefined;
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined;
getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined;
getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems | undefined;
getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined;
getRenameInfo(fileName: string, position: number): RenameInfo;
findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] | undefined;
getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] | undefined;
@@ -4831,13 +4815,54 @@ declare namespace ts {
type OrganizeImportsScope = CombinedCodeFixScope;
type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<";
interface GetCompletionsAtPositionOptions extends UserPreferences {
/** If the editor is asking for completions because a certain character was typed, and not because the user explicitly requested them, this should be set. */
/**
* If the editor is asking for completions because a certain character was typed
* (as opposed to when the user explicitly requested them) this should be set.
*/
triggerCharacter?: CompletionsTriggerCharacter;
/** @deprecated Use includeCompletionsForModuleExports */
includeExternalModuleExports?: boolean;
/** @deprecated Use includeCompletionsWithInsertText */
includeInsertTextCompletions?: boolean;
}
type SignatureHelpTriggerCharacter = "," | "(" | "<";
type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
interface SignatureHelpItemsOptions {
triggerReason?: SignatureHelpTriggerReason;
}
type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
/**
* Signals that the user manually requested signature help.
* The language service will unconditionally attempt to provide a result.
*/
interface SignatureHelpInvokedReason {
kind: "invoked";
triggerCharacter?: undefined;
}
/**
* Signals that the signature help request came from a user typing a character.
* Depending on the character and the syntactic context, the request may or may not be served a result.
*/
interface SignatureHelpCharacterTypedReason {
kind: "characterTyped";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter: SignatureHelpTriggerCharacter;
}
/**
* Signals that this signature help request came from typing a character or moving the cursor.
* This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
* The language service will unconditionally attempt to provide a result.
* `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
*/
interface SignatureHelpRetriggeredReason {
kind: "retrigger";
/**
* Character that was responsible for triggering signature help.
*/
triggerCharacter?: SignatureHelpRetriggerCharacter;
}
interface ApplyCodeActionCommandResult {
successMessage: string;
}
@@ -5025,7 +5050,7 @@ declare namespace ts {
name: string;
kind: ScriptElementKind;
kindModifiers: string;
matchKind: string;
matchKind: "exact" | "prefix" | "substring" | "camelCase";
isCaseSensitive: boolean;
fileName: string;
textSpan: TextSpan;
+7451 -6276
View File
File diff suppressed because it is too large Load Diff
+5058 -4291
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空间声明不能位于与之合并的类或函数前",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只允许在命名空间或模块中使用命名空间声明。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空间样式导入不能调用或构造,并将在运行时导致失败。",
"A_non_dry_build_would_build_project_0_6357": "非干燥生成将生成项目“{0}”",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非干燥生成将删除以下文件: {0}",
"A_non_dry_build_would_build_project_0_6357": "非 -dry 生成将生成项目“{0}”",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非 -dry 生成将删除以下文件: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只允许在函数或构造函数实现中使用参数初始化表达式。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "不能使用 rest 参数声明参数属性。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "只允许在构造函数实现中使用参数属性。",
+2 -2
View File
@@ -49,8 +49,8 @@
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空間宣告的位置不得先於其要合併的類別或函式。",
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只有命名空間或模組才允許命名空間宣告。",
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空間樣式的匯入無法加以呼叫或建構,而且會導致執行階段失敗。",
"A_non_dry_build_would_build_project_0_6357": "非 DRY 的組建會建置專案 '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非 DRY 的組建會刪除下列檔案: {0}",
"A_non_dry_build_would_build_project_0_6357": "非 -dry 組建會建置專案 '{0}'",
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "非 -dry 組建會刪除下列檔案: {0}",
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只有函式或建構函式實作才可使用參數初始設定式。",
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "無法使用剩餘參數宣告參數屬性。",
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "建構函式實作中只可有一個參數屬性。",
+1 -1
View File
@@ -32,7 +32,7 @@ sourceFiles.forEach(f=> {
});
var compilerSoruces = `var compilerSources = ${JSON.stringify(rawCompilerSources) };`;
// .js code for the compiler, what we are actuallty testing
// .js code for the compiler, what we are actually testing
var rawCompilerJavaScript = fs.readFileSync(path.join(tsBuildDir, "tsc.js")).toString();
rawCompilerJavaScript = rawCompilerJavaScript.replace("ts.executeCommandLine(ts.sys.args);", "");
+112 -72
View File
@@ -607,7 +607,7 @@ namespace ts {
ResolvedBaseConstructorType,
DeclaredType,
ResolvedReturnType,
ResolvedBaseConstraint,
ImmediateBaseConstraint,
}
const enum CheckMode {
@@ -2268,7 +2268,7 @@ namespace ts {
function resolveESModuleSymbol(moduleSymbol: Symbol | undefined, referencingLocation: Node, dontResolveAlias: boolean): Symbol | undefined {
const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable)) && !getDeclarationOfKind(symbol, SyntaxKind.SourceFile)) {
error(referencingLocation, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol!));
return symbol;
}
@@ -2463,17 +2463,26 @@ namespace ts {
* Attempts to find the symbol corresponding to the container a symbol is in - usually this
* is just its' `.parent`, but for locals, this value is `undefined`
*/
function getContainerOfSymbol(symbol: Symbol): Symbol | undefined {
function getContainersOfSymbol(symbol: Symbol, enclosingDeclaration: Node | undefined): Symbol[] | undefined {
const container = getParentOfSymbol(symbol);
if (container) {
return container;
const additionalContainers = mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer);
if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, SymbolFlags.Namespace, /*externalOnly*/ false)) {
return concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope
}
return append(additionalContainers, container);
}
const candidate = forEach(symbol.declarations, d => !isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined);
if (!candidate) {
const candidates = mapDefined(symbol.declarations, d => !isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined);
if (!length(candidates)) {
return undefined;
}
const alias = getAliasForSymbolInContainer(candidate, symbol);
return alias ? candidate : undefined;
return mapDefined(candidates, candidate => getAliasForSymbolInContainer(candidate, symbol) ? candidate : undefined);
function fileSymbolIfFileSymbolExportEqualsContainer(d: Declaration) {
const fileSymbol = getExternalModuleContainer(d);
const exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get(InternalSymbolName.ExportEquals);
return resolveSymbol(exported) === resolveSymbol(container) ? fileSymbol : undefined;
}
}
function getAliasForSymbolInContainer(container: Symbol, symbol: Symbol) {
@@ -2759,6 +2768,56 @@ namespace ts {
return access.accessibility === SymbolAccessibility.Accessible;
}
function isAnySymbolAccessible(symbols: Symbol[] | undefined, enclosingDeclaration: Node, initialSymbol: Symbol, meaning: SymbolFlags, shouldComputeAliasesToMakeVisible: boolean): SymbolAccessibilityResult | undefined {
if (!length(symbols)) return;
let hadAccessibleChain: Symbol | undefined;
for (const symbol of symbols!) {
// Symbol is accessible if it by itself is accessible
const accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false);
if (accessibleSymbolChain) {
hadAccessibleChain = symbol;
const hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible);
if (hasAccessibleDeclarations) {
return hasAccessibleDeclarations;
}
}
else {
if (some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
// Any meaning of a module symbol is always accessible via an `import` type
return {
accessibility: SymbolAccessibility.Accessible
};
}
}
// If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible.
// It could be a qualified symbol and hence verify the path
// e.g.:
// module m {
// export class c {
// }
// }
// const x: typeof m.c
// In the above example when we start with checking if typeof m.c symbol is accessible,
// we are going to see if c can be accessed in scope directly.
// But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible
// It is accessible if the parent m is accessible because then m.c can be accessed through qualification
const parentResult = isAnySymbolAccessible(getContainersOfSymbol(symbol, enclosingDeclaration), enclosingDeclaration, initialSymbol, initialSymbol === symbol ? getQualifiedLeftMeaning(meaning) : meaning, shouldComputeAliasesToMakeVisible);
if (parentResult) {
return parentResult;
}
}
if (hadAccessibleChain) {
return {
accessibility: SymbolAccessibility.NotAccessible,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
errorModuleName: hadAccessibleChain !== initialSymbol ? symbolToString(hadAccessibleChain, enclosingDeclaration, SymbolFlags.Namespace) : undefined,
};
}
}
/**
* Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested
*
@@ -2769,57 +2828,21 @@ namespace ts {
*/
function isSymbolAccessible(symbol: Symbol | undefined, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, shouldComputeAliasesToMakeVisible: boolean): SymbolAccessibilityResult {
if (symbol && enclosingDeclaration) {
const initialSymbol = symbol;
let meaningToLook = meaning;
while (symbol) {
// Symbol is accessible if it by itself is accessible
const accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, /*useOnlyExternalAliasing*/ false);
if (accessibleSymbolChain) {
const hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible);
if (!hasAccessibleDeclarations) {
return {
accessibility: SymbolAccessibility.NotAccessible,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, SymbolFlags.Namespace) : undefined,
};
}
return hasAccessibleDeclarations;
}
else {
if (some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
// Any meaning of a module symbol is always accessible via an `import` type
return {
accessibility: SymbolAccessibility.Accessible
};
}
}
// If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible.
// It could be a qualified symbol and hence verify the path
// e.g.:
// module m {
// export class c {
// }
// }
// const x: typeof m.c
// In the above example when we start with checking if typeof m.c symbol is accessible,
// we are going to see if c can be accessed in scope directly.
// But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible
// It is accessible if the parent m is accessible because then m.c can be accessed through qualification
meaningToLook = getQualifiedLeftMeaning(meaning);
symbol = getContainerOfSymbol(symbol);
const result = isAnySymbolAccessible([symbol], enclosingDeclaration, symbol, meaning, shouldComputeAliasesToMakeVisible);
if (result) {
return result;
}
// This could be a symbol that is not exported in the external module
// or it could be a symbol from different external module that is not aliased and hence cannot be named
const symbolExternalModule = forEach(initialSymbol.declarations, getExternalModuleContainer);
const symbolExternalModule = forEach(symbol.declarations, getExternalModuleContainer);
if (symbolExternalModule) {
const enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration);
if (symbolExternalModule !== enclosingExternalModule) {
// name from different external module that is not visible
return {
accessibility: SymbolAccessibility.CannotBeNamed,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning),
errorModuleName: symbolToString(symbolExternalModule)
};
}
@@ -2828,16 +2851,16 @@ namespace ts {
// Just a local name that is not accessible
return {
accessibility: SymbolAccessibility.NotAccessible,
errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),
errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning),
};
}
return { accessibility: SymbolAccessibility.Accessible };
}
function getExternalModuleContainer(declaration: Node) {
const node = findAncestor(declaration, hasExternalModuleSymbol);
return node && getSymbolOfNode(node);
}
function getExternalModuleContainer(declaration: Node) {
const node = findAncestor(declaration, hasExternalModuleSymbol);
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration: Node) {
@@ -3667,18 +3690,19 @@ namespace ts {
/** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */
function getSymbolChain(symbol: Symbol, meaning: SymbolFlags, endOfChain: boolean): Symbol[] | undefined {
let accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & NodeBuilderFlags.UseOnlyExternalAliasing));
let parentSymbol: Symbol | undefined;
if (!accessibleSymbolChain ||
needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {
// Go up and add our parent.
const parent = getContainerOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
if (parent) {
const parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false);
if (parentChain) {
parentSymbol = parent;
accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);
const parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration);
if (length(parents)) {
for (const parent of parents!) {
const parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false);
if (parentChain) {
accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);
break;
}
}
}
}
@@ -3689,11 +3713,12 @@ namespace ts {
if (
// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
endOfChain ||
// If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.)
(yieldModuleSymbol || !(!parentSymbol && forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol))) &&
// If a parent symbol is an anonymous type, don't write it.
!(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral))) {
// If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.)
if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
return;
}
return [symbol];
}
}
@@ -4255,8 +4280,8 @@ namespace ts {
if (propertyName === TypeSystemPropertyName.ResolvedReturnType) {
return !!(<Signature>target).resolvedReturnType;
}
if (propertyName === TypeSystemPropertyName.ResolvedBaseConstraint) {
const bc = (<TypeParameter | UnionOrIntersectionType>target).resolvedBaseConstraint;
if (propertyName === TypeSystemPropertyName.ImmediateBaseConstraint) {
const bc = (<Type>target).immediateBaseConstraint;
return !!bc && bc !== circularConstraintType;
}
@@ -6854,15 +6879,21 @@ namespace ts {
return type.resolvedBaseConstraint;
function getBaseConstraint(t: Type): Type | undefined {
if (!pushTypeResolution(t, TypeSystemPropertyName.ResolvedBaseConstraint)) {
if (t.immediateBaseConstraint) {
return t.immediateBaseConstraint === noConstraintType ? undefined : t.immediateBaseConstraint;
}
if (!pushTypeResolution(t, TypeSystemPropertyName.ImmediateBaseConstraint)) {
circular = true;
t.immediateBaseConstraint = circularConstraintType;
return undefined;
}
const result = computeBaseConstraint(getSimplifiedType(t));
if (!popTypeResolution()) {
circular = true;
t.immediateBaseConstraint = circularConstraintType;
return undefined;
}
t.immediateBaseConstraint = !result ? noConstraintType : result;
return result;
}
@@ -9264,7 +9295,12 @@ namespace ts {
resolveImportSymbolType(node, links, moduleSymbol, targetMeaning);
}
else {
error(node, targetMeaning === SymbolFlags.Value ? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here, moduleName);
const errorMessage = targetMeaning === SymbolFlags.Value
? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here
: Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;
error(node, errorMessage, moduleName);
links.resolvedSymbol = unknownSymbol;
links.resolvedType = errorType;
}
@@ -14849,7 +14885,7 @@ namespace ts {
const declarationContainer = getControlFlowContainer(declaration);
let flowContainer = getControlFlowContainer(node);
const isOuterVariable = flowContainer !== declarationContainer;
const isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
// When the control flow originates in a function expression or arrow function and we are referencing
// a const variable or parameter from an outer function, we extend the origin of the control flow
// analysis to include the immediately enclosing function.
@@ -14861,7 +14897,7 @@ namespace ts {
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
// declaration container are the same).
const assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget ||
const assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget ||
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & TypeFlags.AnyOrUnknown) !== 0 ||
isInTypeQuery(node) || node.parent.kind === SyntaxKind.ExportSpecifier) ||
node.parent.kind === SyntaxKind.NonNullExpression ||
@@ -19458,7 +19494,8 @@ namespace ts {
function getAssignedClassType(symbol: Symbol) {
const decl = symbol.valueDeclaration;
const assignmentSymbol = decl && decl.parent &&
(isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) ||
(isFunctionDeclaration(decl) && getSymbolOfNode(decl) ||
isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) ||
isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent));
if (assignmentSymbol) {
const prototype = forEach(assignmentSymbol.declarations, getAssignedJavascriptPrototype);
@@ -19592,7 +19629,7 @@ namespace ts {
}
const specifier = node.arguments[0];
const specifierType = checkExpressionCached(specifier);
// Even though multiple arugments is grammatically incorrect, type-check extra arguments for completion
// Even though multiple arguments is grammatically incorrect, type-check extra arguments for completion
for (let i = 1; i < node.arguments.length; ++i) {
checkExpressionCached(node.arguments[i]);
}
@@ -27699,6 +27736,9 @@ namespace ts {
// Initialize global symbol table
let augmentations: ReadonlyArray<StringLiteral | Identifier>[] | undefined;
for (const file of host.getSourceFiles()) {
if (file.redirectInfo) {
continue;
}
if (!isExternalOrCommonJsModule(file)) {
mergeSymbolTable(globals, file.locals!);
}
+1 -1
View File
@@ -971,7 +971,7 @@
"category": "Error",
"code": 1339
},
"Module '{0}' does not refer to a type, but is used as a type here.": {
"Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?": {
"category": "Error",
"code": 1340
},
+11 -9
View File
@@ -272,10 +272,9 @@ namespace ts {
}
function parenthesizeForComputedName(expression: Expression): Expression {
return (isBinaryExpression(expression) && expression.operatorToken.kind === SyntaxKind.CommaToken) ||
expression.kind === SyntaxKind.CommaListExpression ?
createParen(expression) :
expression;
return isCommaSequence(expression)
? createParen(expression)
: expression;
}
export function createComputedPropertyName(expression: Expression) {
@@ -4166,8 +4165,7 @@ namespace ts {
// so in case when comma expression is introduced as a part of previous transformations
// if should be wrapped in parens since comma operator has the lowest precedence
const emittedExpression = skipPartiallyEmittedExpressions(e);
return emittedExpression.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>emittedExpression).operatorToken.kind === SyntaxKind.CommaToken ||
emittedExpression.kind === SyntaxKind.CommaListExpression
return isCommaSequence(emittedExpression)
? createParen(e)
: e;
}
@@ -4185,8 +4183,7 @@ namespace ts {
*/
export function parenthesizeDefaultExpression(e: Expression) {
const check = skipPartiallyEmittedExpressions(e);
let needsParens = check.kind === SyntaxKind.CommaListExpression ||
isBinaryExpression(check) && check.operatorToken.kind === SyntaxKind.CommaToken;
let needsParens = isCommaSequence(check);
if (!needsParens) {
switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) {
case SyntaxKind.ClassExpression:
@@ -4378,13 +4375,18 @@ namespace ts {
}
export function parenthesizeConciseBody(body: ConciseBody): ConciseBody {
if (!isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === SyntaxKind.ObjectLiteralExpression) {
if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === SyntaxKind.ObjectLiteralExpression)) {
return setTextRange(createParen(body), body);
}
return body;
}
export function isCommaSequence(node: Expression): node is BinaryExpression & {operatorToken: Token<SyntaxKind.CommaToken>} | CommaListExpression {
return node.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>node).operatorToken.kind === SyntaxKind.CommaToken ||
node.kind === SyntaxKind.CommaListExpression;
}
export const enum OuterExpressionKinds {
Parentheses = 1 << 0,
Assertions = 1 << 1,
+2 -1
View File
@@ -7655,7 +7655,8 @@ namespace ts {
}
}
function isDeclarationFileName(fileName: string): boolean {
/** @internal */
export function isDeclarationFileName(fileName: string): boolean {
return fileExtensionIs(fileName, Extension.Dts);
}
+7 -3
View File
@@ -2344,7 +2344,7 @@ namespace ts {
const refPath = resolveProjectReferencePath(host, ref);
// An absolute path pointing to the containing directory of the config file
const basePath = getNormalizedAbsolutePath(getDirectoryPath(refPath), host.getCurrentDirectory());
const sourceFile = host.getSourceFile(refPath, ScriptTarget.JSON) as JsonSourceFile;
const sourceFile = host.getSourceFile(refPath, ScriptTarget.JSON) as JsonSourceFile | undefined;
if (sourceFile === undefined) {
return undefined;
}
@@ -2823,10 +2823,14 @@ namespace ts {
};
}
export interface ResolveProjectReferencePathHost {
fileExists(fileName: string): boolean;
}
/**
* Returns the target config filename of a project reference
* Returns the target config filename of a project reference.
* Note: The file might not exist.
*/
export function resolveProjectReferencePath(host: CompilerHost | UpToDateHost, ref: ProjectReference): ResolvedConfigFileName {
export function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName {
if (!host.fileExists(ref.path)) {
return combinePaths(ref.path, "tsconfig.json") as ResolvedConfigFileName;
}
+39 -34
View File
@@ -156,7 +156,6 @@ namespace ts {
sourceMapNames: [],
sourceMapMappings: "",
sourceMapSourcesContent: compilerOptions.inlineSources ? [] : undefined,
sourceMapDecodedMappings: []
};
// Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the
@@ -216,17 +215,6 @@ namespace ts {
sourceMapDataList = undefined!;
}
interface SourceMapSection {
version: 3;
file: string;
sourceRoot?: string;
sources: string[];
names?: string[];
mappings: string;
sourcesContent?: (string | null)[];
sections?: undefined;
}
type SourceMapSectionDefinition =
| { offset: { line: number, column: number }, url: string } // Included for completeness
| { offset: { line: number, column: number }, map: SourceMap };
@@ -299,7 +287,6 @@ namespace ts {
}
lastEncodedSourceMapSpan = lastRecordedSourceMapSpan;
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
}
/**
@@ -393,24 +380,29 @@ namespace ts {
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
const resolvedPathCache = createMap<string>();
sourcemaps.calculateDecodedMappings(originalMap, (raw): void => {
const absolutePathCache = createMap<string>();
const sourcemapIterator = sourcemaps.decodeMappings(originalMap);
for (let { value: raw, done } = sourcemapIterator.next(); !done; { value: raw, done } = sourcemapIterator.next()) {
const pathCacheKey = "" + raw.sourceIndex;
// Apply offsets to each position and fixup source entries
const rawPath = originalMap.sources[raw.sourceIndex];
const relativePath = originalMap.sourceRoot ? combinePaths(originalMap.sourceRoot, rawPath) : rawPath;
const combinedPath = combinePaths(getDirectoryPath(node.sourceMapPath!), relativePath);
if (!resolvedPathCache.has(combinedPath)) {
resolvedPathCache.set(combinedPath, getRelativePathToDirectoryOrUrl(
if (!resolvedPathCache.has(pathCacheKey)) {
const rawPath = originalMap.sources[raw.sourceIndex];
const relativePath = originalMap.sourceRoot ? combinePaths(originalMap.sourceRoot, rawPath) : rawPath;
const combinedPath = combinePaths(getDirectoryPath(node.sourceMapPath!), relativePath);
const resolvedPath = getRelativePathToDirectoryOrUrl(
sourcesDirectoryPath,
combinedPath,
host.getCurrentDirectory(),
host.getCanonicalFileName,
/*isAbsolutePathAnUrl*/ true
));
);
resolvedPathCache.set(pathCacheKey, resolvedPath);
absolutePathCache.set(pathCacheKey, getNormalizedAbsolutePath(resolvedPath, sourcesDirectoryPath));
}
const resolvedPath = resolvedPathCache.get(combinedPath)!;
const absolutePath = getNormalizedAbsolutePath(resolvedPath, sourcesDirectoryPath);
const resolvedPath = resolvedPathCache.get(pathCacheKey)!;
const absolutePath = absolutePathCache.get(pathCacheKey)!;
// tslint:disable-next-line:no-null-keyword
setupSourceEntry(absolutePath, originalMap.sourcesContent ? originalMap.sourcesContent[raw.sourceIndex] : null); // TODO: Lookup content for inlining?
setupSourceEntry(absolutePath, originalMap.sourcesContent ? originalMap.sourcesContent[raw.sourceIndex] : null, resolvedPath); // TODO: Lookup content for inlining?
const newIndex = sourceMapData.sourceMapSources.indexOf(resolvedPath);
// Then reencode all the updated spans into the overall map
encodeLastRecordedSourceMapSpan();
@@ -420,7 +412,7 @@ namespace ts {
emittedColumn: raw.emittedLine === 0 ? (raw.emittedColumn + firstLineColumnOffset) : raw.emittedColumn,
sourceIndex: newIndex,
};
});
}
// And actually emit the text these sourcemaps are for
return emitCallback(hint, node);
}
@@ -519,17 +511,19 @@ namespace ts {
setupSourceEntry(sourceFile.fileName, sourceFile.text);
}
function setupSourceEntry(fileName: string, content: string | null) {
// Add the file to tsFilePaths
// If sourceroot option: Use the relative path corresponding to the common directory path
// otherwise source locations relative to map file location
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
function setupSourceEntry(fileName: string, content: string | null, source?: string) {
if (!source) {
// Add the file to tsFilePaths
// If sourceroot option: Use the relative path corresponding to the common directory path
// otherwise source locations relative to map file location
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
const source = getRelativePathToDirectoryOrUrl(sourcesDirectoryPath,
fileName,
host.getCurrentDirectory(),
host.getCanonicalFileName,
/*isAbsolutePathAnUrl*/ true);
source = getRelativePathToDirectoryOrUrl(sourcesDirectoryPath,
fileName,
host.getCurrentDirectory(),
host.getCanonicalFileName,
/*isAbsolutePathAnUrl*/ true);
}
sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source);
if (sourceMapSourceIndex === -1) {
@@ -577,6 +571,17 @@ namespace ts {
}
}
export interface SourceMapSection {
version: 3;
file: string;
sourceRoot?: string;
sources: string[];
names?: string[];
mappings: string;
sourcesContent?: (string | null)[];
sections?: undefined;
}
const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function base64FormatEncode(inValue: number) {
+1 -1
View File
@@ -190,7 +190,7 @@ namespace ts.sourcemaps {
};
}
export function calculateDecodedMappings<T>(map: SourceMapData, processPosition: (position: RawSourceMapPosition) => T, host?: { log?(s: string): void }): T[] {
function calculateDecodedMappings<T>(map: SourceMapData, processPosition: (position: RawSourceMapPosition) => T, host?: { log?(s: string): void }): T[] {
const decoder = decodeMappings(map);
const positions = arrayFrom(decoder, processPosition);
if (decoder.error) {
+2 -1
View File
@@ -2844,7 +2844,6 @@ namespace ts {
inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list
sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map
sourceMapMappings: string; // Source map's mapping field - encoded source map spans
sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings
}
/** Return code used by getEmitOutput function to indicate status of the function */
@@ -3754,6 +3753,8 @@ namespace ts {
aliasTypeArguments?: ReadonlyArray<Type>; // Alias type arguments (if any)
/* @internal */
wildcardInstantiation?: Type; // Instantiation with type parameters mapped to wildcard type
/* @internal */
immediateBaseConstraint?: Type; // Immediate base constraint cache
}
/* @internal */
+1 -1
View File
@@ -1855,7 +1855,7 @@ namespace ts {
}
export function getRightMostAssignedExpression(node: Expression): Expression {
while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) {
while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) {
node = node.right;
}
return node;
+12 -5
View File
@@ -73,7 +73,7 @@ namespace ts.server {
return { span: this.decodeSpan(codeEdit, fileName), newText: codeEdit.newText };
}
private processRequest<T extends protocol.Request>(command: string, args?: T["arguments"]): T {
private processRequest<T extends protocol.Request>(command: string, args: T["arguments"]): T {
const request: protocol.Request = {
seq: this.sequence,
type: "request",
@@ -278,9 +278,10 @@ namespace ts.server {
const request = this.processRequest<protocol.DefinitionRequest>(CommandNames.DefinitionAndBoundSpan, args);
const response = this.processResponse<protocol.DefinitionInfoAndBoundSpanReponse>(request);
const body = Debug.assertDefined(response.body); // TODO: GH#18217
return {
definitions: response.body!.definitions.map(entry => ({ // TODO: GH#18217
definitions: body.definitions.map(entry => ({
containerKind: ScriptElementKind.unknown,
containerName: "",
fileName: entry.file,
@@ -288,7 +289,7 @@ namespace ts.server {
kind: ScriptElementKind.unknown,
name: ""
})),
textSpan: this.decodeSpan(response.body!.textSpan, request.arguments.file)
textSpan: this.decodeSpan(body.textSpan, request.arguments.file)
};
}
@@ -341,8 +342,10 @@ namespace ts.server {
}));
}
getEmitOutput(_fileName: string): EmitOutput {
return notImplemented();
getEmitOutput(file: string): EmitOutput {
const request = this.processRequest<protocol.EmitOutputRequest>(protocol.CommandTypes.EmitOutput, { file });
const response = this.processResponse<protocol.EmitOutputResponse>(request);
return response.body;
}
getSyntacticDiagnostics(file: string): DiagnosticWithLocation[] {
@@ -716,6 +719,10 @@ namespace ts.server {
throw new Error("cleanupSemanticCache is not available through the server layer.");
}
getSourceMapper(): never {
return notImplemented();
}
dispose(): void {
throw new Error("dispose is not available through the server layer.");
}
+1 -1
View File
@@ -148,7 +148,7 @@ namespace documents {
public static fromUrl(url: string) {
const match = SourceMap._dataURLRegExp.exec(url);
return match ? new SourceMap(/*mapFile*/ undefined, new Buffer(match[1], "base64").toString("utf8")) : undefined;
return match ? new SourceMap(/*mapFile*/ undefined, (Buffer.from ? Buffer.from(match[1], "base64") : new Buffer(match[1], "base64")).toString("utf8")) : undefined;
}
public static fromSource(text: string): SourceMap | undefined {
+39 -25
View File
@@ -1007,7 +1007,7 @@ namespace FourSlash {
// If any of the expected values are undefined, assume that users don't
// care about them.
if (replacementSpan && !TestState.textSpansEqual(replacementSpan, entry.replacementSpan)) {
if (replacementSpan && !ts.textSpansEqual(replacementSpan, entry.replacementSpan)) {
return false;
}
else if (expectedText && text !== expectedText) {
@@ -1644,7 +1644,7 @@ Actual: ${stringify(fullActual)}`);
});
}
public baselineGetEmitOutput(insertResultsIntoVfs?: boolean) {
private getEmitFiles(): ReadonlyArray<FourSlashFile> {
// Find file to be emitted
const emitFiles: FourSlashFile[] = []; // List of FourSlashFile that has emitThisFile flag on
@@ -1661,12 +1661,29 @@ Actual: ${stringify(fullActual)}`);
this.raiseError("No emitThisFile is specified in the test file");
}
return emitFiles;
}
public verifyGetEmitOutput(expectedOutputFiles: ReadonlyArray<string>): void {
const outputFiles = ts.flatMap(this.getEmitFiles(), e => this.languageService.getEmitOutput(e.fileName).outputFiles);
assert.deepEqual(outputFiles.map(f => f.name), expectedOutputFiles);
for (const { name, text } of outputFiles) {
const fromTestFile = this.getFileContent(name);
if (fromTestFile !== text) {
this.raiseError("Emit output is not as expected: " + showTextDiff(fromTestFile, text));
}
}
}
public baselineGetEmitOutput(): void {
Harness.Baseline.runBaseline(
this.testData.globalOptions[MetadataOptionNames.baselineFile],
ts.Debug.assertDefined(this.testData.globalOptions[MetadataOptionNames.baselineFile]),
() => {
let resultString = "";
// Loop through all the emittedFiles and emit them one by one
emitFiles.forEach(emitFile => {
for (const emitFile of this.getEmitFiles()) {
const emitOutput = this.languageService.getEmitOutput(emitFile.fileName);
// Print emitOutputStatus in readable format
resultString += "EmitSkipped: " + emitOutput.emitSkipped + Harness.IO.newLine();
@@ -1692,13 +1709,10 @@ Actual: ${stringify(fullActual)}`);
for (const outputFile of emitOutput.outputFiles) {
const fileName = "FileName : " + outputFile.name + Harness.IO.newLine();
resultString = resultString + fileName + outputFile.text;
if (insertResultsIntoVfs) {
this.languageServiceAdapterHost.addScript(ts.getNormalizedAbsolutePath(outputFile.name, "/"), outputFile.text, /*isRootFile*/ true);
}
resultString = resultString + Harness.IO.newLine() + fileName + outputFile.text;
}
resultString += Harness.IO.newLine();
});
}
return resultString;
});
@@ -2137,11 +2151,10 @@ Actual: ${stringify(fullActual)}`);
this.raiseError("verifyRangesInImplementationList failed - expected to find at least one implementation location but got 0");
}
const duplicate = findDuplicatedElement(implementations, implementationsAreEqual);
const duplicate = findDuplicatedElement(implementations, ts.documentSpansEqual);
if (duplicate) {
const { textSpan, fileName } = duplicate;
const end = textSpan.start + textSpan.length;
this.raiseError(`Duplicate implementations returned for range (${textSpan.start}, ${end}) in ${fileName}`);
this.raiseError(`Duplicate implementations returned for range (${textSpan.start}, ${ts.textSpanEnd(textSpan)}) in ${fileName}`);
}
const ranges = this.getRanges();
@@ -2208,10 +2221,6 @@ Actual: ${stringify(fullActual)}`);
this.raiseError(error);
}
function implementationsAreEqual(a: ImplementationLocationInformation, b: ImplementationLocationInformation) {
return a.fileName === b.fileName && TestState.textSpansEqual(a.textSpan, b.textSpan);
}
function displayPartIsEqualTo(a: ts.SymbolDisplayPart, b: ts.SymbolDisplayPart): boolean {
return a.kind === b.kind && a.text === b.text;
}
@@ -3260,7 +3269,7 @@ Actual: ${stringify(fullActual)}`);
if (spanIndex !== undefined) {
const span = this.getTextSpanForRangeAtIndex(spanIndex);
assert.isTrue(TestState.textSpansEqual(span, item.replacementSpan), this.assertionMessageAtLastKnownMarker(stringify(span) + " does not equal " + stringify(item.replacementSpan) + " replacement span for " + stringify(entryId)));
assert.isTrue(ts.textSpansEqual(span, item.replacementSpan), this.assertionMessageAtLastKnownMarker(stringify(span) + " does not equal " + stringify(item.replacementSpan) + " replacement span for " + stringify(entryId)));
}
eq(item.hasAction, hasAction, "hasAction");
@@ -3346,10 +3355,6 @@ Actual: ${stringify(fullActual)}`);
this.cancellationToken.resetCancelled();
}
private static textSpansEqual(a: ts.TextSpan | undefined, b: ts.TextSpan | undefined): boolean {
return !!a && !!b && a.start === b.start && a.length === b.length;
}
public getEditsForFileRename({ oldPath, newPath, newFileContents }: FourSlashInterface.GetEditsForFileRenameOptions): void {
const test = (fileContents: { readonly [fileName: string]: string }, description: string): void => {
const changes = this.languageService.getEditsForFileRename(oldPath, newPath, this.formatCodeSettings, ts.emptyOptions);
@@ -3551,8 +3556,13 @@ ${code}
function getNonFileNameOptionInObject(optionObject: { [s: string]: string }): string | undefined {
for (const option in optionObject) {
if (option !== MetadataOptionNames.fileName) {
return option;
switch (option) {
case MetadataOptionNames.fileName:
case MetadataOptionNames.baselineFile:
case MetadataOptionNames.emitThisFile:
break;
default:
return option;
}
}
return undefined;
@@ -4270,8 +4280,12 @@ namespace FourSlashInterface {
this.state.baselineCurrentFileNameOrDottedNameSpans();
}
public baselineGetEmitOutput(insertResultsIntoVfs?: boolean) {
this.state.baselineGetEmitOutput(insertResultsIntoVfs);
public getEmitOutput(expectedOutputFiles: ReadonlyArray<string>): void {
this.state.verifyGetEmitOutput(expectedOutputFiles);
}
public baselineGetEmitOutput() {
this.state.baselineGetEmitOutput();
}
public baselineQuickInfo() {
+6 -1
View File
@@ -560,6 +560,9 @@ namespace Harness.LanguageService {
getSourceFile(): ts.SourceFile {
throw new Error("SourceFile can not be marshaled across the shim layer.");
}
getSourceMapper(): never {
return ts.notImplemented();
}
dispose(): void { this.shim.dispose({}); }
}
@@ -707,7 +710,9 @@ namespace Harness.LanguageService {
return ts.sys.getEnvironmentVariable(name);
}
readDirectory() { return ts.notImplemented(); }
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[] {
return this.host.readDirectory(path, extensions, exclude, include, depth);
}
watchFile(): ts.FileWatcher {
return { close: ts.noop };
+2 -1
View File
@@ -305,7 +305,8 @@ namespace Harness.SourceMapRecorder {
}
SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMapData, currentFile);
for (const decodedSourceMapping of sourceMapData.sourceMapDecodedMappings) {
const mapper = ts.sourcemaps.decodeMappings({ mappings: sourceMapData.sourceMapMappings, sources: sourceMapData.sourceMapSources });
for (let { value: decodedSourceMapping, done } = mapper.next(); !done; { value: decodedSourceMapping, done } = mapper.next()) {
const currentSourceFile = program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex])!;
if (currentSourceFile !== prevSourceFile) {
SourceMapSpanWriter.recordNewSourceFileSpan(decodedSourceMapping, currentSourceFile.text);
-4
View File
@@ -63,10 +63,6 @@ namespace utils {
return indentation;
}
export function toUtf8(text: string): string {
return new Buffer(text).toString("utf8");
}
export function getByteOrderMarkLength(text: string): number {
if (text.length >= 1) {
const ch0 = text.charCodeAt(0);
@@ -78,7 +78,9 @@ interface Array<T> {}`
}
export interface SymLink {
/** Location of the symlink. */
path: string;
/** Relative path to the real file. */
symLink: string;
}
+34 -19
View File
@@ -851,7 +851,7 @@ namespace ts.server {
configFileExistenceInfo.exists = false;
this.removeProject(project);
// Reload the configured projects for the open files in the map as they are affectected by this config file
// Reload the configured projects for the open files in the map as they are affected by this config file
// Since the configured project was deleted, we want to reload projects for all the open files including files
// that are not root of the inferred project
this.logConfigFileWatchUpdate(project.getConfigFilePath(), project.canonicalConfigFilePath, configFileExistenceInfo, ConfigFileWatcherStatus.ReloadingFiles);
@@ -1171,7 +1171,7 @@ namespace ts.server {
*/
private stopWatchingConfigFilesForClosedScriptInfo(info: ScriptInfo) {
Debug.assert(!info.isScriptOpen());
this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => {
this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => {
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
if (configFileExistenceInfo) {
const infoIsRootOfInferredProject = configFileExistenceInfo.openFilesImpactedByConfigFile.get(info.path);
@@ -1205,7 +1205,7 @@ namespace ts.server {
/* @internal */
startWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
Debug.assert(info.isScriptOpen());
this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => {
this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => {
let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
if (!configFileExistenceInfo) {
// Create the cache
@@ -1233,7 +1233,7 @@ namespace ts.server {
*/
/* @internal */
stopWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) {
this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => {
this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => {
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
if (configFileExistenceInfo && configFileExistenceInfo.openFilesImpactedByConfigFile.has(info.path)) {
Debug.assert(info.isScriptOpen());
@@ -1256,18 +1256,18 @@ namespace ts.server {
* The server must start searching from the directory containing
* the newly opened file.
*/
private forEachConfigFileLocation(info: ScriptInfo, action: (configFileName: NormalizedPath, canonicalConfigFilePath: string) => boolean | void) {
private forEachConfigFileLocation(info: ScriptInfo, infoShouldBeOpen: boolean, action: (configFileName: NormalizedPath, canonicalConfigFilePath: string) => boolean | void) {
if (this.syntaxOnly) {
return undefined;
}
Debug.assert(this.openFiles.has(info.path));
Debug.assert(!infoShouldBeOpen || this.openFiles.has(info.path));
const projectRootPath = this.openFiles.get(info.path);
let searchPath = asNormalizedPath(getDirectoryPath(info.fileName));
const isSearchPathInProjectRoot = () => containsPath(projectRootPath!, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames);
// If projectRootPath doesnt contain info.path, then do normal search for config file
// If projectRootPath doesn't contain info.path, then do normal search for config file
const anySearchPathOk = !projectRootPath || !isSearchPathInProjectRoot();
do {
const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName);
@@ -1301,13 +1301,11 @@ namespace ts.server {
* The server must start searching from the directory containing
* the newly opened file.
*/
private getConfigFileNameForFile(info: ScriptInfo) {
Debug.assert(info.isScriptOpen());
private getConfigFileNameForFile(info: ScriptInfo, infoShouldBeOpen: boolean) {
if (infoShouldBeOpen) Debug.assert(info.isScriptOpen());
this.logger.info(`Search path: ${getDirectoryPath(info.fileName)}`);
const configFileName = this.forEachConfigFileLocation(info,
(configFileName, canonicalConfigFilePath) =>
this.configFileExists(configFileName, canonicalConfigFilePath, info)
);
const configFileName = this.forEachConfigFileLocation(info, infoShouldBeOpen, (configFileName, canonicalConfigFilePath) =>
this.configFileExists(configFileName, canonicalConfigFilePath, info));
if (configFileName) {
this.logger.info(`For info: ${info.fileName} :: Config file name: ${configFileName}`);
}
@@ -1840,13 +1838,11 @@ namespace ts.server {
}
}
/*@internal*/
getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined, hostToQueryFileExistsOn: DirectoryStructureHost | undefined) {
private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined, hostToQueryFileExistsOn: DirectoryStructureHost | undefined) {
return this.getOrCreateScriptInfoWorker(fileName, currentDirectory, /*openedByClient*/ false, /*fileContent*/ undefined, scriptKind, hasMixedContent, hostToQueryFileExistsOn);
}
/*@internal*/
getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, fileContent: string | undefined, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined) {
private getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, fileContent: string | undefined, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined) {
return this.getOrCreateScriptInfoWorker(fileName, currentDirectory, /*openedByClient*/ true, fileContent, scriptKind, hasMixedContent);
}
@@ -1989,7 +1985,7 @@ namespace ts.server {
// we first detect if there is already a configured project created for it: if so,
// we re- read the tsconfig file content and update the project only if we havent already done so
// otherwise we create a new one.
const configFileName = this.getConfigFileNameForFile(info);
const configFileName = this.getConfigFileNameForFile(info, /*infoShouldBeOpen*/ true);
if (configFileName) {
const project = this.findConfiguredProjectByProjectName(configFileName);
if (!project) {
@@ -2077,6 +2073,24 @@ namespace ts.server {
return this.openClientFileWithNormalizedPath(toNormalizedPath(fileName), fileContent, scriptKind, /*hasMixedContent*/ false, projectRootPath ? toNormalizedPath(projectRootPath) : undefined);
}
/** @internal */
getProjectForFileWithoutOpening(fileName: NormalizedPath): { readonly scriptInfo: ScriptInfo, readonly projects: ReadonlyArray<Project> } | undefined {
const scriptInfo = this.filenameToScriptInfo.get(fileName) ||
this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName, this.currentDirectory, /*fileContent*/ undefined, /*scriptKind*/ undefined, /*hasMixedContent*/ undefined);
if (!scriptInfo) return undefined;
if (scriptInfo.containingProjects.length) {
return { scriptInfo, projects: scriptInfo.containingProjects };
}
const configFileName = this.getConfigFileNameForFile(scriptInfo, /*infoShouldBeOpen*/ false);
const project = configFileName === undefined ? undefined : this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProject(configFileName);
return project && project.containsScriptInfo(scriptInfo) ? { scriptInfo, projects: [project] } : undefined;
}
/** @internal */
fileExists(fileName: NormalizedPath): boolean {
return this.filenameToScriptInfo.has(fileName) || this.host.fileExists(fileName);
}
private findExternalProjectContainingOpenScriptInfo(info: ScriptInfo): ExternalProject | undefined {
return find(this.externalProjects, proj => {
// Ensure project structure is up-to-date to check if info is present in external project
@@ -2090,10 +2104,11 @@ namespace ts.server {
let configFileErrors: ReadonlyArray<Diagnostic> | undefined;
const info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent)!; // TODO: GH#18217
this.openFiles.set(info.path, projectRootPath);
let project: ConfiguredProject | ExternalProject | undefined = this.findExternalProjectContainingOpenScriptInfo(info);
if (!project && !this.syntaxOnly) { // Checking syntaxOnly is an optimization
configFileName = this.getConfigFileNameForFile(info);
configFileName = this.getConfigFileNameForFile(info, /*infoShouldBeOpen*/ true);
if (configFileName) {
project = this.findConfiguredProjectByProjectName(configFileName);
if (!project) {
+9 -4
View File
@@ -271,8 +271,8 @@ namespace ts.server {
return this.projectStateVersion.toString();
}
getProjectReferences(): ReadonlyArray<ProjectReference> | undefined {
return undefined;
getProjectReferences(): ReadonlyArray<ProjectReference> {
return emptyArray;
}
getScriptFileNames() {
@@ -461,6 +461,11 @@ namespace ts.server {
return this.languageService;
}
/** @internal */
getSourceMapper(): SourceMapper {
return this.getLanguageService().getSourceMapper();
}
private shouldEmitFile(scriptInfo: ScriptInfo) {
return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent();
}
@@ -1351,8 +1356,8 @@ namespace ts.server {
return asNormalizedPath(this.getProjectName());
}
getProjectReferences(): ReadonlyArray<ProjectReference> | undefined {
return this.projectReferences;
getProjectReferences(): ReadonlyArray<ProjectReference> {
return this.projectReferences || emptyArray;
}
updateReferences(refs: ReadonlyArray<ProjectReference> | undefined) {
+29 -1
View File
@@ -34,6 +34,8 @@ namespace ts.server.protocol {
Implementation = "implementation",
/* @internal */
ImplementationFull = "implementation-full",
/* @internal */
EmitOutput = "emit-output",
Exit = "exit",
Format = "format",
Formatonkey = "formatonkey",
@@ -794,6 +796,21 @@ namespace ts.server.protocol {
command: CommandTypes.Definition;
}
export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
readonly command: CommandTypes.DefinitionAndBoundSpan;
}
export interface DefinitionAndBoundSpanResponse extends Response {
readonly body: DefinitionInfoAndBoundSpan;
}
/** @internal */
export interface EmitOutputRequest extends FileRequest {}
/** @internal */
export interface EmitOutputResponse extends Response {
readonly body: EmitOutput;
}
/**
* Go to type request; value of command field is
* "typeDefinition". Return response giving the file locations that
@@ -1056,6 +1073,17 @@ namespace ts.server.protocol {
arguments: RenameRequestArgs;
}
/* @internal */
export interface RenameFullRequest extends FileLocationRequest {
readonly command: CommandTypes.RenameLocationsFull;
readonly arguments: RenameRequestArgs;
}
/* @internal */
export interface RenameFullResponse extends Response {
readonly body: ReadonlyArray<RenameLocation>;
}
/**
* Information about the item to be renamed.
*/
@@ -1246,7 +1274,7 @@ namespace ts.server.protocol {
/* @internal */
export interface ProjectFiles {
/**
* Information abount project verison
* Information about project verison
*/
info?: ProjectVersionInfo;
/**
+287 -273
View File
@@ -42,31 +42,6 @@ namespace ts.server {
return false;
}
interface FileStart {
file: string;
start: protocol.Location;
}
function compareNumber(a: number, b: number) {
return a - b;
}
function compareFileStart(a: FileStart, b: FileStart) {
if (a.file < b.file) {
return -1;
}
else if (a.file === b.file) {
const n = compareNumber(a.start.line, b.start.line);
if (n === 0) {
return compareNumber(a.start.offset, b.start.offset);
}
else return n;
}
else {
return 1;
}
}
function formatDiag(fileName: NormalizedPath, project: Project, diag: Diagnostic): protocol.Diagnostic {
const scriptInfo = project.getScriptInfoForNormalizedPath(fileName)!; // TODO: GH#18217
return {
@@ -279,8 +254,8 @@ namespace ts.server {
}
type Projects = ReadonlyArray<Project> | {
projects: ReadonlyArray<Project>;
symLinkedProjects: MultiMap<Project>;
readonly projects: ReadonlyArray<Project>;
readonly symLinkedProjects: MultiMap<Project>;
};
function isProjectsArray(projects: Projects): projects is ReadonlyArray<Project> {
@@ -290,7 +265,14 @@ namespace ts.server {
/**
* This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project.
*/
function combineProjectOutput<T, U>(defaultValue: T, getValue: (path: Path) => T, projects: Projects, action: (project: Project, value: T) => ReadonlyArray<U> | U | undefined, comparer?: (a: U, b: U) => number, areEqual?: (a: U, b: U) => boolean) {
function combineProjectOutput<T, U>(
defaultValue: T,
getValue: (path: Path) => T,
projects: Projects,
action: (project: Project, value: T) => ReadonlyArray<U> | U | undefined,
comparer?: (a: U, b: U) => number,
areEqual?: (a: U, b: U) => boolean,
): U[] {
const outputs = flatMap(isProjectsArray(projects) ? projects : projects.projects, project => action(project, defaultValue));
if (!isProjectsArray(projects) && projects.symLinkedProjects) {
projects.symLinkedProjects.forEach((projects, path) => {
@@ -304,6 +286,150 @@ namespace ts.server {
: deduplicate(outputs, areEqual);
}
function combineProjectOutputWhileOpeningReferencedProjects<T>(
projects: Projects,
projectService: ProjectService,
action: (project: Project) => ReadonlyArray<T>,
getLocation: (t: T) => sourcemaps.SourceMappableLocation,
resultsEqual: (a: T, b: T) => boolean,
): T[] {
const outputs: T[] = [];
combineProjectOutputWorker(projects, <sourcemaps.SourceMappableLocation><any>undefined, projectService, ({ project }, tryAddToTodo) => {
for (const output of action(project)) {
if (!contains(outputs, output, resultsEqual) && !tryAddToTodo(project, getLocation(output))) {
outputs.push(output);
}
}
});
return outputs;
}
function combineProjectOutputForRenameLocations(projects: Projects, initialLocation: sourcemaps.SourceMappableLocation, projectService: ProjectService, findInStrings: boolean, findInComments: boolean): ReadonlyArray<RenameLocation> {
const outputs: RenameLocation[] = [];
combineProjectOutputWorker(projects, initialLocation, projectService, ({ project, location }, tryAddToTodo) => {
for (const output of project.getLanguageService().findRenameLocations(location.fileName, location.position, findInStrings, findInComments) || emptyArray) {
if (!contains(outputs, output, documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
outputs.push(output);
}
}
});
return outputs;
}
function combineProjectOutputForReferences(projects: Projects, initialLocation: sourcemaps.SourceMappableLocation, projectService: ProjectService): ReadonlyArray<ReferencedSymbol> {
const outputs: ReferencedSymbol[] = [];
combineProjectOutputWorker(projects, initialLocation, projectService, ({ project, location }, tryAddToTodo) => {
for (const outputReferencedSymbol of project.getLanguageService().findReferences(location.fileName, location.position) || emptyArray) {
let symbolToAddTo = find(outputs, o => documentSpansEqual(o.definition, outputReferencedSymbol.definition));
if (!symbolToAddTo) {
symbolToAddTo = { definition: outputReferencedSymbol.definition, references: [] };
outputs.push(symbolToAddTo);
}
for (const ref of outputReferencedSymbol.references) {
if (!contains(symbolToAddTo.references, ref, documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(ref))) {
symbolToAddTo.references.push(ref);
}
}
}
});
return outputs.filter(o => o.references.length !== 0);
}
interface ProjectAndLocation {
readonly project: Project;
readonly location: sourcemaps.SourceMappableLocation;
}
interface ToDoAndSeenProjects {
readonly toDo: ProjectAndLocation[];
readonly seenProjects: Map<true>;
}
function combineProjectOutputWorker(
projects: Projects,
initialLocation: sourcemaps.SourceMappableLocation,
projectService: ProjectService,
cb: (where: ProjectAndLocation, getMappedLocation: (project: Project, location: sourcemaps.SourceMappableLocation) => boolean) => void,
): void {
let toDoAndSeenProjects: ToDoAndSeenProjects | undefined;
for (const project of isProjectsArray(projects) ? projects : projects.projects) {
toDoAndSeenProjects = callbackProjectAndLocation(projects, { project, location: initialLocation }, projectService, toDoAndSeenProjects, cb);
}
if (!isArray(projects) && projects.symLinkedProjects) {
projects.symLinkedProjects.forEach((symlinkedProjects, path) => {
for (const project of symlinkedProjects) {
toDoAndSeenProjects = callbackProjectAndLocation(projects, { project, location: { fileName: path, position: initialLocation.position } }, projectService, toDoAndSeenProjects, cb);
}
});
}
while (toDoAndSeenProjects && toDoAndSeenProjects.toDo.length) {
toDoAndSeenProjects = callbackProjectAndLocation(projects, Debug.assertDefined(toDoAndSeenProjects.toDo.pop()), projectService, toDoAndSeenProjects, cb);
}
}
function callbackProjectAndLocation(
originalProjects: Projects, // For lazily populating seenProjects
projectAndLocation: ProjectAndLocation,
projectService: ProjectService,
toDoAndSeenProjects: ToDoAndSeenProjects | undefined,
cb: (where: ProjectAndLocation, getMappedLocation: (project: Project, location: sourcemaps.SourceMappableLocation) => boolean) => void,
): ToDoAndSeenProjects | undefined {
if (projectAndLocation.project.getCancellationToken().isCancellationRequested()) return undefined; // Skip rest of toDo if cancelled
cb(projectAndLocation, (project, location) => {
const originalLocation = project.getSourceMapper().tryGetOriginalLocation(location);
if (!originalLocation) return false;
const originalProjectAndScriptInfo = projectService.getProjectForFileWithoutOpening(toNormalizedPath(originalLocation.fileName));
if (!originalProjectAndScriptInfo) return false;
if (originalProjectAndScriptInfo) {
if (toDoAndSeenProjects === undefined) {
toDoAndSeenProjects = { toDo: [], seenProjects: createMap<true>() };
for (const project of isProjectsArray(originalProjects) ? originalProjects : originalProjects.projects) {
toDoAndSeenProjects.seenProjects.set(project.projectName, true);
}
if (!isArray(originalProjects) && originalProjects.symLinkedProjects) {
originalProjects.symLinkedProjects.forEach(symlinkedProjects => {
for (const project of symlinkedProjects) {
toDoAndSeenProjects!.seenProjects.set(project.projectName, true);
}
});
}
}
for (const project of originalProjectAndScriptInfo.projects) {
addToTodo({ project, location: originalLocation }, toDoAndSeenProjects);
}
const symlinkedProjectsMap = projectService.getSymlinkedProjects(originalProjectAndScriptInfo.scriptInfo);
if (symlinkedProjectsMap) {
symlinkedProjectsMap.forEach((symlinkedProjects) => {
for (const symlinkedProject of symlinkedProjects) addToTodo({ project: symlinkedProject, location: originalLocation }, toDoAndSeenProjects!);
});
}
}
return true;
});
return toDoAndSeenProjects;
}
function addToTodo(projectAndLocation: ProjectAndLocation, { seenProjects, toDo }: ToDoAndSeenProjects): void {
if (addToSeen(seenProjects, projectAndLocation.project.projectName)) toDo.push(projectAndLocation);
}
function documentSpanLocation({ fileName, textSpan }: DocumentSpan): sourcemaps.SourceMappableLocation {
return { fileName, position: textSpan.start };
}
function getMappedLocation(location: sourcemaps.SourceMappableLocation, projectService: ProjectService, project: Project): sourcemaps.SourceMappableLocation | undefined {
const mapsTo = project.getSourceMapper().tryGetOriginalLocation(location);
return mapsTo && projectService.fileExists(toNormalizedPath(mapsTo.fileName)) ? mapsTo : undefined;
}
export interface SessionOptions {
host: ServerHost;
cancellationToken: ServerCancellationToken;
@@ -690,46 +816,64 @@ namespace ts.server {
private getDefinition(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.FileSpan> | ReadonlyArray<DefinitionInfo> {
const { file, project } = this.getFileAndProject(args);
const position = this.getPositionInFile(args, file);
const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getDefinitionAtPosition(file, position) || emptyArray, project);
return simplifiedResult ? this.mapDefinitionInfo(definitions, project) : definitions.map(Session.mapToOriginalLocation);
}
const definitions = project.getLanguageService().getDefinitionAtPosition(file, position);
if (!definitions) {
return emptyArray;
}
if (simplifiedResult) {
return this.mapDefinitionInfo(definitions, project);
}
return definitions.map(Session.mapToOriginalLocation);
private mapDefinitionInfoLocations(definitions: ReadonlyArray<DefinitionInfo>, project: Project): ReadonlyArray<DefinitionInfo> {
return definitions.map((info): DefinitionInfo => {
const newLoc = getMappedLocation(documentSpanLocation(info), this.projectService, project);
return !newLoc ? info : {
containerKind: info.containerKind,
containerName: info.containerName,
fileName: newLoc.fileName,
kind: info.kind,
name: info.name,
textSpan: {
start: newLoc.position,
length: info.textSpan.length
},
originalFileName: info.fileName,
originalTextSpan: info.textSpan,
};
});
}
private getDefinitionAndBoundSpan(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.DefinitionInfoAndBoundSpan | DefinitionInfoAndBoundSpan {
const { file, project } = this.getFileAndProject(args);
const position = this.getPositionInFile(args, file);
const scriptInfo = project.getScriptInfo(file)!;
const scriptInfo = Debug.assertDefined(project.getScriptInfo(file));
const definitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position);
const unmappedDefinitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position);
if (!definitionAndBoundSpan || !definitionAndBoundSpan.definitions) {
if (!unmappedDefinitionAndBoundSpan || !unmappedDefinitionAndBoundSpan.definitions) {
return {
definitions: emptyArray,
textSpan: undefined! // TODO: GH#18217
};
}
const definitions = this.mapDefinitionInfoLocations(unmappedDefinitionAndBoundSpan.definitions, project);
const { textSpan } = unmappedDefinitionAndBoundSpan;
if (simplifiedResult) {
return {
definitions: this.mapDefinitionInfo(definitionAndBoundSpan.definitions, project),
textSpan: this.toLocationTextSpan(definitionAndBoundSpan.textSpan, scriptInfo)
definitions: this.mapDefinitionInfo(definitions, project),
textSpan: this.toLocationTextSpan(textSpan, scriptInfo)
};
}
return {
...definitionAndBoundSpan,
definitions: definitionAndBoundSpan.definitions.map(Session.mapToOriginalLocation)
definitions: definitions.map(Session.mapToOriginalLocation),
textSpan,
};
}
private getEmitOutput(args: protocol.FileRequestArgs): EmitOutput {
const { file, project } = this.getFileAndProject(args);
return project.getLanguageService().getEmitOutput(file);
}
private mapDefinitionInfo(definitions: ReadonlyArray<DefinitionInfo>, project: Project): ReadonlyArray<protocol.FileSpan> {
return definitions.map(def => this.toFileSpan(def.fileName, def.textSpan, project));
}
@@ -771,21 +915,31 @@ namespace ts.server {
const { file, project } = this.getFileAndProject(args);
const position = this.getPositionInFile(args, file);
const definitions = project.getLanguageService().getTypeDefinitionAtPosition(file, position);
if (!definitions) {
return emptyArray;
}
const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getTypeDefinitionAtPosition(file, position) || emptyArray, project);
return this.mapDefinitionInfo(definitions, project);
}
private mapImplementationLocations(implementations: ReadonlyArray<ImplementationLocation>, project: Project): ReadonlyArray<ImplementationLocation> {
return implementations.map((info): ImplementationLocation => {
const newLoc = getMappedLocation(documentSpanLocation(info), this.projectService, project);
return !newLoc ? info : {
fileName: newLoc.fileName,
kind: info.kind,
displayParts: info.displayParts,
textSpan: {
start: newLoc.position,
length: info.textSpan.length
},
originalFileName: info.fileName,
originalTextSpan: info.textSpan,
};
});
}
private getImplementation(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.FileSpan> | ReadonlyArray<ImplementationLocation> {
const { file, project } = this.getFileAndProject(args);
const position = this.getPositionInFile(args, file);
const implementations = project.getLanguageService().getImplementationAtPosition(file, position);
if (!implementations) {
return emptyArray;
}
const implementations = this.mapImplementationLocations(project.getLanguageService().getImplementationAtPosition(file, position) || emptyArray, project);
if (simplifiedResult) {
return implementations.map(({ fileName, textSpan }) => this.toFileSpan(fileName, textSpan, project));
}
@@ -948,179 +1102,59 @@ namespace ts.server {
return info.getDefaultProject();
}
private getRenameLocations(args: protocol.RenameRequestArgs, simplifiedResult: boolean): protocol.RenameResponseBody | ReadonlyArray<RenameLocation> | undefined {
private getRenameLocations(args: protocol.RenameRequestArgs, simplifiedResult: boolean): protocol.RenameResponseBody | ReadonlyArray<RenameLocation> {
const file = toNormalizedPath(args.file);
const position = this.getPositionInFile(args, file);
const projects = this.getProjects(args);
if (simplifiedResult) {
const defaultProject = this.getDefaultProject(args);
// The rename info should be the same for every project
const renameInfo = defaultProject.getLanguageService().getRenameInfo(file, position);
if (!renameInfo) {
return undefined;
}
const locations = combineProjectOutputForRenameLocations(projects, { fileName: args.file, position }, this.projectService, !!args.findInStrings, !!args.findInComments);
if (!simplifiedResult) return locations;
if (!renameInfo.canRename) {
return {
info: renameInfo,
locs: emptyArray
};
}
const defaultProject = this.getDefaultProject(args);
const renameInfo = Session.mapRenameInfo(defaultProject.getLanguageService().getRenameInfo(file, position));
return { info: renameInfo, locs: this.toSpanGroups(locations) };
}
const fileSpans = combineProjectOutput(
file,
path => this.projectService.getScriptInfoForPath(path)!.fileName,
projects,
(project, file) => {
const renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings!, args.findInComments!);
if (!renameLocations) {
return emptyArray;
}
// strips 'triggerSpan'
private static mapRenameInfo({ canRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers }: RenameInfo): protocol.RenameInfo {
return { canRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers };
}
return renameLocations.map(location => {
const locationScriptInfo = project.getScriptInfo(location.fileName)!;
return {
file: location.fileName,
start: locationScriptInfo.positionToLineOffset(location.textSpan.start),
end: locationScriptInfo.positionToLineOffset(textSpanEnd(location.textSpan)),
};
});
},
compareRenameLocation,
(a, b) => a.file === b.file && a.start.line === b.start.line && a.start.offset === b.start.offset
);
const locs: protocol.SpanGroup[] = [];
for (const cur of fileSpans) {
let curFileAccum: protocol.SpanGroup | undefined;
if (locs.length > 0) {
curFileAccum = locs[locs.length - 1];
if (curFileAccum.file !== cur.file) {
curFileAccum = undefined;
}
}
if (!curFileAccum) {
curFileAccum = { file: cur.file, locs: [] };
locs.push(curFileAccum);
}
curFileAccum.locs.push({ start: cur.start, end: cur.end });
}
return { info: renameInfo, locs };
}
else {
return combineProjectOutput(
file,
path => this.projectService.getScriptInfoForPath(path)!.fileName,
projects,
(p, file) => p.getLanguageService().findRenameLocations(file, position, args.findInStrings!, args.findInComments!),
/*comparer*/ undefined,
renameLocationIsEqualTo
);
}
function renameLocationIsEqualTo(a: RenameLocation, b: RenameLocation) {
if (a === b) {
return true;
}
if (!a || !b) {
return false;
}
return a.fileName === b.fileName &&
a.textSpan.start === b.textSpan.start &&
a.textSpan.length === b.textSpan.length;
}
function compareRenameLocation(a: protocol.FileSpan, b: protocol.FileSpan) {
if (a.file < b.file) {
return -1;
}
else if (a.file > b.file) {
return 1;
}
else {
// reverse sort assuming no overlap
if (a.start.line < b.start.line) {
return 1;
}
else if (a.start.line > b.start.line) {
return -1;
}
else {
return b.start.offset - a.start.offset;
}
}
private toSpanGroups(locations: ReadonlyArray<RenameLocation>): ReadonlyArray<protocol.SpanGroup> {
const map = createMap<protocol.SpanGroup>();
for (const { fileName, textSpan } of locations) {
let group = map.get(fileName);
if (!group) map.set(fileName, group = { file: fileName, locs: [] });
group.locs.push(this.toLocationTextSpan(textSpan, Debug.assertDefined(this.projectService.getScriptInfo(fileName))));
}
return arrayFrom(map.values());
}
private getReferences(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.ReferencesResponseBody | undefined | ReadonlyArray<ReferencedSymbol> {
const file = toNormalizedPath(args.file);
const projects = this.getProjects(args);
const position = this.getPositionInFile(args, file);
const references = combineProjectOutputForReferences(projects, { fileName: args.file, position }, this.projectService);
const defaultProject = this.getDefaultProject(args);
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file)!;
const position = this.getPosition(args, scriptInfo);
if (simplifiedResult) {
const defaultProject = this.getDefaultProject(args);
const scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file)!;
const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position);
const displayString = nameInfo ? displayPartsToString(nameInfo.displayParts) : "";
const symbolDisplayString = nameInfo ? displayPartsToString(nameInfo.displayParts) : "";
const nameSpan = nameInfo && nameInfo.textSpan;
const nameColStart = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0;
const nameText = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, textSpanEnd(nameSpan)) : "";
const refs = combineProjectOutput<NormalizedPath, protocol.ReferencesResponseItem>(
file,
path => this.projectService.getScriptInfoForPath(path)!.fileName,
projects,
(project, file) => {
const references = project.getLanguageService().getReferencesAtPosition(file, position);
if (!references) {
return emptyArray;
}
return references.map(ref => {
const refScriptInfo = project.getScriptInfo(ref.fileName)!;
const start = refScriptInfo.positionToLineOffset(ref.textSpan.start);
const refLineSpan = refScriptInfo.lineToTextSpan(start.line - 1);
const lineText = refScriptInfo.getSnapshot().getText(refLineSpan.start, textSpanEnd(refLineSpan)).replace(/\r|\n/g, "");
return {
file: ref.fileName,
start,
lineText,
end: refScriptInfo.positionToLineOffset(textSpanEnd(ref.textSpan)),
isWriteAccess: ref.isWriteAccess,
isDefinition: ref.isDefinition
};
});
},
compareFileStart,
areReferencesResponseItemsForTheSameLocation
);
return {
refs,
symbolName: nameText,
symbolStartOffset: nameColStart,
symbolDisplayString: displayString
};
const symbolStartOffset = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0;
const symbolName = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, textSpanEnd(nameSpan)) : "";
const refs: protocol.ReferencesResponseItem[] = flatMap(references, referencedSymbol =>
referencedSymbol.references.map(({ fileName, textSpan, isWriteAccess, isDefinition }): protocol.ReferencesResponseItem => {
const scriptInfo = Debug.assertDefined(this.projectService.getScriptInfo(fileName));
const lineText = scriptInfo.getSnapshot().getText(textSpan.start, textSpanEnd(textSpan));
return { ...toFileSpan(fileName, textSpan, scriptInfo), lineText, isWriteAccess, isDefinition };
}));
const result: protocol.ReferencesResponseBody = { refs, symbolName, symbolStartOffset, symbolDisplayString };
return result;
}
else {
return combineProjectOutput(
file,
path => this.projectService.getScriptInfoForPath(path)!.fileName,
projects,
(project, file) => project.getLanguageService().findReferences(file, position),
/*comparer*/ undefined,
equateValues
);
}
function areReferencesResponseItemsForTheSameLocation(a: protocol.ReferencesResponseItem, b: protocol.ReferencesResponseItem) {
if (a && b) {
return a.file === b.file &&
a.start === b.start &&
a.end === b.end;
}
return false;
return references;
}
}
@@ -1568,63 +1602,45 @@ namespace ts.server {
}
private getNavigateToItems(args: protocol.NavtoRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.NavtoItem> | ReadonlyArray<NavigateToItem> {
const projects = this.getProjects(args);
const full = this.getFullNavigateToItems(args);
return !simplifiedResult ? full : full.map((navItem) => {
const { file, project } = this.getFileAndProject({ file: navItem.fileName });
const scriptInfo = project.getScriptInfo(file)!;
const bakedItem: protocol.NavtoItem = {
name: navItem.name,
kind: navItem.kind,
isCaseSensitive: navItem.isCaseSensitive,
matchKind: navItem.matchKind,
file: navItem.fileName,
start: scriptInfo.positionToLineOffset(navItem.textSpan.start),
end: scriptInfo.positionToLineOffset(textSpanEnd(navItem.textSpan))
};
if (navItem.kindModifiers && (navItem.kindModifiers !== "")) {
bakedItem.kindModifiers = navItem.kindModifiers;
}
if (navItem.containerName && (navItem.containerName.length > 0)) {
bakedItem.containerName = navItem.containerName;
}
if (navItem.containerKind && (navItem.containerKind.length > 0)) {
bakedItem.containerKind = navItem.containerKind;
}
return bakedItem;
});
}
const fileName = args.currentFileOnly ? args.file && normalizeSlashes(args.file) : undefined;
if (simplifiedResult) {
return combineProjectOutput(
fileName,
() => undefined,
projects,
(project, file) => {
if (fileName && !file) {
return undefined;
}
const navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject());
if (!navItems) {
return emptyArray;
}
return navItems.map((navItem) => {
const scriptInfo = project.getScriptInfo(navItem.fileName)!;
const bakedItem: protocol.NavtoItem = {
name: navItem.name,
kind: navItem.kind,
isCaseSensitive: navItem.isCaseSensitive,
matchKind: navItem.matchKind,
file: navItem.fileName,
start: scriptInfo.positionToLineOffset(navItem.textSpan.start),
end: scriptInfo.positionToLineOffset(textSpanEnd(navItem.textSpan))
};
if (navItem.kindModifiers && (navItem.kindModifiers !== "")) {
bakedItem.kindModifiers = navItem.kindModifiers;
}
if (navItem.containerName && (navItem.containerName.length > 0)) {
bakedItem.containerName = navItem.containerName;
}
if (navItem.containerKind && (navItem.containerKind.length > 0)) {
bakedItem.containerKind = navItem.containerKind;
}
return bakedItem;
});
},
/*comparer*/ undefined,
areNavToItemsForTheSameLocation
);
private getFullNavigateToItems(args: protocol.NavtoRequestArgs): ReadonlyArray<NavigateToItem> {
const { currentFileOnly, searchValue, maxResultCount } = args;
if (currentFileOnly) {
const { file, project } = this.getFileAndProject(args);
return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file);
}
else {
return combineProjectOutput(
fileName,
() => undefined,
projects,
(project, file) => {
if (fileName && !file) {
return undefined;
}
return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject());
},
/*comparer*/ undefined,
return combineProjectOutputWhileOpeningReferencedProjects<NavigateToItem>(
this.getProjects(args),
this.projectService,
project =>
project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()),
documentSpanLocation,
navigateToItemIsEqualTo);
}
@@ -1646,15 +1662,6 @@ namespace ts.server {
a.textSpan.start === b.textSpan.start &&
a.textSpan.length === b.textSpan.length;
}
function areNavToItemsForTheSameLocation(a: protocol.NavtoItem, b: protocol.NavtoItem) {
if (a && b) {
return a.file === b.file &&
a.start === b.start &&
a.end === b.end;
}
return false;
}
}
private getSupportedCodeFixes(): string[] {
@@ -1976,6 +1983,9 @@ namespace ts.server {
[CommandNames.DefinitionAndBoundSpanFull]: (request: protocol.DefinitionRequest) => {
return this.requiredResponse(this.getDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.EmitOutput]: (request: protocol.EmitOutputRequest) => {
return this.requiredResponse(this.getEmitOutput(request.arguments));
},
[CommandNames.TypeDefinition]: (request: protocol.FileLocationRequest) => {
return this.requiredResponse(this.getTypeDefinition(request.arguments));
},
@@ -1991,10 +2001,10 @@ namespace ts.server {
[CommandNames.ReferencesFull]: (request: protocol.FileLocationRequest) => {
return this.requiredResponse(this.getReferences(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.Rename]: (request: protocol.Request) => {
[CommandNames.Rename]: (request: protocol.RenameRequest) => {
return this.requiredResponse(this.getRenameLocations(request.arguments, /*simplifiedResult*/ true));
},
[CommandNames.RenameLocationsFull]: (request: protocol.RenameRequest) => {
[CommandNames.RenameLocationsFull]: (request: protocol.RenameFullRequest) => {
return this.requiredResponse(this.getRenameLocations(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.RenameInfoFull]: (request: protocol.FileLocationRequest) => {
@@ -2332,6 +2342,10 @@ namespace ts.server {
readonly project: Project;
}
function toFileSpan(fileName: string, textSpan: TextSpan, scriptInfo: ScriptInfo): protocol.FileSpan {
return { file: fileName, start: scriptInfo.positionToLineOffset(textSpan.start), end: scriptInfo.positionToLineOffset(textSpanEnd(textSpan)) };
}
function mapTextChangesToCodeEdits(textChanges: FileTextChanges, sourceFile: SourceFile | undefined): protocol.FileCodeEdits {
Debug.assert(!!textChanges.isNewFile === !sourceFile);
if (sourceFile) {
@@ -2,7 +2,8 @@
namespace ts.codefix {
const fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof";
const fixId = fixIdAddMissingTypeof;
const errorCodes = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here.code];
const errorCodes = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];
registerCodeFix({
errorCodes,
getCodeActions: context => {
+38 -23
View File
@@ -188,7 +188,7 @@ namespace ts.codefix {
const useNamespace = tryUseExistingNamespaceImport(existingImports, symbolName, symbolToken, checker);
const addToExisting = tryAddToExistingImport(existingImports);
// Don't bother providing an action to add a new import if we can add to an existing one.
const addImport = addToExisting ? [addToExisting] : getCodeActionsForAddImport(exportInfos, existingImports, program, sourceFile, host, preferences);
const addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, host, preferences);
return [...(useNamespace ? [useNamespace] : emptyArray), ...addImport];
}
@@ -261,7 +261,7 @@ namespace ts.codefix {
return flatten<FixAddNewImport>(choicesForEachExportingModule.sort((a, b) => first(a).moduleSpecifier.length - first(b).moduleSpecifier.length));
}
function getCodeActionsForAddImport(
function getFixesForAddImport(
exportInfos: ReadonlyArray<SymbolExportInfo>,
existingImports: ReadonlyArray<FixAddToExistingImportInfo>,
program: Program,
@@ -376,13 +376,9 @@ namespace ts.codefix {
// check the default export
const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol);
if (defaultExport) {
const localSymbol = getLocalSymbolForExportDefault(defaultExport);
if ((
localSymbol && localSymbol.escapedName === symbolName ||
getEscapedNameForExportDefault(defaultExport) === symbolName ||
moduleSymbolToValidIdentifier(moduleSymbol, program.getCompilerOptions().target!) === symbolName
) && symbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) {
addSymbol(moduleSymbol, localSymbol || defaultExport, ImportKind.Default);
const info = getDefaultExportInfo(defaultExport, moduleSymbol, program);
if (info && info.name === symbolName && symbolHasMeaning(info.symbolForMeaning, currentTokenMeaning)) {
addSymbol(moduleSymbol, defaultExport, ImportKind.Default);
}
}
@@ -391,24 +387,43 @@ namespace ts.codefix {
if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) {
addSymbol(moduleSymbol, exportSymbolWithIdenticalName, ImportKind.Named);
}
function getEscapedNameForExportDefault(symbol: Symbol): __String | undefined {
return symbol.declarations && firstDefined(symbol.declarations, declaration => {
if (isExportAssignment(declaration)) {
if (isIdentifier(declaration.expression)) {
return declaration.expression.escapedText;
}
}
else if (isExportSpecifier(declaration)) {
Debug.assert(declaration.name.escapedText === InternalSymbolName.Default);
return declaration.propertyName && declaration.propertyName.escapedText;
}
});
}
});
return originalSymbolToExportInfos;
}
function getDefaultExportInfo(defaultExport: Symbol, moduleSymbol: Symbol, program: Program): { readonly symbolForMeaning: Symbol, readonly name: string } | undefined {
const checker = program.getTypeChecker();
const localSymbol = getLocalSymbolForExportDefault(defaultExport);
if (localSymbol) return { symbolForMeaning: localSymbol, name: localSymbol.name };
const name = getNameForExportDefault(defaultExport);
if (name !== undefined) return { symbolForMeaning: defaultExport, name };
if (defaultExport.flags & SymbolFlags.Alias) {
const aliased = checker.getAliasedSymbol(defaultExport);
return getDefaultExportInfo(aliased, Debug.assertDefined(aliased.parent), program);
}
else {
const moduleName = moduleSymbolToValidIdentifier(moduleSymbol, program.getCompilerOptions().target!);
return moduleName === undefined ? undefined : { symbolForMeaning: defaultExport, name: moduleName };
}
}
function getNameForExportDefault(symbol: Symbol): string | undefined {
return symbol.declarations && firstDefined(symbol.declarations, declaration => {
if (isExportAssignment(declaration)) {
if (isIdentifier(declaration.expression)) {
return declaration.expression.text;
}
}
else if (isExportSpecifier(declaration)) {
Debug.assert(declaration.name.text === InternalSymbolName.Default);
return declaration.propertyName && declaration.propertyName.text;
}
});
}
function codeActionForFix(context: textChanges.TextChangesContext, sourceFile: SourceFile, symbolName: string, fix: ImportFix, quotePreference: QuotePreference): CodeFixAction {
let diag!: DiagnosticAndArguments;
const changes = textChanges.ChangeTracker.with(context, tracker => {
+1 -1
View File
@@ -498,7 +498,7 @@ namespace ts.FindAllReferences.Core {
return this.importTracker(exportSymbol, exportInfo, !!this.options.isForRename);
}
/** @param allSearchSymbols set of additinal symbols for use by `includes`. */
/** @param allSearchSymbols set of additional symbols for use by `includes`. */
createSearch(location: Node | undefined, symbol: Symbol, comingFrom: ImportExport | undefined, searchOptions: { text?: string, allSearchSymbols?: Symbol[] } = {}): Search {
// Note: if this is an external module symbol, the name doesn't include quotes.
// Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`.
+39 -4
View File
@@ -1,48 +1,83 @@
/* @internal */
namespace ts.JsDoc {
const jsDocTagNames = [
"abstract",
"access",
"alias",
"argument",
"async",
"augments",
"author",
"argument",
"borrows",
"callback",
"class",
"classDesc",
"constant",
"constructor",
"constructs",
"copyright",
"default",
"deprecated",
"description",
"emits",
"enum",
"event",
"example",
"exports",
"extends",
"external",
"field",
"file",
"fileOverview",
"fires",
"function",
"generator",
"global",
"hideConstructor",
"host",
"ignore",
"implements",
"inheritDoc",
"inner",
"instance",
"interface",
"kind",
"lends",
"link",
"license",
"listens",
"member",
"memberOf",
"method",
"mixes",
"module",
"name",
"namespace",
"override",
"package",
"param",
"private",
"prop",
"property",
"protected",
"public",
"readonly",
"requires",
"returns",
"see",
"since",
"static",
"summary",
"template",
"this",
"throws",
"todo",
"tutorial",
"type",
"typedef",
"version"
"var",
"variation",
"version",
"virtual",
"yields"
];
let jsDocTagNameCompletionEntries: CompletionEntry[];
let jsDocTagCompletionEntries: CompletionEntry[];
+1 -1
View File
@@ -17,7 +17,7 @@ namespace ts.NavigateTo {
for (const sourceFile of sourceFiles) {
cancellationToken.throwIfCancellationRequested();
if (excludeDtsFiles && fileExtensionIs(sourceFile.fileName, Extension.Dts)) {
if (excludeDtsFiles && sourceFile.isDeclarationFile) {
continue;
}
+9 -166
View File
@@ -1129,8 +1129,6 @@ namespace ts {
localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages();
}
let sourcemappedFileCache: SourceFileLikeCache;
function log(message: string) {
if (host.log) {
host.log(message);
@@ -1140,6 +1138,8 @@ namespace ts {
const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
const sourceMapper = getSourceMapper(getCanonicalFileName, currentDirectory, log, host, () => program);
function getValidSourceFile(fileName: string): SourceFile {
const sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
@@ -1251,7 +1251,7 @@ namespace ts {
// We reset this cache on structure invalidation so we don't hold on to outdated files for long; however we can't use the `compilerHost` above,
// Because it only functions until `hostCache` is cleared, while we'll potentially need the functionality to lazily read sourcemap files during
// the course of whatever called `synchronizeHostData`
sourcemappedFileCache = createSourceFileLikeCache(host);
sourceMapper.clearCache();
// Make sure all the nodes in the program are both bound, and have their parent
// pointers set property.
@@ -1502,183 +1502,27 @@ namespace ts {
return checker.getSymbolAtLocation(node);
}
function toLineColumnOffset(fileName: string, position: number) {
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
const file = program.getSourceFile(path) || sourcemappedFileCache.get(path)!; // TODO: GH#18217
return file.getLineAndCharacterOfPosition(position);
}
// Sometimes tools can sometimes see the following line as a source mapping url comment, so we mangle it a bit (the [M])
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)$/;
const whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
const base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;
function scanForSourcemapURL(fileName: string) {
const mappedFile = sourcemappedFileCache.get(toPath(fileName, currentDirectory, getCanonicalFileName));
if (!mappedFile) {
return;
}
const starts = getLineStarts(mappedFile);
for (let index = starts.length - 1; index >= 0; index--) {
const lineText = mappedFile.text.substring(starts[index], starts[index + 1]);
const comment = sourceMapCommentRegExp.exec(lineText);
if (comment) {
return comment[1];
}
// If we see a nonwhitespace/map comment-like line, break, to avoid scanning up the entire file
else if (!lineText.match(whitespaceOrMapCommentRegExp)) {
break;
}
}
}
function convertDocumentToSourceMapper(file: { sourceMapper?: sourcemaps.SourceMapper }, contents: string, mapFileName: string) {
let maps: sourcemaps.SourceMapData | undefined;
try {
maps = JSON.parse(contents);
}
catch {
// swallow error
}
if (!maps || !maps.sources || !maps.file || !maps.mappings) {
// obviously invalid map
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
return file.sourceMapper = sourcemaps.decode({
readFile: s => host.readFile!(s), // TODO: GH#18217
fileExists: s => host.fileExists!(s), // TODO: GH#18217
getCanonicalFileName,
log,
}, mapFileName, maps, program, sourcemappedFileCache);
}
function getSourceMapper(fileName: string, file: { sourceMapper?: sourcemaps.SourceMapper }) {
if (!host.readFile || !host.fileExists) {
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
if (file.sourceMapper) {
return file.sourceMapper;
}
let mapFileName = scanForSourcemapURL(fileName);
if (mapFileName) {
const match = base64UrlRegExp.exec(mapFileName);
if (match) {
if (match[1]) {
const base64Object = match[1];
return convertDocumentToSourceMapper(file, base64decode(sys, base64Object), fileName);
}
// Not a data URL we can parse, skip it
mapFileName = undefined;
}
}
const possibleMapLocations: string[] = [];
if (mapFileName) {
possibleMapLocations.push(mapFileName);
}
possibleMapLocations.push(fileName + ".map");
for (const location of possibleMapLocations) {
const mapPath = toPath(location, getDirectoryPath(fileName), getCanonicalFileName);
if (host.fileExists(mapPath)) {
return convertDocumentToSourceMapper(file, host.readFile(mapPath)!, mapPath); // TODO: GH#18217
}
}
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
function makeGetTargetOfMappedPosition<TIn>(
extract: (original: TIn) => sourcemaps.SourceMappableLocation,
create: (result: sourcemaps.SourceMappableLocation, unmapped: TIn, original: TIn) => TIn
) {
return getTargetOfMappedPosition;
function getTargetOfMappedPosition(input: TIn, original = input): TIn {
const info = extract(input);
if (endsWith(info.fileName, Extension.Dts)) {
let file: SourceFileLike | undefined = program.getSourceFile(info.fileName);
if (!file) {
const path = toPath(info.fileName, currentDirectory, getCanonicalFileName);
file = sourcemappedFileCache.get(path);
}
if (!file) {
return input;
}
const mapper = getSourceMapper(info.fileName, file);
const newLoc = mapper.getOriginalPosition(info);
if (newLoc === info) return input;
return getTargetOfMappedPosition(create(newLoc, input, original), original);
}
return input;
}
}
const getTargetOfMappedDeclarationInfo = makeGetTargetOfMappedPosition(
(info: DefinitionInfo) => ({ fileName: info.fileName, position: info.textSpan.start }),
(newLoc, info, original) => ({
containerKind: info.containerKind,
containerName: info.containerName,
fileName: newLoc.fileName,
kind: info.kind,
name: info.name,
textSpan: {
start: newLoc.position,
length: info.textSpan.length
},
originalFileName: original.fileName,
originalTextSpan: original.textSpan
})
);
function getTargetOfMappedDeclarationFiles(infos: ReadonlyArray<DefinitionInfo> | undefined): DefinitionInfo[] | undefined {
return map(infos, d => getTargetOfMappedDeclarationInfo(d));
}
/// Goto definition
function getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] | undefined {
synchronizeHostData();
return getTargetOfMappedDeclarationFiles(GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position));
return GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position);
}
function getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined {
synchronizeHostData();
const result = GoToDefinition.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position);
if (!result) return result;
const mappedDefs = getTargetOfMappedDeclarationFiles(result.definitions);
if (mappedDefs === result.definitions) {
return result;
}
return {
definitions: mappedDefs,
textSpan: result.textSpan
};
return GoToDefinition.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position);
}
function getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] | undefined {
synchronizeHostData();
return getTargetOfMappedDeclarationFiles(GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position));
return GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position);
}
/// Goto implementation
const getTargetOfMappedImplementationLocation = makeGetTargetOfMappedPosition(
(info: ImplementationLocation) => ({ fileName: info.fileName, position: info.textSpan.start }),
(newLoc, info) => ({
fileName: newLoc.fileName,
kind: info.kind,
displayParts: info.displayParts,
textSpan: {
start: newLoc.position,
length: info.textSpan.length
},
originalFileName: info.fileName,
originalTextSpan: info.textSpan
})
);
function getTargetOfMappedImplementationLocations(infos: ReadonlyArray<ImplementationLocation> | undefined): ImplementationLocation[] | undefined {
return map(infos, d => getTargetOfMappedImplementationLocation(d));
}
function getImplementationAtPosition(fileName: string, position: number): ImplementationLocation[] | undefined {
synchronizeHostData();
return getTargetOfMappedImplementationLocations(FindAllReferences.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position));
return FindAllReferences.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
}
/// References and Occurrences
@@ -1735,10 +1579,8 @@ namespace ts {
return FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
}
/// NavigateTo
function getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles = false): NavigateToItem[] {
synchronizeHostData();
const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles();
return NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles);
}
@@ -2289,7 +2131,8 @@ namespace ts {
getProgram,
getApplicableRefactors,
getEditsForRefactor,
toLineColumnOffset
toLineColumnOffset: sourceMapper.toLineColumnOffset,
getSourceMapper: () => sourceMapper,
};
}
+1 -1
View File
@@ -102,7 +102,7 @@ namespace ts {
readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string;
/**
* Read arbitary text files on disk, i.e. when resolution procedure needs the content of 'package.json' to determine location of bundled typings for node modules
* Read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json' to determine location of bundled typings for node modules
*/
readFile(fileName: string): string | undefined;
realpath?(path: string): string;
+115
View File
@@ -0,0 +1,115 @@
/* @internal */
namespace ts {
// Sometimes tools can sometimes see the following line as a source mapping url comment, so we mangle it a bit (the [M])
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/;
const whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
const base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;
export interface SourceMapper {
toLineColumnOffset(fileName: string, position: number): LineAndCharacter;
tryGetOriginalLocation(info: sourcemaps.SourceMappableLocation): sourcemaps.SourceMappableLocation | undefined;
clearCache(): void;
}
export function getSourceMapper(
getCanonicalFileName: GetCanonicalFileName,
currentDirectory: string,
log: (message: string) => void,
host: LanguageServiceHost,
getProgram: () => Program,
): SourceMapper {
let sourcemappedFileCache: SourceFileLikeCache;
return { tryGetOriginalLocation, toLineColumnOffset, clearCache };
function scanForSourcemapURL(fileName: string) {
const mappedFile = sourcemappedFileCache.get(toPath(fileName, currentDirectory, getCanonicalFileName));
if (!mappedFile) {
return;
}
const starts = getLineStarts(mappedFile);
for (let index = starts.length - 1; index >= 0; index--) {
const lineText = mappedFile.text.substring(starts[index], starts[index + 1]);
const comment = sourceMapCommentRegExp.exec(lineText);
if (comment) {
return comment[1];
}
// If we see a non-whitespace/map comment-like line, break, to avoid scanning up the entire file
else if (!lineText.match(whitespaceOrMapCommentRegExp)) {
break;
}
}
}
function convertDocumentToSourceMapper(file: { sourceMapper?: sourcemaps.SourceMapper }, contents: string, mapFileName: string) {
let maps: sourcemaps.SourceMapData | undefined;
try {
maps = JSON.parse(contents);
}
catch {
// swallow error
}
if (!maps || !maps.sources || !maps.file || !maps.mappings) {
// obviously invalid map
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
return file.sourceMapper = sourcemaps.decode({
readFile: s => host.readFile!(s), // TODO: GH#18217
fileExists: s => host.fileExists!(s), // TODO: GH#18217
getCanonicalFileName,
log,
}, mapFileName, maps, getProgram(), sourcemappedFileCache);
}
function getSourceMapper(fileName: string, file: SourceFileLike): sourcemaps.SourceMapper {
if (!host.readFile || !host.fileExists) {
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
if (file.sourceMapper) {
return file.sourceMapper;
}
let mapFileName = scanForSourcemapURL(fileName);
if (mapFileName) {
const match = base64UrlRegExp.exec(mapFileName);
if (match) {
if (match[1]) {
const base64Object = match[1];
return convertDocumentToSourceMapper(file, base64decode(sys, base64Object), fileName);
}
// Not a data URL we can parse, skip it
mapFileName = undefined;
}
}
const possibleMapLocations: string[] = [];
if (mapFileName) {
possibleMapLocations.push(mapFileName);
}
possibleMapLocations.push(fileName + ".map");
for (const location of possibleMapLocations) {
const mapPath = toPath(location, getDirectoryPath(fileName), getCanonicalFileName);
if (host.fileExists(mapPath)) {
return convertDocumentToSourceMapper(file, host.readFile(mapPath)!, mapPath); // TODO: GH#18217
}
}
return file.sourceMapper = sourcemaps.identitySourceMapper;
}
function tryGetOriginalLocation(info: sourcemaps.SourceMappableLocation): sourcemaps.SourceMappableLocation | undefined {
if (!isDeclarationFileName(info.fileName)) return undefined;
const file = getProgram().getSourceFile(info.fileName) || sourcemappedFileCache.get(toPath(info.fileName, currentDirectory, getCanonicalFileName));
if (!file) return undefined;
const newLoc = getSourceMapper(info.fileName, file).getOriginalPosition(info);
return newLoc === info ? undefined : tryGetOriginalLocation(newLoc) || newLoc;
}
function toLineColumnOffset(fileName: string, position: number): LineAndCharacter {
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
const file = getProgram().getSourceFile(path) || sourcemappedFileCache.get(path)!; // TODO: GH#18217
return file.getLineAndCharacterOfPosition(position);
}
function clearCache(): void {
sourcemappedFileCache = createSourceFileLikeCache(host);
}
}
}
+1
View File
@@ -29,6 +29,7 @@
"preProcess.ts",
"rename.ts",
"signatureHelp.ts",
"sourcemaps.ts",
"suggestionDiagnostics.ts",
"symbolDisplay.ts",
"transpile.ts",
+2
View File
@@ -334,6 +334,8 @@ namespace ts {
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
/** @internal */
getSourceMapper(): SourceMapper;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions: FormatCodeSettings, preferences: UserPreferences): ReadonlyArray<CodeFixAction>;
getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
+7
View File
@@ -1417,6 +1417,13 @@ namespace ts {
changes.insertNodeAtTopOfFile(sourceFile, importDecl, /*blankLineBetween*/ true);
}
}
export function textSpansEqual(a: TextSpan | undefined, b: TextSpan | undefined): boolean {
return !!a && !!b && a.start === b.start && a.length === b.length;
}
export function documentSpansEqual(a: DocumentSpan, b: DocumentSpan): boolean {
return a.fileName === b.fileName && textSpansEqual(a.textSpan, b.textSpan);
}
}
// Display-part writer helpers
+1 -2
View File
@@ -20,6 +20,7 @@ namespace Harness.Parallel.Host {
// tslint:disable-next-line:variable-name
const FailedTestReporter = require(path.resolve(__dirname, "../../scripts/failed-tests")) as typeof import("../../../scripts/failed-tests");
const perfdataFileNameFragment = ".parallelperf";
const perfData = readSavedPerfData(configOption);
const newTasks: Task[] = [];
let tasks: Task[] = [];
@@ -175,8 +176,6 @@ namespace Harness.Parallel.Host {
}
}
const perfdataFileNameFragment = ".parallelperf";
function perfdataFileName(target?: string) {
return `${perfdataFileNameFragment}${target ? `.${target}` : ""}.json`;
}
+1 -1
View File
@@ -2,7 +2,7 @@ namespace ts {
describe("convertToBase64", () => {
function runTest(input: string): void {
const actual = convertToBase64(input);
const expected = new Buffer(input).toString("base64");
const expected = (Buffer.from ? Buffer.from(input) : new Buffer(input)).toString("base64");
assert.equal(actual, expected, "Encoded string using convertToBase64 does not match buffer.toString('base64')");
}
+2
View File
@@ -45,6 +45,8 @@ namespace ts {
checkBody(createPropertyAccess(createObjectLiteral(), "prop"));
checkBody(createAsExpression(createPropertyAccess(createObjectLiteral(), "prop"), createTypeReferenceNode("T", /*typeArguments*/ undefined)));
checkBody(createNonNullExpression(createPropertyAccess(createObjectLiteral(), "prop")));
checkBody(createCommaList([createLiteral("a"), createLiteral("b")]));
checkBody(createBinary(createLiteral("a"), SyntaxKind.CommaToken, createLiteral("b")));
});
});
});
+349 -175
View File
@@ -415,7 +415,7 @@ namespace ts.projectSystem {
checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path));
}
function protocolLocationFromSubstring(str: string, substring: string) {
function protocolLocationFromSubstring(str: string, substring: string): protocol.Location {
const start = str.indexOf(substring);
Debug.assert(start !== -1);
return protocolToLocation(str)(start);
@@ -427,21 +427,36 @@ namespace ts.projectSystem {
return { line: x.line + 1, offset: x.character + 1 };
};
}
function protocolTextSpanFromSubstring(str: string, substring: string): protocol.TextSpan {
const span = textSpanFromSubstring(str, substring);
function protocolTextSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): protocol.TextSpan {
const span = textSpanFromSubstring(str, substring, options);
const toLocation = protocolToLocation(str);
return { start: toLocation(span.start), end: toLocation(span.start + span.length) };
return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) };
}
function textSpanFromSubstring(str: string, substring: string): TextSpan {
const start = str.indexOf(substring);
function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan {
const start = nthIndexOf(str, substring, options ? options.index : 0);
Debug.assert(start !== -1);
return createTextSpan(start, substring.length);
}
function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs {
return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) };
}
function protocolFileSpanFromSubstring(file: File, substring: string): protocol.FileSpan {
return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring) };
function protocolFileSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions) {
return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring, options) };
}
function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan {
return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) };
}
interface SpanFromSubstringOptions {
readonly index: number;
}
function nthIndexOf(str: string, substr: string, n: number): number {
let index = -1;
for (; n >= 0; n--) {
index = str.indexOf(substr, index + 1);
if (index === -1) return -1;
}
return index;
}
/**
@@ -496,10 +511,14 @@ namespace ts.projectSystem {
};
}
export function openFilesForSession(files: ReadonlyArray<File>, session: server.Session): void {
export function executeSessionRequest<TRequest extends protocol.Request, TResponse extends protocol.Response>(session: server.Session, command: TRequest["command"], args: TRequest["arguments"]): TResponse["body"] {
return session.executeCommand(makeSessionRequest(command, args)).response as TResponse["body"];
}
export function openFilesForSession(files: ReadonlyArray<File | { readonly file: File | string, readonly projectRootPath: string }>, session: server.Session): void {
for (const file of files) {
const request = makeSessionRequest<protocol.OpenRequestArgs>(CommandNames.Open, { file: file.path });
session.executeCommand(request);
session.executeCommand(makeSessionRequest<protocol.OpenRequestArgs>(CommandNames.Open,
"projectRootPath" in file ? { file: typeof file.file === "string" ? file.file : file.file.path, projectRootPath: file.projectRootPath } : { file: file.path }));
}
}
@@ -3385,7 +3404,7 @@ namespace ts.projectSystem {
host.reloadFS(files.map(f => f === fileSubA ? fileA : f));
host.checkTimeoutQueueLength(2);
closeFile(fileSubA);
closeFilesForSession([fileSubA], session);
// This should cancel existing updates and schedule new ones
host.checkTimeoutQueueLength(2);
checkNumberOfProjects(services, { configuredProjects: 1 });
@@ -3405,7 +3424,7 @@ namespace ts.projectSystem {
// file is deleted but watches are not yet invoked
const originalFileExists = host.fileExists;
host.fileExists = s => s === fileA.path ? false : originalFileExists.call(host, s);
closeFile(fileA);
closeFilesForSession([fileA], session);
host.checkTimeoutQueueLength(2); // Update configured project and projects for open file
checkProjectActualFiles(services.configuredProjects.get(config.path)!, filesWithFileA.map(f => f.path));
@@ -3453,23 +3472,7 @@ namespace ts.projectSystem {
assert.isFalse(hasErrorMsg());
function openFile(file: File) {
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: file.path,
fileContent: file.content,
projectRootPath
}
});
}
function closeFile(file: File) {
session.executeCommandSeq<protocol.CloseRequest>({
command: protocol.CommandTypes.Close,
arguments: {
file: file.path
}
});
openFilesForSession([{ file, projectRootPath }], session);
}
});
});
@@ -3686,40 +3689,17 @@ namespace ts.projectSystem {
const files = [libFile, app, serverUtilities, backendTest];
const host = createServerHost(files);
const session = createSession(host, { useInferredProjectPerProjectRoot: true, canUseEvents: true });
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: app.path,
projectRootPath: projectRoot
}
});
openFilesForSession([{ file: app, projectRootPath: projectRoot }], session);
const service = session.getProjectService();
checkNumberOfProjects(service, { inferredProjects: 1 });
const project = service.inferredProjects[0];
checkProjectActualFiles(project, [libFile.path, app.path]);
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: backendTest.path,
projectRootPath: projectRoot
}
});
openFilesForSession([{ file: backendTest, projectRootPath: projectRoot }], session);
checkNumberOfProjects(service, { inferredProjects: 1 });
checkProjectActualFiles(project, files.map(f => f.path));
checkErrors([backendTest.path, app.path]);
session.executeCommandSeq<protocol.CloseRequest>({
command: protocol.CommandTypes.Close,
arguments: {
file: backendTest.path
}
});
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: serverUtilities.path,
projectRootPath: projectRoot
}
});
closeFilesForSession([backendTest], session);
openFilesForSession([{ file: serverUtilities.path, projectRootPath: projectRoot }], session);
checkErrors([serverUtilities.path, app.path]);
function checkErrors(openFiles: [string, string]) {
@@ -7886,72 +7866,42 @@ namespace ts.projectSystem {
const host = createServerHost(files);
const session = createSession(host);
const projectService = session.getProjectService();
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: aFile.path,
projectRootPath: folderA
}
});
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: bFile.path,
projectRootPath: folderB
}
});
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: aFc,
projectRootPath: folderA
}
});
session.executeCommandSeq<protocol.OpenRequest>({
command: protocol.CommandTypes.Open,
arguments: {
file: bFc,
projectRootPath: folderB
}
});
openFilesForSession(
[
{ file: aFile, projectRootPath: folderA },
{ file: bFile, projectRootPath: folderB },
{ file: aFc, projectRootPath: folderA },
{ file: bFc, projectRootPath: folderB },
],
session);
checkNumberOfProjects(projectService, { configuredProjects: 2 });
assert.isDefined(projectService.configuredProjects.get(aTsconfig.path));
assert.isDefined(projectService.configuredProjects.get(bTsconfig.path));
verifyRenameResponse(session.executeCommandSeq<protocol.RenameRequest>({
command: protocol.CommandTypes.Rename,
arguments: {
file: aFc,
line: 1,
offset: 14,
findInStrings: false,
findInComments: false
}
}).response as protocol.RenameResponseBody);
const response = executeSessionRequest<protocol.RenameRequest, protocol.RenameResponse>(session, protocol.CommandTypes.Rename, { file: aFc, ...protocolLocationFromSubstring(cFile.content, "C") });
function verifyRenameResponse({ info, locs }: protocol.RenameResponseBody) {
assert.isTrue(info.canRename);
assert.equal(locs.length, 4);
verifyLocations(0, aFile.path, aFc);
verifyLocations(2, bFile.path, bFc);
function verifyLocations(locStartIndex: number, firstFile: string, secondFile: string) {
assert.deepEqual(locs[locStartIndex], {
file: firstFile,
locs: [
{ start: { line: 1, offset: 39 }, end: { line: 1, offset: 40 } },
{ start: { line: 1, offset: 9 }, end: { line: 1, offset: 10 } }
]
});
assert.deepEqual(locs[locStartIndex + 1], {
file: secondFile,
locs: [
{ start: { line: 1, offset: 14 }, end: { line: 1, offset: 15 } }
]
});
}
}
assert.equal(aFile.content, bFile.content);
const abLocs: protocol.TextSpan[] = [
protocolTextSpanFromSubstring(aFile.content, "C"),
protocolTextSpanFromSubstring(aFile.content, "C", { index: 1 }),
];
const cLocs: protocol.TextSpan[] = [protocolTextSpanFromSubstring(cFile.content, "C")];
assert.deepEqual<protocol.RenameResponseBody | undefined>(response, {
info: {
canRename: true,
displayName: "C",
fullDisplayName: '"/users/username/projects/a/c/fc".C',
kind: ScriptElementKind.constElement,
kindModifiers: ScriptElementKindModifier.exportedModifier,
localizedErrorMessage: undefined,
},
locs: [
{ file: aFc, locs: cLocs },
{ file: aFile.path, locs: abLocs },
{ file: bFc, locs: cLocs },
{ file: bFile.path, locs: abLocs },
],
});
});
describe("module resolution when symlinked folder contents change and resolve modules", () => {
@@ -8948,93 +8898,323 @@ export function Test2() {
function makeSampleProjects() {
const aTs: File = {
path: "/a/a.ts",
content: "export function fnA() {}",
content: "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};",
};
const aTsconfig: File = {
path: "/a/tsconfig.json",
content: `{
"compilerOptions": {
"outDir": "bin",
"declaration": true,
"declarationMap": true,
"composite": true,
}
}`,
const compilerOptions: CompilerOptions = {
outDir: "bin",
declaration: true,
declarationMap: true,
composite: true,
};
const configContent = JSON.stringify({ compilerOptions });
const aTsconfig: File = { path: "/a/tsconfig.json", content: configContent };
const aDtsMapContent: SourceMapSection = {
version: 3,
file: "a.d.ts",
sourceRoot: "",
sources: ["../a.ts"],
names: [],
mappings: "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC"
};
const aDtsMap: File = {
path: "/a/bin/a.d.ts.map",
content: JSON.stringify(aDtsMapContent),
};
const aDts: File = {
path: "/a/bin/a.d.ts",
// Need to mangle the sourceMappingURL part or it breaks the build
content: `export declare function fnA(): void;\nexport interface IfaceA {\n}\nexport declare const instanceA: IfaceA;\n//# source${""}MappingURL=a.d.ts.map`,
};
const bTs: File = {
path: "/b/b.ts",
content: 'import { fnA } from "../a/a";\nexport function fnB() { fnA(); }',
content: "export function fnB() {}",
};
const bTsconfig: File = {
path: "/b/tsconfig.json",
content: `{
"compilerOptions": {
"outDir": "bin",
},
"references": [
{ "path": "../a" }
]
}`,
const bTsconfig: File = { path: "/b/tsconfig.json", content: configContent };
const bDtsMapContent: SourceMapSection = {
version: 3,
file: "b.d.ts",
sourceRoot: "",
sources: ["../b.ts"],
names: [],
mappings: "AAAA,wBAAgB,GAAG,SAAK",
};
const bDtsMap: File = {
path: "/b/bin/b.d.ts.map",
content: JSON.stringify(bDtsMapContent),
};
const bDts: File = {
// Need to mangle the sourceMappingURL part or it breaks the build
path: "/b/bin/b.d.ts",
content: `export declare function fnB(): void;\n//# source${""}MappingURL=b.d.ts.map`,
};
const host = createServerHost([aTs, aTsconfig, bTs, bTsconfig]);
const userTs: File = {
path: "/user/user.ts",
content: 'import { fnA, instanceA } from "../a/bin/a";\nimport { fnB } from "../b/bin/b";\nexport function fnUser() { fnA(); fnB(); instanceA; }',
};
const host = createServerHost([aTs, aTsconfig, aDtsMap, aDts, bTsconfig, bTs, bDtsMap, bDts, userTs]);
const session = createSession(host);
writeDeclarationFiles(aTs, host, session, [
{ name: "/a/bin/a.d.ts.map", text: '{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../a.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAK"}' },
// Need to mangle the sourceMappingURL part or it breaks the build
{ name: "/a/bin/a.d.ts", text: `export declare function fnA(): void;\n//# source${""}MappingURL=a.d.ts.map` },
]);
checkDeclarationFiles(aTs, session, [aDtsMap, aDts]);
checkDeclarationFiles(bTs, session, [bDtsMap, bDts]);
return { session, aTs, bTs };
// Testing what happens if we delete the original sources.
host.removeFile(bTs.path);
openFilesForSession([userTs], session);
return { session, aTs, bDts, userTs };
}
describe("tsserverProjectSystem project references", () => {
it("goToDefinition", () => {
const { session, aTs, bTs } = makeSampleProjects();
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.DefinitionRequest, protocol.DefinitionResponse>(session, protocol.CommandTypes.Definition, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]);
});
openFilesForSession([bTs], session);
it("getDefinitionAndBoundSpan", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.DefinitionAndBoundSpanRequest, protocol.DefinitionAndBoundSpanResponse>(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual(response, {
textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA", { index: 1 }),
definitions: [protocolFileSpanFromSubstring(aTs, "fnA")],
});
});
const definitionRequest = makeSessionRequest<protocol.FileLocationRequestArgs>(CommandNames.Definition, protocolFileLocationFromSubstring(bTs, "fnA()"));
const definitionResponse = session.executeCommand(definitionRequest).response as protocol.DefinitionResponse["body"];
it("goToType", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.TypeDefinitionRequest, protocol.TypeDefinitionResponse>(session, protocol.CommandTypes.TypeDefinition, protocolFileLocationFromSubstring(userTs, "instanceA"));
assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "IfaceA")]);
});
assert.deepEqual(definitionResponse, [protocolFileSpanFromSubstring(aTs, "fnA")]);
it("goToImplementation", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.ImplementationRequest, protocol.ImplementationResponse>(session, protocol.CommandTypes.Implementation, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]);
});
it("goToDefinition -- target does not exist", () => {
const { session, bDts, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.DefinitionRequest, protocol.DefinitionResponse>(session, CommandNames.Definition, protocolFileLocationFromSubstring(userTs, "fnB()"));
// bTs does not exist, so stick with bDts
assert.deepEqual(response, [protocolFileSpanFromSubstring(bDts, "fnB")]);
});
it("navigateTo", () => {
const { session, bTs } = makeSampleProjects();
openFilesForSession([bTs], session);
const navtoRequest = makeSessionRequest<protocol.NavtoRequestArgs>(CommandNames.Navto, { file: bTs.path, searchValue: "fn" });
const navtoResponse = session.executeCommand(navtoRequest).response as protocol.NavtoResponse["body"];
assert.deepEqual<ReadonlyArray<protocol.NavtoItem> | undefined>(navtoResponse, [
// TODO: First result should be from a.ts, not a.d.ts
const { session, aTs, bDts, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.NavtoRequest, protocol.NavtoResponse>(session, CommandNames.Navto, { file: userTs.path, searchValue: "fn" });
assert.deepEqual<ReadonlyArray<protocol.NavtoItem> | undefined>(response, [
{
file: "/a/bin/a.d.ts",
start: { line: 1, offset: 1 },
end: { line: 1, offset: 37 },
name: "fnA",
...protocolFileSpanFromSubstring(bDts, "export declare function fnB(): void;"),
name: "fnB",
matchKind: "prefix",
isCaseSensitive: true,
kind: ScriptElementKind.functionElement,
kindModifiers: "export,declare",
},
{
...protocolFileSpanFromSubstring(bTs, "export function fnB() { fnA(); }"),
name: "fnB",
...protocolFileSpanFromSubstring(userTs, "export function fnUser() { fnA(); fnB(); instanceA; }"),
name: "fnUser",
matchKind: "prefix",
isCaseSensitive: true,
kind: ScriptElementKind.functionElement,
kindModifiers: "export",
},
{
...protocolFileSpanFromSubstring(aTs, "export function fnA() {}"),
name: "fnA",
matchKind: "prefix",
isCaseSensitive: true,
kind: ScriptElementKind.functionElement,
kindModifiers: "export",
},
]);
});
it("findAllReferences", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual<protocol.ReferencesResponseBody | undefined>(response, {
refs: [
makeReferenceItem(userTs, /*isDefinition*/ true, "fnA"),
makeReferenceItem(userTs, /*isDefinition*/ false, "fnA", { index: 1 }),
makeReferenceItem(aTs, /*isDefinition*/ true, "fnA"),
],
symbolName: "fnA",
symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnA()").offset,
symbolDisplayString: "(alias) fnA(): void\nimport fnA",
});
});
it("findAllReferencesFull", () => {
const { session, aTs, userTs } = makeSampleProjects();
interface ReferencesFullRequest extends protocol.FileLocationRequest { command: protocol.CommandTypes.ReferencesFull; }
interface ReferencesFullResponse extends protocol.Response { body: ReadonlyArray<ReferencedSymbol>; }
const responseFull = executeSessionRequest<ReferencesFullRequest, ReferencesFullResponse>(session, protocol.CommandTypes.ReferencesFull, protocolFileLocationFromSubstring(userTs, "fnA()"));
function fnAVoid(kind: SymbolDisplayPartKind): SymbolDisplayPart[] {
return [
keywordPart(SyntaxKind.FunctionKeyword),
spacePart(),
displayPart("fnA", kind),
punctuationPart(SyntaxKind.OpenParenToken),
punctuationPart(SyntaxKind.CloseParenToken),
punctuationPart(SyntaxKind.ColonToken),
spacePart(),
keywordPart(SyntaxKind.VoidKeyword),
];
}
assert.deepEqual<ReadonlyArray<ReferencedSymbol>>(responseFull, [
{
definition: {
...documentSpanFromSubstring(userTs, "fnA"),
kind: ScriptElementKind.alias,
name: "(alias) function fnA(): void\nimport fnA",
containerKind: ScriptElementKind.unknown,
containerName: "",
displayParts: [
punctuationPart(SyntaxKind.OpenParenToken),
textPart("alias"),
punctuationPart(SyntaxKind.CloseParenToken),
spacePart(),
...fnAVoid(SymbolDisplayPartKind.aliasName),
lineBreakPart(),
keywordPart(SyntaxKind.ImportKeyword),
spacePart(),
displayPart("fnA", SymbolDisplayPartKind.aliasName),
],
},
references: [
makeReferenceEntry(userTs, /*isDefinition*/ true, "fnA"),
makeReferenceEntry(userTs, /*isDefinition*/ false, "fnA", { index: 1 }),
],
},
{
definition: {
...documentSpanFromSubstring(aTs, "fnA"),
kind: ScriptElementKind.functionElement,
name: "function fnA(): void",
containerKind: ScriptElementKind.unknown,
containerName: "",
displayParts: fnAVoid(SymbolDisplayPartKind.functionName),
},
references: [
makeReferenceEntry(aTs, /*isDefinition*/ true, "fnA"),
],
}
]);
});
it("findAllReferences -- target does not exist", () => {
const { session, bDts, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.ReferencesRequest, protocol.ReferencesResponse>(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnB()"));
assert.deepEqual<protocol.ReferencesResponseBody | undefined>(response, {
refs: [
makeReferenceItem(userTs, /*isDefinition*/ true, "fnB"),
makeReferenceItem(userTs, /*isDefinition*/ false, "fnB", { index: 1 }),
makeReferenceItem(bDts, /*isDefinition*/ true, "fnB"),
],
symbolName: "fnB",
symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnB()").offset,
symbolDisplayString: "(alias) fnB(): void\nimport fnB",
});
});
it("renameLocations", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.RenameRequest, protocol.RenameResponse>(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual<protocol.RenameResponseBody | undefined>(response, {
info: {
canRename: true,
displayName: "fnA",
fullDisplayName: "fnA",
kind: ScriptElementKind.alias,
kindModifiers: ScriptElementKindModifier.none,
localizedErrorMessage: undefined,
},
locs: [
{
file: userTs.path,
locs: [
protocolTextSpanFromSubstring(userTs.content, "fnA"),
protocolTextSpanFromSubstring(userTs.content, "fnA", { index: 1 }),
],
},
{
file: aTs.path,
locs: [protocolTextSpanFromSubstring(aTs.content, "fnA")],
}
],
});
});
it("renameLocationsFull", () => {
const { session, aTs, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.RenameFullRequest, protocol.RenameFullResponse>(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()"));
assert.deepEqual<ReadonlyArray<RenameLocation>>(response, [
documentSpanFromSubstring(userTs, "fnA"),
documentSpanFromSubstring(userTs, "fnA", { index: 1 }),
documentSpanFromSubstring(aTs, "fnA"),
]);
});
it("renameLocations -- target does not exist", () => {
const { session, bDts, userTs } = makeSampleProjects();
const response = executeSessionRequest<protocol.RenameRequest, protocol.RenameResponse>(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnB()"));
assert.deepEqual<protocol.RenameResponseBody | undefined>(response, {
info: {
canRename: true,
displayName: "fnB",
fullDisplayName: "fnB",
kind: ScriptElementKind.alias,
kindModifiers: ScriptElementKindModifier.none,
localizedErrorMessage: undefined,
},
locs: [
{
file: userTs.path,
locs: [
protocolTextSpanFromSubstring(userTs.content, "fnB"),
protocolTextSpanFromSubstring(userTs.content, "fnB", { index: 1 }),
],
},
{
file: bDts.path,
locs: [protocolTextSpanFromSubstring(bDts.content, "fnB")],
}
],
});
});
});
function writeDeclarationFiles(file: File, host: TestServerHost, session: TestSession, expectedFiles: ReadonlyArray<{ readonly name: string, readonly text: string }>): void {
function makeReferenceItem(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem {
return {
...protocolFileSpanFromSubstring(file, text, options),
isDefinition,
isWriteAccess: isDefinition,
lineText: text,
};
}
function makeReferenceEntry(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): ReferenceEntry {
return {
...documentSpanFromSubstring(file, text, options),
isDefinition,
isWriteAccess: isDefinition,
isInString: undefined,
};
}
function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray<File>): void {
openFilesForSession([file], session);
const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false));
const program = project.getCurrentProgram();
@@ -9042,12 +9222,6 @@ export function Test2() {
closeFilesForSession([file], session);
Debug.assert(!output.emitSkipped);
assert.deepEqual(output.outputFiles, expectedFiles.map(e => ({ ...e, writeByteOrderMark: false })));
for (const { name, text } of output.outputFiles) {
const directory: Folder = { path: getDirectoryPath(name) };
host.ensureFileOrFolder(directory);
host.writeFile(name, text);
}
assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false })));
}
}
+2 -2
View File
@@ -199,7 +199,7 @@ namespace ts.server {
private write(s: string) {
if (this.fd >= 0) {
const buf = new Buffer(s);
const buf = Buffer.from ? Buffer.from(s) : new Buffer(s);
// tslint:disable-next-line no-null-keyword
fs.writeSync(this.fd, buf, 0, buf.length, /*position*/ null!); // TODO: GH#18217
}
@@ -869,7 +869,7 @@ namespace ts.server {
}
// Override sys.write because fs.writeSync is not reliable on Node 4
sys.write = (s: string) => writeMessage(new Buffer(s, "utf8"));
sys.write = (s: string) => writeMessage(Buffer.from ? Buffer.from(s, "utf8") : new Buffer(s, "utf8"));
sys.watchFile = (fileName, callback) => {
const watchedFile = pollingWatchedFileSet.addFile(fileName, callback);
return {
+71 -20
View File
@@ -2544,7 +2544,6 @@ declare namespace ts {
inputSourceFileNames: string[];
sourceMapNames?: string[];
sourceMapMappings: string;
sourceMapDecodedMappings: SourceMapSpan[];
}
/** Return code used by getEmitOutput function to indicate status of the function */
enum ExitStatus {
@@ -3260,6 +3259,7 @@ declare namespace ts {
aliasSymbol?: Symbol;
aliasTypeArguments?: ReadonlyArray<Type>;
wildcardInstantiation?: Type;
immediateBaseConstraint?: Type;
}
interface IntrinsicType extends Type {
intrinsicName: string;
@@ -5073,7 +5073,7 @@ declare namespace ts {
An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: DiagnosticMessage;
infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: DiagnosticMessage;
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: DiagnosticMessage;
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here: DiagnosticMessage;
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: DiagnosticMessage;
Type_arguments_cannot_be_used_here: DiagnosticMessage;
The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options: DiagnosticMessage;
Duplicate_identifier_0: DiagnosticMessage;
@@ -7435,6 +7435,8 @@ declare namespace ts {
jsDocTypeExpression: JSDocTypeExpression;
diagnostics: Diagnostic[];
} | undefined;
/** @internal */
function isDeclarationFileName(fileName: string): boolean;
interface PragmaContext {
languageVersion: ScriptTarget;
pragmas?: PragmaMap;
@@ -8371,6 +8373,9 @@ declare namespace ts {
function parenthesizeElementTypeMembers(members: ReadonlyArray<TypeNode>): NodeArray<TypeNode>;
function parenthesizeTypeParameters(typeParameters: ReadonlyArray<TypeNode> | undefined): MutableNodeArray<TypeNode> | undefined;
function parenthesizeConciseBody(body: ConciseBody): ConciseBody;
function isCommaSequence(node: Expression): node is (BinaryExpression & {
operatorToken: Token<SyntaxKind.CommaToken>;
}) | CommaListExpression;
enum OuterExpressionKinds {
Parentheses = 1,
Assertions = 2,
@@ -8601,17 +8606,6 @@ declare namespace ts.sourcemaps {
readonly lastSpan: SourceMapSpan;
}
function decodeMappings(map: SourceMapData): MappingsDecoder;
function calculateDecodedMappings<T>(map: SourceMapData, processPosition: (position: RawSourceMapPosition) => T, host?: {
log?(s: string): void;
}): T[];
interface RawSourceMapPosition {
emittedLine: number;
emittedColumn: number;
sourceLine: number;
sourceColumn: number;
sourceIndex: number;
nameIndex?: number;
}
}
declare namespace ts {
function getOriginalNodeId(node: Node): number;
@@ -8815,6 +8809,16 @@ declare namespace ts {
extendedDiagnostics?: boolean;
}
function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter, compilerOptions?: SourceMapOptions): SourceMapWriter;
interface SourceMapSection {
version: 3;
file: string;
sourceRoot?: string;
sources: string[];
names?: string[];
mappings: string;
sourcesContent?: (string | null)[];
sections?: undefined;
}
}
declare namespace ts {
interface CommentWriter {
@@ -8978,10 +8982,14 @@ declare namespace ts {
*/
function createProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): Program;
function parseConfigHostFromCompilerHost(host: CompilerHost): ParseConfigFileHost;
interface ResolveProjectReferencePathHost {
fileExists(fileName: string): boolean;
}
/**
* Returns the target config filename of a project reference
* Returns the target config filename of a project reference.
* Note: The file might not exist.
*/
function resolveProjectReferencePath(host: CompilerHost | UpToDateHost, ref: ProjectReference): ResolvedConfigFileName;
function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
/**
* Returns a DiagnosticMessage if we won't include a resolved module due to its extension.
* The DiagnosticMessage's parameters are the imported module name, and the filename it resolved to.
@@ -10037,6 +10045,8 @@ declare namespace ts {
getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined;
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined;
toLineColumnOffset?(fileName: string, position: number): LineAndCharacter;
/** @internal */
getSourceMapper(): SourceMapper;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions: FormatCodeSettings, preferences: UserPreferences): ReadonlyArray<CodeFixAction>;
getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions;
applyCodeActionCommand(action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
@@ -10907,6 +10917,8 @@ declare namespace ts {
function getParentNodeInSpan(node: Node | undefined, file: SourceFile, span: TextSpan): Node | undefined;
function findModifier(node: Node, kind: Modifier["kind"]): Modifier | undefined;
function insertImport(changes: textChanges.ChangeTracker, sourceFile: SourceFile, importDecl: Statement): void;
function textSpansEqual(a: TextSpan | undefined, b: TextSpan | undefined): boolean;
function documentSpansEqual(a: DocumentSpan, b: DocumentSpan): boolean;
}
declare namespace ts {
function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean;
@@ -11315,6 +11327,14 @@ declare namespace ts.SignatureHelp {
}
function getArgumentInfoForCompletions(node: Node, position: number, sourceFile: SourceFile): ArgumentInfoForCompletions | undefined;
}
declare namespace ts {
interface SourceMapper {
toLineColumnOffset(fileName: string, position: number): LineAndCharacter;
tryGetOriginalLocation(info: sourcemaps.SourceMappableLocation): sourcemaps.SourceMappableLocation | undefined;
clearCache(): void;
}
function getSourceMapper(getCanonicalFileName: GetCanonicalFileName, currentDirectory: string, log: (message: string) => void, host: LanguageServiceHost, getProgram: () => Program): SourceMapper;
}
declare namespace ts {
function computeSuggestionDiagnostics(sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): DiagnosticWithLocation[];
}
@@ -11967,7 +11987,7 @@ declare namespace ts {
*/
readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string;
/**
* Read arbitary text files on disk, i.e. when resolution procedure needs the content of 'package.json' to determine location of bundled typings for node modules
* Read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json' to determine location of bundled typings for node modules
*/
readFile(fileName: string): string | undefined;
realpath?(path: string): string;
@@ -12317,6 +12337,7 @@ declare namespace ts.server.protocol {
DefinitionAndBoundSpanFull = "definitionAndBoundSpan-full",
Implementation = "implementation",
ImplementationFull = "implementation-full",
EmitOutput = "emit-output",
Exit = "exit",
Format = "format",
Formatonkey = "formatonkey",
@@ -12639,6 +12660,17 @@ declare namespace ts.server.protocol {
interface DefinitionRequest extends FileLocationRequest {
command: CommandTypes.Definition;
}
interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
readonly command: CommandTypes.DefinitionAndBoundSpan;
}
interface DefinitionAndBoundSpanResponse extends Response {
readonly body: DefinitionInfoAndBoundSpan;
}
interface EmitOutputRequest extends FileRequest {
}
interface EmitOutputResponse extends Response {
readonly body: EmitOutput;
}
interface TypeDefinitionRequest extends FileLocationRequest {
command: CommandTypes.TypeDefinition;
}
@@ -12737,6 +12769,13 @@ declare namespace ts.server.protocol {
command: CommandTypes.Rename;
arguments: RenameRequestArgs;
}
interface RenameFullRequest extends FileLocationRequest {
readonly command: CommandTypes.RenameLocationsFull;
readonly arguments: RenameRequestArgs;
}
interface RenameFullResponse extends Response {
readonly body: ReadonlyArray<RenameLocation>;
}
interface RenameInfo {
canRename: boolean;
localizedErrorMessage?: string;
@@ -13627,7 +13666,7 @@ declare namespace ts.server {
getCompilerOptions(): CompilerOptions;
getNewLine(): string;
getProjectVersion(): string;
getProjectReferences(): ReadonlyArray<ProjectReference> | undefined;
getProjectReferences(): ReadonlyArray<ProjectReference>;
getScriptFileNames(): string[];
private getOrCreateScriptInfoAndAttachToProject;
getScriptKind(fileName: string): ScriptKind;
@@ -13659,6 +13698,7 @@ declare namespace ts.server {
getGlobalProjectErrors(): ReadonlyArray<Diagnostic>;
getAllProjectErrors(): ReadonlyArray<Diagnostic>;
getLanguageService(ensureSynchronized?: boolean): LanguageService;
getSourceMapper(): SourceMapper;
private shouldEmitFile;
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean;
@@ -13741,7 +13781,7 @@ declare namespace ts.server {
updateGraph(): boolean;
getCachedDirectoryStructureHost(): CachedDirectoryStructureHost;
getConfigFilePath(): NormalizedPath;
getProjectReferences(): ReadonlyArray<ProjectReference> | undefined;
getProjectReferences(): ReadonlyArray<ProjectReference>;
updateReferences(refs: ReadonlyArray<ProjectReference> | undefined): void;
enablePlugins(): void;
getGlobalProjectErrors(): ReadonlyArray<Diagnostic>;
@@ -14017,8 +14057,8 @@ declare namespace ts.server {
getSymlinkedProjects(info: ScriptInfo): MultiMap<Project> | undefined;
private watchClosedScriptInfo;
private stopWatchingScriptInfo;
getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined, hostToQueryFileExistsOn: DirectoryStructureHost | undefined): ScriptInfo | undefined;
getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName: NormalizedPath, currentDirectory: string, fileContent: string | undefined, scriptKind: ScriptKind | undefined, hasMixedContent: boolean | undefined): ScriptInfo | undefined;
private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
private getOrCreateScriptInfoOpenedByClientForNormalizedPath;
getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: {
fileExists(path: string): boolean;
}): ScriptInfo | undefined;
@@ -14033,6 +14073,11 @@ declare namespace ts.server {
private removeRootOfInferredProjectIfNowPartOfOtherProject;
private ensureProjectForOpenFiles;
openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult;
getProjectForFileWithoutOpening(fileName: NormalizedPath): {
readonly scriptInfo: ScriptInfo;
readonly projects: ReadonlyArray<Project>;
} | undefined;
fileExists(fileName: NormalizedPath): boolean;
private findExternalProjectContainingOpenScriptInfo;
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
private telemetryOnOpenFile;
@@ -14130,11 +14175,14 @@ declare namespace ts.server {
private convertToDiagnosticsWithLinePosition;
private getDiagnosticsWorker;
private getDefinition;
private mapDefinitionInfoLocations;
private getDefinitionAndBoundSpan;
private getEmitOutput;
private mapDefinitionInfo;
private static mapToOriginalLocation;
private toFileSpan;
private getTypeDefinition;
private mapImplementationLocations;
private getImplementation;
private getOccurrences;
private getSyntacticDiagnosticsSync;
@@ -14149,6 +14197,8 @@ declare namespace ts.server {
private getProjects;
private getDefaultProject;
private getRenameLocations;
private static mapRenameInfo;
private toSpanGroups;
private getReferences;
private openClientFile;
private getPosition;
@@ -14187,6 +14237,7 @@ declare namespace ts.server {
private toLocationTextSpan;
private getNavigationTree;
private getNavigateToItems;
private getFullNavigateToItems;
private getSupportedCodeFixes;
private isLocation;
private extractPositionAndRange;
+6 -3
View File
@@ -1822,7 +1822,6 @@ declare namespace ts {
inputSourceFileNames: string[];
sourceMapNames?: string[];
sourceMapMappings: string;
sourceMapDecodedMappings: SourceMapSpan[];
}
/** Return code used by getEmitOutput function to indicate status of the function */
enum ExitStatus {
@@ -4140,10 +4139,14 @@ declare namespace ts {
* @returns A 'Program' object.
*/
function createProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): Program;
interface ResolveProjectReferencePathHost {
fileExists(fileName: string): boolean;
}
/**
* Returns the target config filename of a project reference
* Returns the target config filename of a project reference.
* Note: The file might not exist.
*/
function resolveProjectReferencePath(host: CompilerHost | UpToDateHost, ref: ProjectReference): ResolvedConfigFileName;
function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName;
}
declare namespace ts {
interface EmitOutput {
@@ -24,7 +24,7 @@ x(
// come comment
// some other comment
// @anohter
// @another
x();
>x : Symbol(x, Decl(a.js, 0, 3))
@@ -31,7 +31,7 @@ x(
// come comment
// some other comment
// @anohter
// @another
x();
>x() : any
@@ -4,6 +4,7 @@ Diagnostics:
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
EmitSkipped: false
FileName : /tests/cases/fourslash/a.js
function foo2() { return 30; } // no error - should emit a.js
@@ -0,0 +1,27 @@
//// [constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts]
// https://github.com/Microsoft/TypeScript/issues/25379
interface Map<K, V> {
// ...
}
export type ImmutableTypes = IImmutableMap<any>;
export type ImmutableModel<T> = { [K in keyof T]: T[K] extends ImmutableTypes ? T[K] : never };
export interface IImmutableMap<T extends ImmutableModel<T>> extends Map<string, any> {
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap<T>;
}
export type ImmutableTypes2 = IImmutableMap2<any>;
type isImmutableType<T> = [T] extends [ImmutableTypes2] ? T : never;
export type ImmutableModel2<T> = { [K in keyof T]: isImmutableType<T[K]> };
export interface IImmutableMap2<T extends ImmutableModel2<T>> extends Map<string, any> {
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap2<T>;
}
//// [constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.js]
"use strict";
// https://github.com/Microsoft/TypeScript/issues/25379
exports.__esModule = true;
@@ -0,0 +1,86 @@
=== tests/cases/compiler/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts ===
// https://github.com/Microsoft/TypeScript/issues/25379
interface Map<K, V> {
>Map : Symbol(Map, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 0, 0))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 2, 14))
>V : Symbol(V, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 2, 16))
// ...
}
export type ImmutableTypes = IImmutableMap<any>;
>ImmutableTypes : Symbol(ImmutableTypes, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 4, 1))
>IImmutableMap : Symbol(IImmutableMap, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 95))
export type ImmutableModel<T> = { [K in keyof T]: T[K] extends ImmutableTypes ? T[K] : never };
>ImmutableModel : Symbol(ImmutableModel, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 6, 48))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 27))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 35))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 27))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 27))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 35))
>ImmutableTypes : Symbol(ImmutableTypes, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 4, 1))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 27))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 35))
export interface IImmutableMap<T extends ImmutableModel<T>> extends Map<string, any> {
>IImmutableMap : Symbol(IImmutableMap, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 95))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 31))
>ImmutableModel : Symbol(ImmutableModel, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 6, 48))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 31))
>Map : Symbol(Map, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 0, 0))
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap<T>;
>set : Symbol(IImmutableMap.set, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 86))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 11, 8))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 31))
>key : Symbol(key, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 11, 27))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 11, 8))
>value : Symbol(value, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 11, 34))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 31))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 11, 8))
>IImmutableMap : Symbol(IImmutableMap, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 8, 95))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 10, 31))
}
export type ImmutableTypes2 = IImmutableMap2<any>;
>ImmutableTypes2 : Symbol(ImmutableTypes2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 12, 1))
>IImmutableMap2 : Symbol(IImmutableMap2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 75))
type isImmutableType<T> = [T] extends [ImmutableTypes2] ? T : never;
>isImmutableType : Symbol(isImmutableType, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 14, 50))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 15, 21))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 15, 21))
>ImmutableTypes2 : Symbol(ImmutableTypes2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 12, 1))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 15, 21))
export type ImmutableModel2<T> = { [K in keyof T]: isImmutableType<T[K]> };
>ImmutableModel2 : Symbol(ImmutableModel2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 15, 68))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 28))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 36))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 28))
>isImmutableType : Symbol(isImmutableType, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 14, 50))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 28))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 36))
export interface IImmutableMap2<T extends ImmutableModel2<T>> extends Map<string, any> {
>IImmutableMap2 : Symbol(IImmutableMap2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 75))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 32))
>ImmutableModel2 : Symbol(ImmutableModel2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 15, 68))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 32))
>Map : Symbol(Map, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 0, 0))
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap2<T>;
>set : Symbol(IImmutableMap2.set, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 88))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 18, 8))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 32))
>key : Symbol(key, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 18, 27))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 18, 8))
>value : Symbol(value, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 18, 34))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 32))
>K : Symbol(K, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 18, 8))
>IImmutableMap2 : Symbol(IImmutableMap2, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 16, 75))
>T : Symbol(T, Decl(constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts, 17, 32))
}
@@ -0,0 +1,86 @@
=== tests/cases/compiler/constraintOfRecursivelyMappedTypeWithConditionalIsResolvable.ts ===
// https://github.com/Microsoft/TypeScript/issues/25379
interface Map<K, V> {
>Map : Map<K, V>
>K : K
>V : V
// ...
}
export type ImmutableTypes = IImmutableMap<any>;
>ImmutableTypes : IImmutableMap<any>
>IImmutableMap : IImmutableMap<T>
export type ImmutableModel<T> = { [K in keyof T]: T[K] extends ImmutableTypes ? T[K] : never };
>ImmutableModel : ImmutableModel<T>
>T : T
>K : K
>T : T
>T : T
>K : K
>ImmutableTypes : IImmutableMap<any>
>T : T
>K : K
export interface IImmutableMap<T extends ImmutableModel<T>> extends Map<string, any> {
>IImmutableMap : IImmutableMap<T>
>T : T
>ImmutableModel : ImmutableModel<T>
>T : T
>Map : Map<K, V>
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap<T>;
>set : <K extends keyof T>(key: K, value: T[K]) => IImmutableMap<T>
>K : K
>T : T
>key : K
>K : K
>value : T[K]
>T : T
>K : K
>IImmutableMap : IImmutableMap<T>
>T : T
}
export type ImmutableTypes2 = IImmutableMap2<any>;
>ImmutableTypes2 : IImmutableMap2<any>
>IImmutableMap2 : IImmutableMap2<T>
type isImmutableType<T> = [T] extends [ImmutableTypes2] ? T : never;
>isImmutableType : isImmutableType<T>
>T : T
>T : T
>ImmutableTypes2 : IImmutableMap2<any>
>T : T
export type ImmutableModel2<T> = { [K in keyof T]: isImmutableType<T[K]> };
>ImmutableModel2 : ImmutableModel2<T>
>T : T
>K : K
>T : T
>isImmutableType : isImmutableType<T>
>T : T
>K : K
export interface IImmutableMap2<T extends ImmutableModel2<T>> extends Map<string, any> {
>IImmutableMap2 : IImmutableMap2<T>
>T : T
>ImmutableModel2 : ImmutableModel2<T>
>T : T
>Map : Map<K, V>
set<K extends keyof T>(key: K, value: T[K]): IImmutableMap2<T>;
>set : <K extends keyof T>(key: K, value: T[K]) => IImmutableMap2<T>
>K : K
>T : T
>key : K
>K : K
>value : T[K]
>T : T
>K : K
>IImmutableMap2 : IImmutableMap2<T>
>T : T
}
@@ -1,34 +0,0 @@
EmitSkipped: false
FileName : ./dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Foo = /** @class */ (function () {
function Foo() {
}
Foo.prototype.methodName = function (propName) { };
Foo.prototype.otherMethod = function () {
if (Math.random() > 0.5) {
return { x: 42 };
}
return { y: "yes" };
};
return Foo;
}());
exports.Foo = Foo;
FileName : ./dist/index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../tests/cases/fourslash/index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IACpC,WAAW;;;;;;;CAMd;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB"}FileName : ./dist/index.d.ts
export declare class Foo {
member: string;
methodName(propName: SomeType): void;
otherMethod(): {
x: number;
y?: undefined;
} | {
y: string;
x?: undefined;
};
}
export interface SomeType {
member: number;
}
//# sourceMappingURL=index.d.ts.map
@@ -1,35 +0,0 @@
EmitSkipped: false
FileName : ./dist/index.js.map
{"version":3,"file":"index.js","sourceRoot":"/tests/cases/fourslash/","sources":["index.ts"],"names":[],"mappings":";;AAAA;IAAA;IASA,CAAC;IAPG,wBAAU,GAAV,UAAW,QAAkB,IAAS,CAAC;IACvC,yBAAW,GAAX;QACI,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;YACrB,OAAO,EAAC,CAAC,EAAE,EAAE,EAAC,CAAC;SAClB;QACD,OAAO,EAAC,CAAC,EAAE,KAAK,EAAC,CAAC;IACtB,CAAC;IACL,UAAC;AAAD,CAAC,AATD,IASC;AATY,kBAAG"}FileName : ./dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Foo = /** @class */ (function () {
function Foo() {
}
Foo.prototype.methodName = function (propName) { };
Foo.prototype.otherMethod = function () {
if (Math.random() > 0.5) {
return { x: 42 };
}
return { y: "yes" };
};
return Foo;
}());
exports.Foo = Foo;
//# sourceMappingURL=index.js.mapFileName : ./dist/index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"/tests/cases/fourslash/","sources":["index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IACpC,WAAW;;;;;;;CAMd;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB"}FileName : ./dist/index.d.ts
export declare class Foo {
member: string;
methodName(propName: SomeType): void;
otherMethod(): {
x: number;
y?: undefined;
} | {
y: string;
x?: undefined;
};
}
export interface SomeType {
member: number;
}
//# sourceMappingURL=index.d.ts.map
@@ -1,34 +0,0 @@
EmitSkipped: false
FileName : ./dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Foo = /** @class */ (function () {
function Foo() {
}
Foo.prototype.methodName = function (propName) { };
Foo.prototype.otherMethod = function () {
if (Math.random() > 0.5) {
return { x: 42 };
}
return { y: "yes" };
};
return Foo;
}());
exports.Foo = Foo;
FileName : ./dist/index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"/tests/cases/fourslash/","sources":["index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IACpC,WAAW;;;;;;;CAMd;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB"}FileName : ./dist/index.d.ts
export declare class Foo {
member: string;
methodName(propName: SomeType): void;
otherMethod(): {
x: number;
y?: undefined;
} | {
y: string;
x?: undefined;
};
}
export interface SomeType {
member: number;
}
//# sourceMappingURL=index.d.ts.map
@@ -1,34 +0,0 @@
EmitSkipped: false
FileName : ./dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Foo = /** @class */ (function () {
function Foo() {
}
Foo.prototype.methodName = function (propName) { };
Foo.prototype.otherMethod = function () {
if (Math.random() > 0.5) {
return { x: 42 };
}
return { y: "yes" };
};
return Foo;
}());
exports.Foo = Foo;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90ZXN0cy9jYXNlcy9mb3Vyc2xhc2gvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTtJQUFBO0lBU0EsQ0FBQztJQVBHLHdCQUFVLEdBQVYsVUFBVyxRQUFrQixJQUFTLENBQUM7SUFDdkMseUJBQVcsR0FBWDtRQUNJLElBQUksSUFBSSxDQUFDLE1BQU0sRUFBRSxHQUFHLEdBQUcsRUFBRTtZQUNyQixPQUFPLEVBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBQyxDQUFDO1NBQ2xCO1FBQ0QsT0FBTyxFQUFDLENBQUMsRUFBRSxLQUFLLEVBQUMsQ0FBQztJQUN0QixDQUFDO0lBQ0wsVUFBQztBQUFELENBQUMsQUFURCxJQVNDO0FBVFksa0JBQUcifQ==FileName : ./dist/index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../tests/cases/fourslash/index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IACpC,WAAW;;;;;;;CAMd;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB"}FileName : ./dist/index.d.ts
export declare class Foo {
member: string;
methodName(propName: SomeType): void;
otherMethod(): {
x: number;
y?: undefined;
} | {
y: string;
x?: undefined;
};
}
export interface SomeType {
member: number;
}
//# sourceMappingURL=index.d.ts.map
@@ -1,34 +0,0 @@
EmitSkipped: false
FileName : ./dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Foo = /** @class */ (function () {
function Foo() {
}
Foo.prototype.methodName = function (propName) { };
Foo.prototype.otherMethod = function () {
if (Math.random() > 0.5) {
return { x: 42 };
}
return { y: "yes" };
};
return Foo;
}());
exports.Foo = Foo;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90ZXN0cy9jYXNlcy9mb3Vyc2xhc2gvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTtJQUFBO0lBU0EsQ0FBQztJQVBHLHdCQUFVLEdBQVYsVUFBVyxRQUFrQixJQUFTLENBQUM7SUFDdkMseUJBQVcsR0FBWDtRQUNJLElBQUksSUFBSSxDQUFDLE1BQU0sRUFBRSxHQUFHLEdBQUcsRUFBRTtZQUNyQixPQUFPLEVBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBQyxDQUFDO1NBQ2xCO1FBQ0QsT0FBTyxFQUFDLENBQUMsRUFBRSxLQUFLLEVBQUMsQ0FBQztJQUN0QixDQUFDO0lBQ0wsVUFBQztBQUFELENBQUMsQUFURCxJQVNDO0FBVFksa0JBQUciLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY2xhc3MgRm9vIHtcbiAgICBtZW1iZXI6IHN0cmluZztcbiAgICBtZXRob2ROYW1lKHByb3BOYW1lOiBTb21lVHlwZSk6IHZvaWQge31cbiAgICBvdGhlck1ldGhvZCgpIHtcbiAgICAgICAgaWYgKE1hdGgucmFuZG9tKCkgPiAwLjUpIHtcbiAgICAgICAgICAgIHJldHVybiB7eDogNDJ9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7eTogXCJ5ZXNcIn07XG4gICAgfVxufVxuXG5leHBvcnQgaW50ZXJmYWNlIFNvbWVUeXBlIHtcbiAgICBtZW1iZXI6IG51bWJlcjtcbn0iXX0=FileName : ./dist/index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../tests/cases/fourslash/index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IACpC,WAAW;;;;;;;CAMd;AAED,MAAM,WAAW,QAAQ;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB"}FileName : ./dist/index.d.ts
export declare class Foo {
member: string;
methodName(propName: SomeType): void;
otherMethod(): {
x: number;
y?: undefined;
} | {
y: string;
x?: undefined;
};
}
export interface SomeType {
member: number;
}
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,31 @@
/node_modules/@types/react/index.d.ts(1,9): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
/src/index.ts(1,24): error TS2306: File '/node_modules/@types/react/index.d.ts' is not a module.
/tests/index.ts(1,24): error TS2306: File '/tests/node_modules/@types/react/index.d.ts' is not a module.
==== /src/bug25410.ts (0 errors) ====
import { x } from './index'
import { y } from '../tests/index'
==== /src/index.ts (1 errors) ====
import * as React from 'react';
~~~~~~~
!!! error TS2306: File '/node_modules/@types/react/index.d.ts' is not a module.
export var x = 1
==== /tests/index.ts (1 errors) ====
import * as React from 'react';
~~~~~~~
!!! error TS2306: File '/tests/node_modules/@types/react/index.d.ts' is not a module.
export var y = 2
==== /tests/node_modules/@types/react/package.json (0 errors) ====
{ "name": "@types/react", "version": "16.4.6" }
==== /tests/node_modules/@types/react/index.d.ts (0 errors) ====
==== /node_modules/@types/react/package.json (0 errors) ====
{ "name": "@types/react", "version": "16.4.6" }
==== /node_modules/@types/react/index.d.ts (1 errors) ====
declare global { }
~~~~~~
!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.
@@ -0,0 +1,34 @@
//// [tests/cases/compiler/duplicatePackage_globalMerge.ts] ////
//// [index.ts]
import * as React from 'react';
export var x = 1
//// [index.ts]
import * as React from 'react';
export var y = 2
//// [package.json]
{ "name": "@types/react", "version": "16.4.6" }
//// [index.d.ts]
//// [package.json]
{ "name": "@types/react", "version": "16.4.6" }
//// [index.d.ts]
declare global { }
//// [bug25410.ts]
import { x } from './index'
import { y } from '../tests/index'
//// [index.js]
"use strict";
exports.__esModule = true;
exports.x = 1;
//// [index.js]
"use strict";
exports.__esModule = true;
exports.y = 2;
//// [bug25410.js]
"use strict";
exports.__esModule = true;
@@ -0,0 +1,29 @@
=== /src/bug25410.ts ===
import { x } from './index'
>x : Symbol(x, Decl(bug25410.ts, 0, 8))
import { y } from '../tests/index'
>y : Symbol(y, Decl(bug25410.ts, 1, 8))
=== /src/index.ts ===
import * as React from 'react';
>React : Symbol(React, Decl(index.ts, 0, 6))
export var x = 1
>x : Symbol(x, Decl(index.ts, 1, 10))
=== /tests/index.ts ===
import * as React from 'react';
>React : Symbol(React, Decl(index.ts, 0, 6))
export var y = 2
>y : Symbol(y, Decl(index.ts, 1, 10))
=== /tests/node_modules/@types/react/index.d.ts ===
>global : Symbol(global, Decl(index.d.ts, 0, 0))
=== /node_modules/@types/react/index.d.ts ===
declare global { }
>global : Symbol(global, Decl(index.d.ts, 0, 0))
@@ -0,0 +1,31 @@
=== /src/bug25410.ts ===
import { x } from './index'
>x : number
import { y } from '../tests/index'
>y : number
=== /src/index.ts ===
import * as React from 'react';
>React : any
export var x = 1
>x : number
>1 : 1
=== /tests/index.ts ===
import * as React from 'react';
>React : any
export var y = 2
>y : number
>2 : 2
=== /tests/node_modules/@types/react/index.d.ts ===
>global : typeof global
=== /node_modules/@types/react/index.d.ts ===
declare global { }
>global : typeof global
+1 -1
View File
@@ -141,7 +141,7 @@ namespace N {
>T5 : T5
}
export declare type T7 = {
>T7 : { [N.c2]: number; [N.c3]: string; [N.s1]: boolean; }
>T7 : T7
[N.c2]: number;
>[N.c2] : number
@@ -0,0 +1,21 @@
//// [tests/cases/compiler/exportAssignedNamespaceIsVisibleInDeclarationEmit.ts] ////
//// [thing.d.ts]
declare namespace Foo {
export interface Bar {}
export function f(): Bar;
}
export = Foo;
//// [index.ts]
import { f } from "./thing";
export const thing = f();
//// [index.js]
"use strict";
exports.__esModule = true;
var thing_1 = require("./thing");
exports.thing = thing_1.f();
//// [index.d.ts]
export declare const thing: import("./thing").Bar;
@@ -0,0 +1,22 @@
=== tests/cases/compiler/thing.d.ts ===
declare namespace Foo {
>Foo : Symbol(Foo, Decl(thing.d.ts, 0, 0))
export interface Bar {}
>Bar : Symbol(Bar, Decl(thing.d.ts, 0, 23))
export function f(): Bar;
>f : Symbol(f, Decl(thing.d.ts, 1, 27))
>Bar : Symbol(Bar, Decl(thing.d.ts, 0, 23))
}
export = Foo;
>Foo : Symbol(Foo, Decl(thing.d.ts, 0, 0))
=== tests/cases/compiler/index.ts ===
import { f } from "./thing";
>f : Symbol(f, Decl(index.ts, 0, 8))
export const thing = f();
>thing : Symbol(thing, Decl(index.ts, 1, 12))
>f : Symbol(f, Decl(index.ts, 0, 8))
@@ -0,0 +1,23 @@
=== tests/cases/compiler/thing.d.ts ===
declare namespace Foo {
>Foo : typeof Foo
export interface Bar {}
>Bar : Bar
export function f(): Bar;
>f : () => Bar
>Bar : Bar
}
export = Foo;
>Foo : typeof Foo
=== tests/cases/compiler/index.ts ===
import { f } from "./thing";
>f : () => import("tests/cases/compiler/thing").Bar
export const thing = f();
>thing : import("tests/cases/compiler/thing").Bar
>f() : import("tests/cases/compiler/thing").Bar
>f : () => import("tests/cases/compiler/thing").Bar
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/shims-pp/inputFile1.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -6,6 +7,7 @@ var Bar = /** @class */ (function () {
}
return Bar;
}());
FileName : /tests/cases/fourslash/shims-pp/inputFile1.d.ts
declare var x: number;
declare class Bar {
@@ -14,6 +16,7 @@ declare class Bar {
}
EmitSkipped: false
FileName : /tests/cases/fourslash/shims-pp/inputFile2.js
var x1 = "hello world";
var Foo = /** @class */ (function () {
@@ -21,6 +24,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : /tests/cases/fourslash/shims-pp/inputFile2.d.ts
declare var x1: string;
declare class Foo {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/shims/inputFile1.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -6,6 +7,7 @@ var Bar = /** @class */ (function () {
}
return Bar;
}());
FileName : /tests/cases/fourslash/shims/inputFile1.d.ts
declare var x: number;
declare class Bar {
@@ -14,6 +16,7 @@ declare class Bar {
}
EmitSkipped: false
FileName : /tests/cases/fourslash/shims/inputFile2.js
var x1 = "hello world";
var Foo = /** @class */ (function () {
@@ -21,6 +24,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : /tests/cases/fourslash/shims/inputFile2.d.ts
declare var x1: string;
declare class Foo {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/inputFile1.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -6,6 +7,7 @@ var Bar = /** @class */ (function () {
}
return Bar;
}());
FileName : /tests/cases/fourslash/inputFile1.d.ts
declare var x: number;
declare class Bar {
@@ -14,6 +16,7 @@ declare class Bar {
}
EmitSkipped: false
FileName : /tests/cases/fourslash/inputFile2.js
var x1 = "hello world";
var Foo = /** @class */ (function () {
@@ -21,6 +24,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : /tests/cases/fourslash/inputFile2.d.ts
declare var x1: string;
declare class Foo {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : declSingleFile.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -12,6 +13,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : declSingleFile.d.ts
declare var x: number;
declare class Bar {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : declSingleFile.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : declSingleFile.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -1,6 +1,8 @@
EmitSkipped: false
FileName : declSingleFile.js.map
{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : declSingleFile.js
{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}
FileName : declSingleFile.js
var x = 109;
var foo = "hello world";
var M = /** @class */ (function () {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/inputFile.js
var x;
var M = /** @class */ (function () {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/inputFile2.js
var x;
var Foo = /** @class */ (function () {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : out.js
/// <reference path='my.d.ts' />
var foo;
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : outFile.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -12,6 +13,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : outFile.d.ts
declare var x: number;
declare class Bar {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : outputDir/singleFile.js
var x;
var Bar = /** @class */ (function () {
@@ -1,4 +1,5 @@
EmitSkipped: false
FileName : declSingleFile.js
var x = 5;
var Bar = /** @class */ (function () {
@@ -12,6 +13,7 @@ var Foo = /** @class */ (function () {
}
return Foo;
}());
FileName : declSingleFile.d.ts
declare var x: number;
declare class Bar {
@@ -1,6 +1,8 @@
EmitSkipped: false
FileName : /tests/cases/fourslash/inputFile.js.map
{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : /tests/cases/fourslash/inputFile.js
{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}
FileName : /tests/cases/fourslash/inputFile.js
var x = 109;
var foo = "hello world";
var M = /** @class */ (function () {
@@ -1,6 +1,8 @@
EmitSkipped: false
FileName : sample/outDir/inputFile1.js.map
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}FileName : sample/outDir/inputFile1.js
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB;IAAA;IAGA,CAAC;IAAD,QAAC;AAAD,CAAC,AAHD,IAGC"}
FileName : sample/outDir/inputFile1.js
var x = 109;
var foo = "hello world";
var M = /** @class */ (function () {
@@ -10,8 +12,10 @@ var M = /** @class */ (function () {
}());
//# sourceMappingURL=inputFile1.js.map
EmitSkipped: false
FileName : sample/outDir/inputFile2.js.map
{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,IAAI,KAAK,KAAK,SAAS,EAAE;IACtB,IAAI,CAAC,GAAG,EAAE,CAAC;CACb"}FileName : sample/outDir/inputFile2.js
{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,IAAI,KAAK,KAAK,SAAS,EAAE;IACtB,IAAI,CAAC,GAAG,EAAE,CAAC;CACb"}
FileName : sample/outDir/inputFile2.js
var intro = "hello world";
if (intro !== undefined) {
var k = 10;

Some files were not shown because too many files have changed in this diff Show More