From 0c0d607087190bb5ec7f1c24a02f72bdf8651c96 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 4 Aug 2014 18:06:44 -0700 Subject: [PATCH 01/21] Removed duplicate messages from diagnosticMessages.json. --- .../diagnosticInformationMap.generated.ts | 8 ++++---- src/compiler/diagnosticMessages.json | 20 ------------------- ...ontShowCompilerGeneratedMembers.errors.txt | 4 ++-- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index cc789bcca11..eaa87cb7aa2 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -8,9 +8,9 @@ module ts { Unrecognized_escape_sequence: { code: 1000, category: DiagnosticCategory.Error, key: "Unrecognized escape sequence." }, Unexpected_character_0: { code: 1001, category: DiagnosticCategory.Error, key: "Unexpected character {0}." }, Missing_close_quote_character: { code: 1002, category: DiagnosticCategory.Error, key: "Missing close quote character." }, - Identifier_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Identifier expected." }, + Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, _0_keyword_expected: { code: 1004, category: DiagnosticCategory.Error, key: "'{0}' keyword expected." }, - _0_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'{0}' expected." }, + _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, Identifier_expected_0_is_a_keyword: { code: 1006, category: DiagnosticCategory.Error, key: "Identifier expected; '{0}' is a keyword." }, Automatic_semicolon_insertion_not_allowed: { code: 1007, category: DiagnosticCategory.Error, key: "Automatic semicolon insertion not allowed." }, Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, @@ -93,8 +93,8 @@ module ts { A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Expression expected." }, - Type_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type expected." }, + Expression_expected: { code: 1109, category: DiagnosticCategory.Error, key: "Expression expected." }, + Type_expected: { code: 1110, category: DiagnosticCategory.Error, key: "Type expected." }, A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: DiagnosticCategory.Error, key: "A constructor implementation cannot be declared in an ambient context." }, A_class_member_cannot_be_declared_optional: { code: 1112, category: DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d60fd2e5c4f..2916f9f2db5 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1259,22 +1259,10 @@ "category": "Error", "code": -9999999 }, - "'{0}' expected.": { - "category": "Error", - "code": -9999999 - }, - "Identifier expected.": { - "category": "Error", - "code": -9999999 - }, "String literal expected.": { "category": "Error", "code": -9999999 }, - "Type expected.": { - "category": "Error", - "code": -9999999 - }, "'=>' not preceded by parameter list.": { "category": "Error", "code": -9999999 @@ -1287,10 +1275,6 @@ "category": "Error", "code": -9999999 }, - "Expression expected.": { - "category": "Error", - "code": -9999999 - }, "Line break not permitted here.": { "category": "Error", "code": -9999999 @@ -1363,10 +1347,6 @@ "category": "Error", "code": -9999999 }, - "Only public methods of the base class are accessible via the 'super' keyword": { - "category": "Error", - "code": -9999999 - }, "Import name cannot be '{0}'": { "category": "Error", "code": -9999999 diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index fdf27296612..b3745deb0bd 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -8,9 +8,9 @@ ~ !!! Type parameter list cannot be empty. ~ -!!! '(' expected. - ~ !!! Type parameter declaration expected. + ~ +!!! '(' expected. }; ~ !!! Expression expected. \ No newline at end of file From 2bc8359b167513543ec89b873e57b2e271f6c5a6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 6 Aug 2014 15:47:28 -0700 Subject: [PATCH 02/21] Removed unused diagnostics. --- .../diagnosticInformationMap.generated.ts | 35 ----- src/compiler/diagnosticMessages.json | 142 +----------------- 2 files changed, 1 insertion(+), 176 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index eaa87cb7aa2..20edbf7cd8a 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -5,17 +5,10 @@ module ts { Unknown_compiler_option_0: { code: 6001, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, File_0_not_found: { code: 6002, category: DiagnosticCategory.Error, key: "File '{0}' not found." }, File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Unrecognized_escape_sequence: { code: 1000, category: DiagnosticCategory.Error, key: "Unrecognized escape sequence." }, - Unexpected_character_0: { code: 1001, category: DiagnosticCategory.Error, key: "Unexpected character {0}." }, - Missing_close_quote_character: { code: 1002, category: DiagnosticCategory.Error, key: "Missing close quote character." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, - _0_keyword_expected: { code: 1004, category: DiagnosticCategory.Error, key: "'{0}' keyword expected." }, _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, - Identifier_expected_0_is_a_keyword: { code: 1006, category: DiagnosticCategory.Error, key: "Identifier expected; '{0}' is a keyword." }, - Automatic_semicolon_insertion_not_allowed: { code: 1007, category: DiagnosticCategory.Error, key: "Automatic semicolon insertion not allowed." }, Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." }, - public_or_private_modifier_must_precede_static: { code: 1011, category: DiagnosticCategory.Error, key: "'public' or 'private' modifier must precede 'static'." }, Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." }, Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation." }, A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, @@ -28,16 +21,10 @@ module ts { An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, - extends_clause_already_seen: { code: 1024, category: DiagnosticCategory.Error, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1027, category: DiagnosticCategory.Error, key: "'implements' clause already seen." }, Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, _0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, _0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, - Interface_declaration_cannot_have_implements_clause: { code: 1032, category: DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, - super_invocation_cannot_have_type_arguments: { code: 1034, category: DiagnosticCategory.Error, key: "'super' invocation cannot have type arguments." }, Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: DiagnosticCategory.Error, key: "A function implementation cannot be declared in an ambient context." }, @@ -53,25 +40,18 @@ module ts { A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, - Modifiers_cannot_appear_here: { code: 1055, category: DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, Enum_member_must_have_initializer: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, - module_class_interface_enum_import_or_statement: { code: 1067, category: DiagnosticCategory.NoPrefix, key: "module, class, interface, enum, import or statement" }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, statement: { code: 1069, category: DiagnosticCategory.NoPrefix, key: "statement" }, - case_or_default_clause: { code: 1070, category: DiagnosticCategory.NoPrefix, key: "case or default clause" }, identifier: { code: 1071, category: DiagnosticCategory.NoPrefix, key: "identifier" }, - call_construct_index_property_or_function_signature: { code: 1072, category: DiagnosticCategory.NoPrefix, key: "call, construct, index, property or function signature" }, expression: { code: 1073, category: DiagnosticCategory.NoPrefix, key: "expression" }, - type_name: { code: 1074, category: DiagnosticCategory.NoPrefix, key: "type name" }, - property_or_accessor: { code: 1075, category: DiagnosticCategory.NoPrefix, key: "property or accessor" }, parameter: { code: 1076, category: DiagnosticCategory.NoPrefix, key: "parameter" }, type: { code: 1077, category: DiagnosticCategory.NoPrefix, key: "type" }, type_parameter: { code: 1078, category: DiagnosticCategory.NoPrefix, key: "type parameter" }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, @@ -246,13 +226,10 @@ module ts { Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." }, - Skip_resolution_and_preprocessing: { code: 6010, category: DiagnosticCategory.Message, key: "Skip resolution and preprocessing." }, Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: DiagnosticCategory.Message, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: DiagnosticCategory.Message, key: "Print the compiler's version." }, - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: { code: 6021, category: DiagnosticCategory.Message, key: "Allow use of deprecated '{0}' keyword when referencing an external module." }, - Specify_locale_for_errors_and_messages_For_example_0_or_1: { code: 6022, category: DiagnosticCategory.Message, key: "Specify locale for errors and messages. For example '{0}' or '{1}'" }, Syntax_Colon_0: { code: 6023, category: DiagnosticCategory.Message, key: "Syntax: {0}" }, options: { code: 6024, category: DiagnosticCategory.Message, key: "options" }, file: { code: 6025, category: DiagnosticCategory.Message, key: "file" }, @@ -260,17 +237,12 @@ module ts { Options_Colon: { code: 6027, category: DiagnosticCategory.Message, key: "Options:" }, Version_0: { code: 6029, category: DiagnosticCategory.Message, key: "Version {0}" }, Insert_command_line_options_and_files_from_a_file: { code: 6030, category: DiagnosticCategory.Message, key: "Insert command line options and files from a file." }, - Use_the_0_flag_to_see_options: { code: 6031, category: DiagnosticCategory.Message, key: "Use the '{0}' flag to see options." }, File_change_detected_Compiling: { code: 6032, category: DiagnosticCategory.Message, key: "File change detected. Compiling..." }, - STRING: { code: 6033, category: DiagnosticCategory.Message, key: "STRING" }, KIND: { code: 6034, category: DiagnosticCategory.Message, key: "KIND" }, FILE: { code: 6035, category: DiagnosticCategory.Message, key: "FILE" }, VERSION: { code: 6036, category: DiagnosticCategory.Message, key: "VERSION" }, LOCATION: { code: 6037, category: DiagnosticCategory.Message, key: "LOCATION" }, DIRECTORY: { code: 6038, category: DiagnosticCategory.Message, key: "DIRECTORY" }, - NUMBER: { code: 6039, category: DiagnosticCategory.Message, key: "NUMBER" }, - Specify_the_codepage_to_use_when_opening_source_files: { code: 6040, category: DiagnosticCategory.Message, key: "Specify the codepage to use when opening source files." }, - Additional_locations_Colon: { code: 6041, category: DiagnosticCategory.Message, key: "Additional locations:" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: DiagnosticCategory.Message, key: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, @@ -281,7 +253,6 @@ module ts { Unsupported_locale_0: { code: 6048, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, Corrupted_locale_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, - No_input_files_specified: { code: 6051, category: DiagnosticCategory.Error, key: "No input files specified." }, Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 7004, category: DiagnosticCategory.Message, key: "Warn on expressions and declarations with an implied 'any' type." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, @@ -290,8 +261,6 @@ module ts { _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: DiagnosticCategory.Error, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Array_literal_implicitly_has_an_0_type: { code: 7015, category: DiagnosticCategory.Error, key: "Array literal implicitly has an '{0}' type." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, @@ -317,14 +286,11 @@ module ts { Type_parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, Type_argument_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type argument expected." }, String_literal_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "String literal expected." }, - not_preceded_by_parameter_list: { code: -9999999, category: DiagnosticCategory.Error, key: "'=>' not preceded by parameter list." }, - Invalid_assignment_target: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid assignment target." }, super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: DiagnosticCategory.Error, key: "'super' must be followed by argument list or member access." }, Line_break_not_permitted_here: { code: -9999999, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, catch_or_finally_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." }, Block_or_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Block or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, - Class_member_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Class member declaration expected." }, Declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration expected." }, Invalid_reference_comment: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid reference comment." }, File_0_is_not_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, @@ -345,7 +311,6 @@ module ts { Enum_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Unknown_identifier_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unknown identifier '{0}'." }, Property_0_is_inaccessible: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2916f9f2db5..f21e75a7e31 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -12,38 +12,14 @@ "code": 6003 }, - "Unrecognized escape sequence.": { - "category": "Error", - "code": 1000 - }, - "Unexpected character {0}.": { - "category": "Error", - "code": 1001 - }, - "Missing close quote character.": { - "category": "Error", - "code": 1002 - }, "Identifier expected.": { "category": "Error", "code": 1003 }, - "'{0}' keyword expected.": { - "category": "Error", - "code": 1004 - }, "'{0}' expected.": { "category": "Error", "code": 1005 }, - "Identifier expected; '{0}' is a keyword.": { - "category": "Error", - "code": 1006 - }, - "Automatic semicolon insertion not allowed.": { - "category": "Error", - "code": 1007 - }, "Trailing comma not allowed.": { "category": "Error", "code": 1009 @@ -52,10 +28,6 @@ "category": "Error", "code": 1010 }, - "'public' or 'private' modifier must precede 'static'.": { - "category": "Error", - "code": 1011 - }, "Unexpected token.": { "category": "Error", "code": 1012 @@ -104,22 +76,6 @@ "category": "Error", "code": 1023 }, - "'extends' clause already seen.": { - "category": "Error", - "code": 1024 - }, - "'extends' clause must precede 'implements' clause.": { - "category": "Error", - "code": 1025 - }, - "Classes can only extend a single class.": { - "category": "Error", - "code": 1026 - }, - "'implements' clause already seen.": { - "category": "Error", - "code": 1027 - }, "Accessibility modifier already seen.": { "category": "Error", "code": 1028 @@ -136,14 +92,6 @@ "category": "Error", "code": 1031 }, - "Interface declaration cannot have 'implements' clause.": { - "category": "Error", - "code": 1032 - }, - "'super' invocation cannot have type arguments.": { - "category": "Error", - "code": 1034 - }, "Only ambient modules can use quoted names.": { "category": "Error", "code": 1035 @@ -204,10 +152,6 @@ "category": "Error", "code": 1054 }, - "Modifiers cannot appear here.": { - "category": "Error", - "code": 1055 - }, "Accessors are only available when targeting ECMAScript 5 and higher.": { "category": "Error", "code": 1056 @@ -224,10 +168,6 @@ "category": "Error", "code": 1066 }, - "module, class, interface, enum, import or statement": { - "category": "NoPrefix", - "code": 1067 - }, "Unexpected token. A constructor, method, accessor, or property was expected." : { "category": "Error", "code": 1068 @@ -236,30 +176,14 @@ "category": "NoPrefix", "code": 1069 }, - "case or default clause": { - "category": "NoPrefix", - "code": 1070 - }, "identifier": { "category": "NoPrefix", "code": 1071 }, - "call, construct, index, property or function signature": { - "category": "NoPrefix", - "code": 1072 - }, "expression": { "category": "NoPrefix", "code": 1073 }, - "type name": { - "category": "NoPrefix", - "code": 1074 - }, - "property or accessor": { - "category": "NoPrefix", - "code": 1075 - }, "parameter": { "category": "NoPrefix", "code": 1076 @@ -276,10 +200,6 @@ "category": "Error", "code": 1079 }, - "Invalid 'reference' directive syntax.": { - "category": "Error", - "code": 1084 - }, "Octal literals are not available when targeting ECMAScript 5 and higher.": { "category": "Error", "code": 1085 @@ -978,10 +898,6 @@ "category": "Message", "code": 6009 }, - "Skip resolution and preprocessing.": { - "category": "Message", - "code": 6010 - }, "Specify ECMAScript target version: 'ES3' (default), or 'ES5'": { "category": "Message", "code": 6015 @@ -998,14 +914,6 @@ "category": "Message", "code": 6019 }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { - "category": "Message", - "code": 6021 - }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { - "category": "Message", - "code": 6022 - }, "Syntax: {0}": { "category": "Message", "code": 6023 @@ -1035,17 +943,9 @@ "category": "Message", "code": 6030 }, - "Use the '{0}' flag to see options.": { - "category": "Message", - "code": 6031 - }, "File change detected. Compiling...": { "category": "Message", "code": 6032 - }, - "STRING": { - "category": "Message", - "code": 6033 }, "KIND": { "category": "Message", @@ -1067,19 +967,7 @@ "category": "Message", "code": 6038 }, - "NUMBER": { - "category": "Message", - "code": 6039 - }, - "Specify the codepage to use when opening source files.": { - "category": "Message", - "code": 6040 - }, - "Additional locations:": { - "category": "Message", - "code": 6041 - }, - "Compilation complete. Watching for file changes.": { + "Compilation complete. Watching for file changes.": { "category": "Message", "code": 6042 }, @@ -1119,10 +1007,6 @@ "category": "Error", "code": 6050 }, - "No input files specified.": { - "category": "Error", - "code": 6051 - }, "Warn on expressions and declarations with an implied 'any' type.": { "category": "Message", "code": 7004 @@ -1155,14 +1039,6 @@ "category": "Error", "code": 7013 }, - "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type.": { - "category": "Error", - "code": 7014 - }, - "Array literal implicitly has an '{0}' type.": { - "category": "Error", - "code": 7015 - }, "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { "category": "Error", "code": 7016 @@ -1263,14 +1139,6 @@ "category": "Error", "code": -9999999 }, - "'=>' not preceded by parameter list.": { - "category": "Error", - "code": -9999999 - }, - "Invalid assignment target.": { - "category": "Error", - "code": -9999999 - }, "'super' must be followed by argument list or member access.": { "category": "Error", "code": -9999999 @@ -1291,10 +1159,6 @@ "category": "Error", "code": -9999999 }, - "Class member declaration expected.": { - "category": "Error", - "code": -9999999 - }, "Declaration expected.": { "category": "Error", "code": -9999999 @@ -1375,10 +1239,6 @@ "category": "Error", "code": -9999999 }, - "Unknown identifier '{0}'.": { - "category": "Error", - "code": -9999999 - }, "Property '{0}' is inaccessible.": { "category": "Error", "code": -9999999 From d7e3447909ba5845dfbe4e37c58432a416d4c476 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 7 Aug 2014 15:11:55 -0700 Subject: [PATCH 03/21] Removed more unused diagnostics. --- .../diagnosticInformationMap.generated.ts | 6 ----- src/compiler/diagnosticMessages.json | 24 ------------------- 2 files changed, 30 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 20edbf7cd8a..324c2a16f5f 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -45,12 +45,6 @@ module ts { An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - statement: { code: 1069, category: DiagnosticCategory.NoPrefix, key: "statement" }, - identifier: { code: 1071, category: DiagnosticCategory.NoPrefix, key: "identifier" }, - expression: { code: 1073, category: DiagnosticCategory.NoPrefix, key: "expression" }, - parameter: { code: 1076, category: DiagnosticCategory.NoPrefix, key: "parameter" }, - type: { code: 1077, category: DiagnosticCategory.NoPrefix, key: "type" }, - type_parameter: { code: 1078, category: DiagnosticCategory.NoPrefix, key: "type parameter" }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f21e75a7e31..73b6e2b0cc2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -172,30 +172,6 @@ "category": "Error", "code": 1068 }, - "statement": { - "category": "NoPrefix", - "code": 1069 - }, - "identifier": { - "category": "NoPrefix", - "code": 1071 - }, - "expression": { - "category": "NoPrefix", - "code": 1073 - }, - "parameter": { - "category": "NoPrefix", - "code": 1076 - }, - "type": { - "category": "NoPrefix", - "code": 1077 - }, - "type parameter": { - "category": "NoPrefix", - "code": 1078 - }, "A 'declare' modifier cannot be used with an import declaration.": { "category": "Error", "code": 1079 From 122b78612cc449818898ca69354fc3d791e61eff Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 7 Aug 2014 15:44:21 -0700 Subject: [PATCH 04/21] Recovered deleted, renumbered existing, reworded some. --- .../diagnosticInformationMap.generated.ts | 13 ++++-- src/compiler/diagnosticMessages.json | 46 +++++++++++++------ src/compiler/parser.ts | 2 +- src/compiler/scanner.ts | 2 +- .../reference/assignmentLHSIsValue.errors.txt | 6 +-- .../compoundAssignmentLHSIsValue.errors.txt | 12 ++--- .../reference/errorSuperCalls.errors.txt | 2 +- .../parserSuperExpression2.errors.txt | 2 +- .../scannerStringLiterals.errors.txt | 2 +- .../reference/stringLiteralsErrors.errors.txt | 24 +++++----- .../reference/superAccess2.errors.txt | 14 +++--- .../reference/superErrors.errors.txt | 16 +++---- .../reference/superInLambdas.errors.txt | 4 +- .../superWithTypeArgument.errors.txt | 2 +- .../superWithTypeArgument2.errors.txt | 2 +- .../superWithTypeArgument3.errors.txt | 2 +- 16 files changed, 88 insertions(+), 63 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 324c2a16f5f..ccf9f9249d3 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -5,6 +5,7 @@ module ts { Unknown_compiler_option_0: { code: 6001, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, File_0_not_found: { code: 6002, category: DiagnosticCategory.Error, key: "File '{0}' not found." }, File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, @@ -21,10 +22,16 @@ module ts { An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_am_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede am 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, _0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, _0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: DiagnosticCategory.Error, key: "A function implementation cannot be declared in an ambient context." }, @@ -46,6 +53,7 @@ module ts { Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_comment: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid reference comment." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, @@ -209,7 +217,7 @@ module ts { The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.NoPrefix, key: "Unsupported file encoding." }, + Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.Error, key: "Unsupported file encoding." }, Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, @@ -264,7 +272,6 @@ module ts { Digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Digit expected." }, Hexadecimal_digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, Unexpected_end_of_text: { code: -9999999, category: DiagnosticCategory.Error, key: "Unexpected end of text." }, - Unterminated_string_constant: { code: -9999999, category: DiagnosticCategory.Error, key: "Unterminated string constant." }, Invalid_character: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid character." }, Declaration_or_statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration or statement expected." }, Statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Statement expected." }, @@ -280,13 +287,11 @@ module ts { Type_parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, Type_argument_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type argument expected." }, String_literal_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "String literal expected." }, - super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: DiagnosticCategory.Error, key: "'super' must be followed by argument list or member access." }, Line_break_not_permitted_here: { code: -9999999, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, catch_or_finally_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." }, Block_or_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Block or ';' expected." }, Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, Declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration expected." }, - Invalid_reference_comment: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid reference comment." }, File_0_is_not_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 73b6e2b0cc2..4b037688492 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -12,6 +12,10 @@ "code": 6003 }, + "Unterminated string literal.": { + "category": "Error", + "code": 1002 + }, "Identifier expected.": { "category": "Error", "code": 1003 @@ -76,6 +80,22 @@ "category": "Error", "code": 1023 }, + "A class or interface declaration can only have one 'extends' clause.": { + "category": "Error", + "code": 1024 + }, + "An 'extends' clause must precede am 'implements' clause.": { + "category": "Error", + "code": 1025 + }, + "A class can only extend a single class.": { + "category": "Error", + "code": 1026 + }, + "A class declaration can only have one 'implements' clause.": { + "category": "Error", + "code": 1027 + }, "Accessibility modifier already seen.": { "category": "Error", "code": 1028 @@ -92,6 +112,14 @@ "category": "Error", "code": 1031 }, + "An interface declaration cannot have an 'implements' clause.": { + "category": "Error", + "code": 1032 + }, + "'super' must be followed by an argument list or member access.": { + "category": "Error", + "code": 1034 + }, "Only ambient modules can use quoted names.": { "category": "Error", "code": 1035 @@ -176,6 +204,10 @@ "category": "Error", "code": 1079 }, + "Invalid reference comment.": { + "category": "Error", + "code": 1084 + }, "Octal literals are not available when targeting ECMAScript 5 and higher.": { "category": "Error", "code": 1085 @@ -831,7 +863,7 @@ "code": 5012 }, "Unsupported file encoding.": { - "category": "NoPrefix", + "category": "Error", "code": 5013 }, "Could not write file '{0}': {1}": { @@ -1051,10 +1083,6 @@ "category": "Error", "code": -9999999 }, - "Unterminated string constant.": { - "category": "Error", - "code": -9999999 - }, "Invalid character.": { "category": "Error", "code": -9999999 @@ -1115,10 +1143,6 @@ "category": "Error", "code": -9999999 }, - "'super' must be followed by argument list or member access.": { - "category": "Error", - "code": -9999999 - }, "Line break not permitted here.": { "category": "Error", "code": -9999999 @@ -1139,10 +1163,6 @@ "category": "Error", "code": -9999999 }, - "Invalid reference comment.": { - "category": "Error", - "code": -9999999 - }, "File '{0}' is not an external module.": { "category": "Error", "code": -9999999 diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 91a30143047..6ce418452cc 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1944,7 +1944,7 @@ module ts { primaryExpression.kind === SyntaxKind.SuperKeyword && token !== SyntaxKind.OpenParenToken && token !== SyntaxKind.DotToken; if (illegalUsageOfSuperKeyword) { - error(Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + error(Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, /* inNewExpression */ false); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 00966b12f2a..7e6bdf14309 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -515,7 +515,7 @@ module ts { } if (isLineBreak(ch)) { result += text.substring(start, pos); - error(Diagnostics.Unterminated_string_constant); + error(Diagnostics.Unterminated_string_literal); break; } pos++; diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt index b5ebd69f67a..90e6a7e3dc2 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -76,19 +76,19 @@ class Derived extends C { constructor() { super(); super = value; } ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. foo() { super = value } ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. static sfoo() { super = value; } ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. } diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index a2c2eb188bc..7fe036ef084 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -137,12 +137,12 @@ super(); super *= value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. } @@ -150,12 +150,12 @@ foo() { super *= value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. } @@ -163,12 +163,12 @@ static sfoo() { super *= value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. super += value; ~~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! Invalid left-hand side of assignment expression. } diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index c1975cccdac..7e85cc07ee7 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -72,7 +72,7 @@ constructor() { super(); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. super(); } } diff --git a/tests/baselines/reference/parserSuperExpression2.errors.txt b/tests/baselines/reference/parserSuperExpression2.errors.txt index 4bb9404cc04..d8921ad7654 100644 --- a/tests/baselines/reference/parserSuperExpression2.errors.txt +++ b/tests/baselines/reference/parserSuperExpression2.errors.txt @@ -3,7 +3,7 @@ M() { super(0); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' can only be referenced in a derived class. } diff --git a/tests/baselines/reference/scannerStringLiterals.errors.txt b/tests/baselines/reference/scannerStringLiterals.errors.txt index d48353f7978..a121aefc720 100644 --- a/tests/baselines/reference/scannerStringLiterals.errors.txt +++ b/tests/baselines/reference/scannerStringLiterals.errors.txt @@ -10,7 +10,7 @@ " "Should error because of newline. -!!! Unterminated string constant. +!!! Unterminated string literal. "Should error because of end of file. !!! Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsErrors.errors.txt b/tests/baselines/reference/stringLiteralsErrors.errors.txt index 168a2564ab0..420db7bc021 100644 --- a/tests/baselines/reference/stringLiteralsErrors.errors.txt +++ b/tests/baselines/reference/stringLiteralsErrors.errors.txt @@ -2,46 +2,46 @@ // Srtings missing line terminator var es1 = "line 1 -!!! Unterminated string constant. +!!! Unterminated string literal. "; -!!! Unterminated string constant. +!!! Unterminated string literal. var es2 = 'line 1 -!!! Unterminated string constant. +!!! Unterminated string literal. '; -!!! Unterminated string constant. +!!! Unterminated string literal. // Space after backslash var es3 = 'line 1\ -!!! Unterminated string constant. +!!! Unterminated string literal. '; -!!! Unterminated string constant. +!!! Unterminated string literal. var es4 = 'line 1\ -!!! Unterminated string constant. +!!! Unterminated string literal. '; -!!! Unterminated string constant. +!!! Unterminated string literal. // Unterminated strings var es5 = "unterminated -!!! Unterminated string constant. +!!! Unterminated string literal. var es6 = 'unterminated -!!! Unterminated string constant. +!!! Unterminated string literal. // wrong terminator var es7 = "unterminated ' -!!! Unterminated string constant. +!!! Unterminated string literal. var es8 = 'unterminated " -!!! Unterminated string constant. +!!! Unterminated string literal. // wrong unicode sequences var es9 = "\u00"; diff --git a/tests/baselines/reference/superAccess2.errors.txt b/tests/baselines/reference/superAccess2.errors.txt index 4b276d56205..4f1dab6b8e9 100644 --- a/tests/baselines/reference/superAccess2.errors.txt +++ b/tests/baselines/reference/superAccess2.errors.txt @@ -7,21 +7,21 @@ class Q extends P { xx = super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. static yy = super; // error for static initializer accessing super ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class // Super is not allowed in constructor args constructor(public z = super, zz = super, zzz = () => super) { ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' cannot be referenced in constructor arguments. ~~~~~ @@ -33,7 +33,7 @@ foo(zz = super) { ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. super.x(); super.y(); // error ~ @@ -42,7 +42,7 @@ static bar(zz = super) { ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. super.x(); // error ~ !!! Property 'x' does not exist on type 'typeof P'. diff --git a/tests/baselines/reference/superErrors.errors.txt b/tests/baselines/reference/superErrors.errors.txt index 045a8ebe717..99eaaed2b98 100644 --- a/tests/baselines/reference/superErrors.errors.txt +++ b/tests/baselines/reference/superErrors.errors.txt @@ -3,17 +3,17 @@ // super in a non class context var x = super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' can only be referenced in a derived class. var y = () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' can only be referenced in a derived class. var z = () => () => () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' can only be referenced in a derived class. } @@ -47,7 +47,7 @@ // super call in a lambda in a function expression in a constructor (function() { return () => super; })(); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } @@ -65,7 +65,7 @@ // super call in a lambda in a function expression in a constructor (function() { return () => super; })(); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~ !!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class } @@ -73,12 +73,12 @@ // super in static functions var s = super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. var x = () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. var y = () => () => () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. } } \ No newline at end of file diff --git a/tests/baselines/reference/superInLambdas.errors.txt b/tests/baselines/reference/superInLambdas.errors.txt index b69d18edf29..aafed991922 100644 --- a/tests/baselines/reference/superInLambdas.errors.txt +++ b/tests/baselines/reference/superInLambdas.errors.txt @@ -65,12 +65,12 @@ // super in a nested lambda in a constructor var x = () => () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. } sayHello(): void { // super in a nested lambda in a method var x = () => () => super; ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. } } \ No newline at end of file diff --git a/tests/baselines/reference/superWithTypeArgument.errors.txt b/tests/baselines/reference/superWithTypeArgument.errors.txt index 37373614684..7cdcd662a8c 100644 --- a/tests/baselines/reference/superWithTypeArgument.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument.errors.txt @@ -7,7 +7,7 @@ constructor() { super(); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. } diff --git a/tests/baselines/reference/superWithTypeArgument2.errors.txt b/tests/baselines/reference/superWithTypeArgument2.errors.txt index 1bd04d226ea..cd386968357 100644 --- a/tests/baselines/reference/superWithTypeArgument2.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument2.errors.txt @@ -7,7 +7,7 @@ constructor(x) { super(x); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. ~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. } diff --git a/tests/baselines/reference/superWithTypeArgument3.errors.txt b/tests/baselines/reference/superWithTypeArgument3.errors.txt index bacd5d008e7..94e53065a38 100644 --- a/tests/baselines/reference/superWithTypeArgument3.errors.txt +++ b/tests/baselines/reference/superWithTypeArgument3.errors.txt @@ -8,7 +8,7 @@ constructor() { super(); ~ -!!! 'super' must be followed by argument list or member access. +!!! 'super' must be followed by an argument list or member access. } bar() { super.bar(null); From 132cd276d14e25461379068d61225fef9f09e55d Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 18:25:29 -0700 Subject: [PATCH 05/21] consistentlly compute the length of an unterminated multiline comment --- src/compiler/scanner.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 00966b12f2a..1db2f361f17 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -676,9 +676,8 @@ module ts { if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { pos += 2; - var safeLength = len - 1; // For lookahead. var commentClosed = false; - while (pos < safeLength) { + while (pos < len) { var ch = text.charCodeAt(pos); if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) { @@ -694,7 +693,6 @@ module ts { } if (!commentClosed) { - pos++; error(Diagnostics.Asterisk_Slash_expected); } From 019994004cb912d45902ba4e403c8f821a2d77b3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 18:28:14 -0700 Subject: [PATCH 06/21] wire classifier to use new compiler implementation --- src/compiler/types.ts | 4 +- src/services/services.ts | 227 ++++++++++++++++++++++++--------------- 2 files changed, 146 insertions(+), 85 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5cb80687d80..33414c75e3d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -217,7 +217,9 @@ module ts { FirstKeyword = BreakKeyword, LastKeyword = StringKeyword, FirstFutureReservedWord = ImplementsKeyword, - LastFutureReservedWord = YieldKeyword + LastFutureReservedWord = YieldKeyword, + FirstPunctuation= OpenBraceToken, + LastPunctuation = CaretEqualsToken } export enum NodeFlags { diff --git a/src/services/services.ts b/src/services/services.ts index be05a48cee9..b11d8a91ec8 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2207,33 +2207,16 @@ module ts { } /// Classifier - export function createClassifier(host: Logger): Classifier { - var scanner: TypeScript.Scanner.IScanner; - var lastDiagnosticKey: string = null; - var noRegexTable: boolean[]; - var reportDiagnostic = (position: number, fullWidth: number, key: string, args: any[]) => { - lastDiagnosticKey = key; - }; - - if (!noRegexTable) { - noRegexTable = []; - noRegexTable[TypeScript.SyntaxKind.IdentifierName] = true; - noRegexTable[TypeScript.SyntaxKind.StringLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.NumericLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.RegularExpressionLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.ThisKeyword] = true; - noRegexTable[TypeScript.SyntaxKind.PlusPlusToken] = true; - noRegexTable[TypeScript.SyntaxKind.MinusMinusToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseParenToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseBracketToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseBraceToken] = true; - noRegexTable[TypeScript.SyntaxKind.TrueKeyword] = true; - noRegexTable[TypeScript.SyntaxKind.FalseKeyword] = true; - } + var scanner: Scanner; + var noRegexTable: boolean[]; + if (!noRegexTable) { noRegexTable = []; noRegexTable[SyntaxKind.Identifier] = true; noRegexTable[SyntaxKind.StringLiteral] = true; noRegexTable[SyntaxKind.NumericLiteral] = true; noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; noRegexTable[SyntaxKind.ThisKeyword] = true; noRegexTable[SyntaxKind.PlusPlusToken] = true; noRegexTable[SyntaxKind.MinusMinusToken] = true; noRegexTable[SyntaxKind.CloseParenToken] = true; noRegexTable[SyntaxKind.CloseBracketToken] = true; noRegexTable[SyntaxKind.CloseBraceToken] = true; noRegexTable[SyntaxKind.TrueKeyword] = true; noRegexTable[SyntaxKind.FalseKeyword] = true; } function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; + var lastTokenOrCommentEnd = 0; + var inMultiLineComment = false; + if (lexState !== EndOfLineState.Start) { // If we're in a string literal, then prepend: "\ // (and a newline). That way when we lex we'll think we're still in a string literal. @@ -2258,94 +2241,170 @@ module ts { entries: [] }; - var simpleText = TypeScript.SimpleText.fromString(text); - scanner = TypeScript.Scanner.createScanner(ScriptTarget.ES5, simpleText, reportDiagnostic); + scanner = createScanner(ScriptTarget.ES5, text, onError, processComment); - var lastTokenKind = TypeScript.SyntaxKind.None; - var token: TypeScript.ISyntaxToken = null; + var lastToken = SyntaxKind.Unknown; + var token = SyntaxKind.Unknown; do { - lastDiagnosticKey = null; + inMultiLineComment = false; - token = scanner.scan(!noRegexTable[lastTokenKind]); - lastTokenKind = token.kind(); + token = scanner.scan(); - processToken(text, simpleText, offset, token, result); - } - while (token.kind() !== TypeScript.SyntaxKind.EndOfFileToken); - - lastDiagnosticKey = null; - return result; - } - - function processToken(text: string, simpleText: TypeScript.ISimpleText, offset: number, token: TypeScript.ISyntaxToken, result: ClassificationResult): void { - processTriviaList(text, offset, token.leadingTrivia(simpleText), result); - addResult(text, offset, result, TypeScript.width(token), token.kind()); - processTriviaList(text, offset, token.trailingTrivia(simpleText), result); - - if (TypeScript.fullEnd(token) >= text.length) { - // We're at the end. - if (lastDiagnosticKey === TypeScript.DiagnosticCode.AsteriskSlash_expected) { - result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; - return; + if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastToken]) { + if (scanner.reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { + token = SyntaxKind.RegularExpressionLiteral; + } } - if (token.kind() === TypeScript.SyntaxKind.StringLiteral) { - var tokenText = token.text(); - if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === TypeScript.CharacterCodes.backslash) { - var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === TypeScript.CharacterCodes.doubleQuote - ? EndOfLineState.InDoubleQuoteStringLiteral - : EndOfLineState.InSingleQuoteStringLiteral; + lastToken = token; + + processToken(); + } + while (token !== SyntaxKind.EndOfFileToken); + + return result; + + + function onError(message: DiagnosticMessage): void { + inMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; + } + + function processComment(start: number, end: number) { + // add Leading white spaces + addLeadingWhiteSpace(start, end); + + // add the comment + addResult(end - start, TokenClass.Comment); + } + + function processToken(): void { + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); + + // add Leading white spaces + addLeadingWhiteSpace(start, end); + + // add the token + addResult(end - start, classFromKind(token)); + + if (end >= text.length) { + // We're at the end. + if (inMultiLineComment) { + result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; return; } + + if (token === SyntaxKind.StringLiteral) { + var tokenText = scanner.getTokenText(); + if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.backslash) { + var quoteChar = tokenText.charCodeAt(0); + result.finalLexState = quoteChar === CharacterCodes.doubleQuote + ? EndOfLineState.InDoubleQuoteStringLiteral + : EndOfLineState.InSingleQuoteStringLiteral; + return; + } + } } } - } - function processTriviaList(text: string, offset: number, triviaList: TypeScript.ISyntaxTriviaList, result: ClassificationResult): void { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - addResult(text, offset, result, trivia.fullWidth(), trivia.kind()); - } - } - - function addResult(text: string, offset: number, result: ClassificationResult, length: number, kind: TypeScript.SyntaxKind): void { - if (length > 0) { - // If this is the first classification we're adding to the list, then remove any - // offset we have if we were continuing a construct from the previous line. - if (result.entries.length === 0) { - length -= offset; + function addLeadingWhiteSpace(start: number, end: number): void { + if (start > lastTokenOrCommentEnd) { + addResult(start - lastTokenOrCommentEnd, TokenClass.Whitespace); } - result.entries.push({ length: length, classification: classFromKind(kind) }); + // Remeber the end of the last token + lastTokenOrCommentEnd = end; + } + + function addResult(length: number, classification: TokenClass): void { + if (length > 0) { + // If this is the first classification we're adding to the list, then remove any + // offset we have if we were continuing a construct from the previous line. + if (result.entries.length === 0) { + length -= offset; + } + + result.entries.push({ length: length, classification: classification }); + } } } - function classFromKind(kind: TypeScript.SyntaxKind) { - if (TypeScript.SyntaxFacts.isAnyKeyword(kind)) { + function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { + switch (tokenKind) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.InstanceOfKeyword: + case SyntaxKind.InKeyword: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.AmpersandToken: + case SyntaxKind.CaretToken: + case SyntaxKind.BarToken: + case SyntaxKind.AmpersandAmpersandToken: + case SyntaxKind.BarBarToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.AmpersandEqualsToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.PlusEqualsToken: + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.CommaToken: + return true; + default: return false; + } + } + + function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { + switch (tokenKind) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + return true; + default: + return false; + } + } + + function classFromKind(kind: SyntaxKind) { + if (kind >= SyntaxKind.FirstKeyword && kind <= SyntaxKind.LastKeyword) { return TokenClass.Keyword; } - else if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(kind) || - TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(kind)) { + else if (isBinaryExpressionOperatorToken(kind) || isPrefixUnaryExpressionOperatorToken(kind)) { return TokenClass.Operator; } - else if (TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { + else if (kind >= SyntaxKind.FirstPunctuation && kind <= SyntaxKind.LastPunctuation) { return TokenClass.Punctuation; } switch (kind) { - case TypeScript.SyntaxKind.WhitespaceTrivia: - return TokenClass.Whitespace; - case TypeScript.SyntaxKind.MultiLineCommentTrivia: - case TypeScript.SyntaxKind.SingleLineCommentTrivia: - return TokenClass.Comment; - case TypeScript.SyntaxKind.NumericLiteral: + case SyntaxKind.NumericLiteral: return TokenClass.NumberLiteral; - case TypeScript.SyntaxKind.StringLiteral: + case SyntaxKind.StringLiteral: return TokenClass.StringLiteral; - case TypeScript.SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.RegularExpressionLiteral: return TokenClass.RegExpLiteral; - case TypeScript.SyntaxKind.IdentifierName: + case SyntaxKind.Identifier: default: return TokenClass.Identifier; } From e515ca96974616feea84ae312dd0f6e58a60273e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:20:32 -0700 Subject: [PATCH 07/21] remove unused property --- src/harness/harnessLanguageService.ts | 9 ++------- src/services/services.ts | 5 ++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 65f02582d63..09799f023e3 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -167,7 +167,6 @@ module Harness.LanguageService { } export class TypeScriptLS implements ts.LanguageServiceShimHost { private ls: ts.LanguageServiceShim = null; - public newLS: ts.LanguageService; private fileNameToScript: ts.Map = {}; @@ -268,12 +267,8 @@ module Harness.LanguageService { * To access the non-shim (i.e. actual) language service, use the "ls.languageService" property. */ public getLanguageService(): ts.LanguageServiceShim { - var ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this); - this.ls = ls; - var hostAdapter = new LanguageServiceShimHostAdapter(this); - - this.newLS = ts.createLanguageService(hostAdapter, NonCachingDocumentRegistry.Instance); - return ls; + this.ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this); + return this.ls; } /** Parse file given its source text */ diff --git a/src/services/services.ts b/src/services/services.ts index b11d8a91ec8..19845f86483 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2210,8 +2210,11 @@ module ts { export function createClassifier(host: Logger): Classifier { var scanner: Scanner; var noRegexTable: boolean[]; + /// We do not have a full parser support to know when we should parse a regex or not + /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where + /// we have a series of divide operator. this list allows us to be more accurate by ruling out + /// locations where a regexp cannot exist. if (!noRegexTable) { noRegexTable = []; noRegexTable[SyntaxKind.Identifier] = true; noRegexTable[SyntaxKind.StringLiteral] = true; noRegexTable[SyntaxKind.NumericLiteral] = true; noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; noRegexTable[SyntaxKind.ThisKeyword] = true; noRegexTable[SyntaxKind.PlusPlusToken] = true; noRegexTable[SyntaxKind.MinusMinusToken] = true; noRegexTable[SyntaxKind.CloseParenToken] = true; noRegexTable[SyntaxKind.CloseBracketToken] = true; noRegexTable[SyntaxKind.CloseBraceToken] = true; noRegexTable[SyntaxKind.TrueKeyword] = true; noRegexTable[SyntaxKind.FalseKeyword] = true; } - function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; var lastTokenOrCommentEnd = 0; From 3fcd33ec32911f3970eada615a74b8962111384f Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:21:12 -0700 Subject: [PATCH 08/21] Enable clorizer unit tests --- src/harness/harnessLanguageService.ts | 5 + src/harness/runner.ts | 3 + src/harness/unittestrunner.ts | 10 +- .../cases/unittests/services/colorization.ts | 194 +++++++++--------- 4 files changed, 110 insertions(+), 102 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 09799f023e3..9f08d809a7b 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -271,6 +271,11 @@ module Harness.LanguageService { return this.ls; } + /** Return a new instance of the classifier service shim */ + public getClassifier(): ts.ClassifierShim { + return new TypeScript.Services.TypeScriptServicesFactory().createClassifierShim(this); + } + /** Parse file given its source text */ public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), ts.ScriptTarget.ES5, TypeScript.isDTSFile(fileName)).sourceUnit(); diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 4e3cdc8815c..7ea996b24e6 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -99,6 +99,9 @@ if (runners.length === 0) { //// language services runners.push(new FourslashRunner()); //runners.push(new GeneratedFourslashRunner()); + + // unittests + runners.push(new UnitTestRunner(UnittestTestType.Services)); } sys.newLine = '\r\n'; diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts index e08b835ac62..7b9019788e6 100644 --- a/src/harness/unittestrunner.ts +++ b/src/harness/unittestrunner.ts @@ -8,7 +8,7 @@ enum UnittestTestType { } class UnitTestRunner extends RunnerBase { - constructor(public testType?: UnittestTestType) { + constructor(public testType: UnittestTestType) { super(); } @@ -20,6 +20,9 @@ class UnitTestRunner extends RunnerBase { case UnittestTestType.LanguageService: this.tests = this.enumerateFiles('tests/cases/unittests/ls'); break; + case UnittestTestType.Services: + this.tests = this.enumerateFiles('tests/cases/unittests/services', /colorization.ts/); + break; default: if (this.tests.length === 0) { throw new Error('Unsupported test cases: ' + this.testType); @@ -38,7 +41,7 @@ class UnitTestRunner extends RunnerBase { }); harnessCompiler.addInputFiles(toBeAdded); harnessCompiler.setCompilerOptions({ noResolve: true }); - + var stdout = new Harness.Compiler.EmitterIOHost(); var emitDiagnostics = harnessCompiler.emitAll(stdout); var results = stdout.toArray(); @@ -59,7 +62,8 @@ class UnitTestRunner extends RunnerBase { before: before, after: after, Harness: Harness, - IO: Harness.IO + IO: Harness.IO, + ts:ts // FourSlash: FourSlash }; } diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index d1997139b89..157c31fbec7 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -1,198 +1,194 @@ -/// - -interface Classification { +interface Classification { length: number; - class2: TypeScript.TokenClass; + class: ts.TokenClass; } interface ClassiferResult { tuples: Classification[]; - finalLexState: TypeScript.LexState; + finalEndOfLineState: ts.EndOfLineState; } var TokenClassNames = {}; -TokenClassNames[TypeScript.TokenClass.Punctuation] = "Punctuation"; -TokenClassNames[TypeScript.TokenClass.Keyword] = "Keyword"; -TokenClassNames[TypeScript.TokenClass.Operator] = "Operator"; -TokenClassNames[TypeScript.TokenClass.Comment] = "Comment"; -TokenClassNames[TypeScript.TokenClass.Whitespace] = "Whitespace"; -TokenClassNames[TypeScript.TokenClass.Identifier] = "Identifier"; -TokenClassNames[TypeScript.TokenClass.NumberLiteral] = "NumberLiteral"; -TokenClassNames[TypeScript.TokenClass.StringLiteral] = "StringLiteral"; -TokenClassNames[TypeScript.TokenClass.RegExpLiteral] = "RegExpLiteral"; +TokenClassNames[ts.TokenClass.Punctuation] = "Punctuation"; +TokenClassNames[ts.TokenClass.Keyword] = "Keyword"; +TokenClassNames[ts.TokenClass.Operator] = "Operator"; +TokenClassNames[ts.TokenClass.Comment] = "Comment"; +TokenClassNames[ts.TokenClass.Whitespace] = "Whitespace"; +TokenClassNames[ts.TokenClass.Identifier] = "Identifier"; +TokenClassNames[ts.TokenClass.NumberLiteral] = "NumberLiteral"; +TokenClassNames[ts.TokenClass.StringLiteral] = "StringLiteral"; +TokenClassNames[ts.TokenClass.RegExpLiteral] = "RegExpLiteral"; -describe('Colorization', function() { - var mytypescriptLS = new Harness.TypeScriptLS(); - var myls = mytypescriptLS.getLanguageService(); - - var myclassifier = new Services.ClassifierShim(myls.host); - - function getClassifications(code: string, initialLexState?: TypeScript.LexState = TypeScript.LexState.Start): ClassiferResult { - var classResult = myclassifier.getClassificationsForLine(code, initialLexState).split('\n'); +describe('Colorization', function () { + var mytypescriptLS = new Harness.LanguageService.TypeScriptLS(); + var myclassifier = mytypescriptLS.getClassifier(); + + function getClassifications(code: string, initialEndOfLineState: ts.EndOfLineState = ts.EndOfLineState.Start): ClassiferResult { + var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; for (; i < classResult.length - 1; i += 2) { tuples[i / 2] = { length: parseInt(classResult[i]), - class2: parseInt(classResult[i + 1]) + class: parseInt(classResult[i + 1]) }; } - var finalLexState = classResult[classResult.length - 1]; + var finalEndOfLineState = classResult[classResult.length - 1]; return { tuples: tuples, - finalLexState: parseInt(finalLexState) + finalEndOfLineState: parseInt(finalEndOfLineState) }; } function verifyClassification(classification: Classification, expectedLength: number, expectedClass: number) { - assert.notNull(classification); - assert.is(classification.length === expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); - assert.is(classification.class2 === expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class2]); + assert.isNotNull(classification); + assert.equal(classification.length, expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); + assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class]); } - - describe("test cases for colorization", function() { + + describe("test cases for colorization", function () { var results = getClassifications('var x:string = "foo"; //Hello'); - it("checks for a keyword", function() { - verifyClassification(results.tuples[0], 3, TypeScript.TokenClass.Keyword); + it("checks for a keyword", function () { + verifyClassification(results.tuples[0], 3, ts.TokenClass.Keyword); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a identifier", function() { - verifyClassification(results.tuples[2], 5, TypeScript.TokenClass.Identifier); + it("checks for a identifier", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Identifier); }); - it("checks for an punctuation", function() { - verifyClassification(results.tuples[3], 6, TypeScript.TokenClass.Punctuation); - }); - - it("checks for a operator", function() { - verifyClassification(results.tuples[6], 14, TypeScript.TokenClass.Operator); + it("checks for an punctuation", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Punctuation); }); - it("checks for a string literal", function() { - verifyClassification(results.tuples[8], 20, TypeScript.TokenClass.StringLiteral); + it("checks for a operator", function () { + verifyClassification(results.tuples[6], 1, ts.TokenClass.Operator); }); - it("checks for a comment", function() { - verifyClassification(results.tuples[11], 29, TypeScript.TokenClass.Comment); + it("checks for a string literal", function () { + verifyClassification(results.tuples[8], 5, ts.TokenClass.StringLiteral); + }); + + it("checks for a comment", function () { + verifyClassification(results.tuples[11], 7, ts.TokenClass.Comment); }); }); - describe("test comment colorization after a divide operator", function() { + describe("test comment colorization after a divide operator", function () { var results = getClassifications('1 / 1 // comment'); - it("checks for a number literal", function() { - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 2, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[2], 3, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[3], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[4], 5, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[5], 6, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[5], 1, ts.TokenClass.Whitespace); }); - it("checks for a comment", function() { - verifyClassification(results.tuples[6], 16, TypeScript.TokenClass.Comment); + it("checks for a comment", function () { + verifyClassification(results.tuples[6], 10, ts.TokenClass.Comment); }); }); - describe("test literal colorization after a divide operator", function() { + describe("test literal colorization after a divide operator", function () { var results = getClassifications('1 / 2, 1 / 2'); - it("checks for a number literal", function() { - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 2, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[2], 3, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[3], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[4], 5, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[5], 6, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[5], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[6], 7, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[6], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[7], 8, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[7], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[8], 9, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[8], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[9], 10, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[9], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[10], 11, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[10], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[11], 12, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[11], 1, ts.TokenClass.NumberLiteral); }); }); - describe("test cases for colorizing multi-line string", function() { - it("classifies first line correctelly", function() { - var results = getClassifications("'line1\\\n", TypeScript.LexState.Start); + describe("test cases for colorizing multi-line string", function () { + it("classifies first line correctelly", function () { + var results = getClassifications("'line1\\", ts.EndOfLineState.Start); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 8, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.InMultilineSingleQuoteString); + verifyClassification(results.tuples[0], 7, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InSingleQuoteStringLiteral); }); - it("classifies second line correctelly", function() { - var results = getClassifications("\\\n", TypeScript.LexState.InMultilineSingleQuoteString); + it("classifies second line correctelly", function () { + var results = getClassifications("\\", ts.EndOfLineState.InDoubleQuoteStringLiteral); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 2, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.InMultilineSingleQuoteString); + verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InDoubleQuoteStringLiteral); }); - it("classifies third line correctelly", function() { - var results = getClassifications("'", TypeScript.LexState.InMultilineSingleQuoteString); + it("classifies third line correctelly", function () { + var results = getClassifications("'", ts.EndOfLineState.InSingleQuoteStringLiteral); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.Start); + verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); }); }); }); \ No newline at end of file From 05d2e75e7cb4ff20581ec66dba66b3fe8742b6ae Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:27:03 -0700 Subject: [PATCH 09/21] delete unused tests --- .../unittests/compiler/callSignatureTests.ts | 27 - .../unittests/compiler/classOverloads.ts | 128 --- .../compiler/constructSignatureTests.ts | 26 - .../unittests/compiler/declarationTests.ts | 52 - .../compiler/functionSignaturesTests.ts | 25 - tests/cases/unittests/compiler/identifiers.ts | 13 - tests/cases/unittests/compiler/moduleAlias.ts | 14 - tests/cases/unittests/compiler/pathing.ts | 50 - .../compiler/propertySignatureTests.ts | 19 - tests/cases/unittests/services/_project.ts | 4 - .../services/baselines/baseline-accept.ts | 20 - .../services/baselines/baseline-create.ts | 66 -- .../inputs/getCompletionsAtPosition1.ts | 23 - .../baselines/inputs/optionsParser.ts | 215 ----- ...ompletionsAtPosition1.str-completions.json | 2 - ...ompletionsAtPosition1.str-definitions.json | 2 - ...getCompletionsAtPosition1.str-members.json | 2 - ...CompletionsAtPosition1.str-signatures.json | 2 - .../getCompletionsAtPosition1.str-types.json | 2 - .../optionsParser.str-completions.json | 1 - .../optionsParser.str-definitions.json | 1 - .../reference/optionsParser.str-members.json | 1 - .../optionsParser.str-signatures.json | 2 - .../reference/optionsParser.str-types.json | 1 - tests/cases/unittests/services/dumpAST.ts | 3 - .../services/dumpAST/baseline-create.ts | 9 - .../services/getCompletionsAtPosition.ts | 220 ----- .../getCompletionsAtPositionAfterEdits.ts | 55 -- .../getCompletionsAtPositionObjectLiterals.ts | 100 -- .../getDefinitionPositionAtPosition.ts | 193 ---- ...itionPositionAtPositionPartialInterface.ts | 29 - .../services/getImplementorsAtPosition.ts | 73 -- .../services/getReferencesAtPosition.ts | 188 ---- .../services/getReferencesAtPosition2.ts | 235 ----- .../services/getScriptLexicalStructure.ts | 904 ------------------ .../services/getSignatureAtPosition.ts | 493 ---------- .../unittests/services/incrementalParser.ts | 103 -- .../unittests/services/overridesCollector.ts | 82 -- .../testCode/getBraceMatchingAtPosition.ts | 27 - .../testCode/getCompletionsAtPosition1.ts | 23 - .../testCode/getCompletionsAtPosition10.ts | 5 - .../testCode/getCompletionsAtPosition2.ts | 12 - .../testCode/getCompletionsAtPosition3.ts | 2 - .../testCode/getCompletionsAtPosition4.ts | 4 - .../testCode/getCompletionsAtPosition5.ts | 3 - .../testCode/getCompletionsAtPosition6.ts | 1 - .../testCode/getCompletionsAtPosition7.ts | 1 - .../testCode/getCompletionsAtPosition8.ts | 1 - .../testCode/getCompletionsAtPosition9.ts | 10 - .../getCompletionsAtPositionAfterEdits.ts | 8 - .../getCompletionsAtPositionBugFixes.ts | 16 - .../getCompletionsAtPositionObjectLiterals.ts | 33 - .../testCode/getDefinitionsAtPosition.ts | 91 -- .../testCode/getDefinitionsAtPosition2.ts | 6 - .../testCode/getDefinitionsAtPosition3.ts | 5 - ...tDefinitionsAtPositionPartialInterface1.ts | 5 - ...tDefinitionsAtPositionPartialInterface2.ts | 9 - .../testCode/getImplementorsAtPosition.ts | 57 -- .../testCode/getReferencesAtPositionTest.ts | 117 --- .../testCode/getReferencesAtPositionTest2.ts | 59 -- .../testCode/getReferencesAtPositionTest3.ts | 70 -- .../testCode/getReferencesAtPositionTest4.ts | 28 - .../testCode/getScriptLexicalStructure.ts | 112 --- .../testCode/getSignatureAtPositionTest.ts | 85 -- .../testCode/getSignatureAtPositionTestEOF.ts | 5 - .../testCode/getSmartIndentAtLineNumber.ts | 132 --- .../testCode/getSmartIndentAtLineNumber2.ts | 8 - .../testCode/getSmartIndentAtLineNumber3.ts | 6 - .../services/testCode/incrementalParser.ts | 24 - .../services/testCode/incrementalParser2.ts | 5 - .../services/testCode/overridesCollector.ts | 57 -- .../testCode/references/classLocal.ts | 19 - .../testCode/references/classParameter.ts | 18 - .../services/testCode/references/comment.ts | 4 - .../testCode/references/functionOverloads.ts | 6 - .../testCode/references/functionParameter.ts | 7 - .../services/testCode/references/globals.ts | 23 - .../testCode/references/illegalAssignment1.ts | 2 - .../testCode/references/illegalAssignment2.ts | 4 - .../services/testCode/references/noContext.ts | 20 - .../testCode/references/referenceToClass.ts | 17 - .../services/testCode/references/static.ts | 28 - 82 files changed, 4560 deletions(-) delete mode 100644 tests/cases/unittests/compiler/callSignatureTests.ts delete mode 100644 tests/cases/unittests/compiler/classOverloads.ts delete mode 100644 tests/cases/unittests/compiler/constructSignatureTests.ts delete mode 100644 tests/cases/unittests/compiler/declarationTests.ts delete mode 100644 tests/cases/unittests/compiler/functionSignaturesTests.ts delete mode 100644 tests/cases/unittests/compiler/identifiers.ts delete mode 100644 tests/cases/unittests/compiler/moduleAlias.ts delete mode 100644 tests/cases/unittests/compiler/pathing.ts delete mode 100644 tests/cases/unittests/compiler/propertySignatureTests.ts delete mode 100644 tests/cases/unittests/services/_project.ts delete mode 100644 tests/cases/unittests/services/baselines/baseline-accept.ts delete mode 100644 tests/cases/unittests/services/baselines/baseline-create.ts delete mode 100644 tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts delete mode 100644 tests/cases/unittests/services/baselines/inputs/optionsParser.ts delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json delete mode 100644 tests/cases/unittests/services/dumpAST.ts delete mode 100644 tests/cases/unittests/services/dumpAST/baseline-create.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPosition.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts delete mode 100644 tests/cases/unittests/services/getDefinitionPositionAtPosition.ts delete mode 100644 tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts delete mode 100644 tests/cases/unittests/services/getImplementorsAtPosition.ts delete mode 100644 tests/cases/unittests/services/getReferencesAtPosition.ts delete mode 100644 tests/cases/unittests/services/getReferencesAtPosition2.ts delete mode 100644 tests/cases/unittests/services/getScriptLexicalStructure.ts delete mode 100644 tests/cases/unittests/services/getSignatureAtPosition.ts delete mode 100644 tests/cases/unittests/services/incrementalParser.ts delete mode 100644 tests/cases/unittests/services/overridesCollector.ts delete mode 100644 tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts delete mode 100644 tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts delete mode 100644 tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts delete mode 100644 tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts delete mode 100644 tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts delete mode 100644 tests/cases/unittests/services/testCode/incrementalParser.ts delete mode 100644 tests/cases/unittests/services/testCode/incrementalParser2.ts delete mode 100644 tests/cases/unittests/services/testCode/overridesCollector.ts delete mode 100644 tests/cases/unittests/services/testCode/references/classLocal.ts delete mode 100644 tests/cases/unittests/services/testCode/references/classParameter.ts delete mode 100644 tests/cases/unittests/services/testCode/references/comment.ts delete mode 100644 tests/cases/unittests/services/testCode/references/functionOverloads.ts delete mode 100644 tests/cases/unittests/services/testCode/references/functionParameter.ts delete mode 100644 tests/cases/unittests/services/testCode/references/globals.ts delete mode 100644 tests/cases/unittests/services/testCode/references/illegalAssignment1.ts delete mode 100644 tests/cases/unittests/services/testCode/references/illegalAssignment2.ts delete mode 100644 tests/cases/unittests/services/testCode/references/noContext.ts delete mode 100644 tests/cases/unittests/services/testCode/references/referenceToClass.ts delete mode 100644 tests/cases/unittests/services/testCode/references/static.ts diff --git a/tests/cases/unittests/compiler/callSignatureTests.ts b/tests/cases/unittests/compiler/callSignatureTests.ts deleted file mode 100644 index 7b921d244eb..00000000000 --- a/tests/cases/unittests/compiler/callSignatureTests.ts +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\callSignatureTests.ts', function () { - it("If a signature omits a return type annotation, any type is assumed", function () { - var code = 'var foo: {();};'; - code += 'var test = foo();' - code += 'test.bar = 2;' - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call signature can have the void return type", function () { - var code = 'var foo: {():void;};'; - code += 'var test = foo();' - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("A call signature can't have the same overload", function () { - var code = 'var foo: { (): string; (): string; };'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/classOverloads.ts b/tests/cases/unittests/compiler/classOverloads.ts deleted file mode 100644 index a1d00f8bd8e..00000000000 --- a/tests/cases/unittests/compiler/classOverloads.ts +++ /dev/null @@ -1,128 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\classOverloads.ts', function () { - it("Everytype is a subtype of itself", function () { - var code = 'class foo { public bar: number; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("All types except the Void type are subtypes of the Any type", function () { - var code = 'class foo { public bar: any; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("All types are subtypes of the Any type - 2", function () { - var code = 'class baz { public bar(): any { return 1; } }'; - code += 'class foo extends baz { public bar(): void {} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Undefined type is a subtype of all types except the Void type", function () { - var code = 'class baz { public bar(): any { return 1 } }'; - code += 'class foo extends baz { public bar(){ return undefined} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Undefined type is a subtype of all types except the Void type - 2", function () { - var code = 'class baz { public bar(): void { } }'; - code += 'class foo extends baz { public bar(){ return undefined} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Null type is a subtype of all types, except the Undefined and Void types", function () { - var code = 'class baz { public bar:any; }'; - code += 'class foo extends baz { public bar = null; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Null type is a subtype of all types, except the Undefined and Void types - 3", function () { - var code = 'class baz { public bar():void { } }'; - code += 'class foo extends baz { public bar() { return null; } }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - describe('An object type S is a subtype of an object type T', function () { - it("A property in T is matched by a property in S", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { a: number; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A property in T is matched by a property in S - 2", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { a: string; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A property in T is matched by a property in S - 3", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { b: string; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature", function () { - var code = 'class baz { public bar: { (); }; }'; - code += 'class foo extends baz { public bar: { (); } ;}'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 2", function () { - var code = 'class baz { public bar: { [idx:number]: any; }; }'; - code += 'class foo extends baz { public bar: { (); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 3", function () { - var code = 'class baz { public bar: { (a: string); }; }'; - code += 'class foo extends baz { public bar: { (); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 4", function () { - var code = 'class baz { public bar: { (a:string); }; }'; - code += 'class foo extends baz { public bar: { (a:string,b:string); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 5", function () { - var code = 'class baz { public bar: { ():void; }; }'; - code += 'class foo extends baz { public bar: { ():void; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("A call, construct or index signature in T is matched by a call, construct or index signature - 6", function () { - var code = 'class baz { public bar: { (); }; }'; - code += 'class foo extends baz { public bar: { ():void; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/constructSignatureTests.ts b/tests/cases/unittests/compiler/constructSignatureTests.ts deleted file mode 100644 index d4fe15dbe5e..00000000000 --- a/tests/cases/unittests/compiler/constructSignatureTests.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// -/// - -describe('Compiling tests\\compiler\\constructSignatureTests.ts', function () { - it("If a signature omits a return type annotation, any type is assumed", function () { - var code = 'var foo: {new ();};'; - code += 'var test = new foo();' - code += 'test.bar = 2;' - Harness.Compiler.compileString(code, 'construct signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call signature can have the void return type", function () { - var code = 'var foo: {new ():void;};'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - - it("A construct signature can't have the same overload", function () { - var code = 'var foo: { new (): string; new (): string; };'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/declarationTests.ts b/tests/cases/unittests/compiler/declarationTests.ts deleted file mode 100644 index 6685a63b590..00000000000 --- a/tests/cases/unittests/compiler/declarationTests.ts +++ /dev/null @@ -1,52 +0,0 @@ -/// -/// - -//@tags 1.1 Declarations - -describe('Compiling unittests\\compiler\\declarationTests.ts', function() { - it("Each internal module’s export declaration spaces are shared with other internal modules that have the same root module and the " + - "same qualified name starting from that root module", function() { - var code = 'module baz{export var foo;}'; - code += 'module baz{export var bar;}' - code += 'baz.foo = baz.bar;' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each object type literal has a declaration space for its members", function() { - var code = 'var foo:{a:number;};'; - code += 'foo.a = 2;' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each class declaration has a declaration space for members and a declaration space for statics", function() { - var code = 'class foo {'; - code += ' static bar;' - code += ' public bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each function declaration (including member function declarations and static function declarations) has a declaration space for " + - "statics and a declaration space for locals (parameters, variables, and functions).", function() { - var code = 'function foo() {'; - code += ' static bar;' - code += ' var bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 1); - }); - }); - it("Modules contain separate declaration spaces for variables and types.", function() { - var code = 'module M {'; - code += ' class bar {};' - code += ' var bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 1); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/functionSignaturesTests.ts b/tests/cases/unittests/compiler/functionSignaturesTests.ts deleted file mode 100644 index 5dd62dbb359..00000000000 --- a/tests/cases/unittests/compiler/functionSignaturesTests.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\functionSignatureTests.ts', function() { - it('Check overload with different return types.', function(){ - var code = 'var foo: { bar(): string; bar(): number; };\n'; - code += 'var bar: { bar: { (): string; (): number; }; };'; - code += 'foo = bar;'; - Harness.Compiler.compileString(code, 'function signatures', function(result) { - assert.equal(result.errors.length, 0); - }); - }) - - describe('Function Type Literals', function() { - it('Basic sanity check', function() { - var code = 'var foo: { (): string; };'; - code += 'var bar: () => string;'; - code += 'foo = bar;'; - Harness.Compiler.compileString(code, 'function type literal', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/identifiers.ts b/tests/cases/unittests/compiler/identifiers.ts deleted file mode 100644 index 175d9c9c77d..00000000000 --- a/tests/cases/unittests/compiler/identifiers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -/// - -describe('Compiling tests\\compiler\\identifiers.ts', function() { - it("Everytype is a subtype of itself", function() { - var code = 'class foo { public bar: number; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function(result) { - assert.equal(result.errors.length, 0); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/moduleAlias.ts b/tests/cases/unittests/compiler/moduleAlias.ts deleted file mode 100644 index a1281549559..00000000000 --- a/tests/cases/unittests/compiler/moduleAlias.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\moduleAlias.ts', function() { - describe('Internal module alias test', function() { - it("basic test", function() { - var code = "module A.B.C { import XYZ = X.Y.Z; export function ping(x: number) { if (x > 0) XYZ.pong(x-1);}};"; - code += "module X.Y.Z { import ABC = A.B.C; export function pong(x: number) { if (x > 0) ABC.ping(x-1);}};"; - Harness.Compiler.compileString(code, 'module alias', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); diff --git a/tests/cases/unittests/compiler/pathing.ts b/tests/cases/unittests/compiler/pathing.ts deleted file mode 100644 index 05a33494af2..00000000000 --- a/tests/cases/unittests/compiler/pathing.ts +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// - -describe('Verifying pathing functions', function () { - it("Normalizes Mac paths", function () { - var result = TypeScript.normalizePath("/Users/Me/somefile.ts"); - var expected = "/Users/Me/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative Mac paths", function () { - var result = TypeScript.normalizePath("/Users/./Me/../somefile.ts"); - var expected = "/Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes Windows paths", function () { - var result = TypeScript.normalizePath("C:\\Users\\Me\\somefile.ts"); - var expected = "C:/Users/Me/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative Windows paths", function () { - var result = TypeScript.normalizePath("C:\\Users\\.\\Me\\..\\somefile.ts"); - var expected = "C:/Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes . and ..", function () { - var result = TypeScript.normalizePath("..\\Users\\.\\Me\\..\\somefile.ts"); - var expected = "../Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes UNC paths", function () { - var result = TypeScript.normalizePath("\\\\server\\share\\someFile.ts"); - var expected = "file://server/share/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative UNC paths with IP addresses", function () { - var result = TypeScript.normalizePath("\\\\127.0.0.1\\share\\..\\elsewhere\\someFile.ts"); - var expected = "file://127.0.0.1/elsewhere/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes HTTP paths", function () { - var result = TypeScript.normalizePath("http://www.server.com/share/someFile.ts"); - var expected = "http://www.server.com/share/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative HTTP paths", function () { - var result = TypeScript.normalizePath("http://www.server.com/share/../someFile.ts"); - var expected = "http://www.server.com/someFile.ts"; - assert.equal(result, expected); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/propertySignatureTests.ts b/tests/cases/unittests/compiler/propertySignatureTests.ts deleted file mode 100644 index 98e87d5be36..00000000000 --- a/tests/cases/unittests/compiler/propertySignatureTests.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\propertySignatureTests.ts', function() { - it('The Identifier of a property signature must be unique within its containing type. ', function(){ - var code = 'var foo: { a:string; a: string; };'; - Harness.Compiler.compileString(code, 'property signatures', function(result) { - assert.equal(result.errors.length, 1); - //assert.compilerWarning(result, 1, 9, 'Duplicate identifier a'); - }); - }); - - it('If a property signature omits a TypeAnnotation, the Any type is assumed.', function(){ - var code = 'var foo: { a; }; foo.a = 2; foo.a = "0";'; - Harness.Compiler.compileString(code, 'property signatures', function(result) { - assert.equal(result.errors.length, 0); - }); - }) -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/_project.ts b/tests/cases/unittests/services/_project.ts deleted file mode 100644 index e95a8a082ec..00000000000 --- a/tests/cases/unittests/services/_project.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -/// -/// -/// diff --git a/tests/cases/unittests/services/baselines/baseline-accept.ts b/tests/cases/unittests/services/baselines/baseline-accept.ts deleted file mode 100644 index fcd0f5c021a..00000000000 --- a/tests/cases/unittests/services/baselines/baseline-accept.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -/// -declare var JSON: any; - -describe('Accepting local files as new reference...', function() { - var localPath = 'tests/services/baselines/local'; - var outputPath = 'tests/services/baselines/reference'; - - // Get a list of all the files in the baseline/inputs folder - var files = IO.dir(localPath); - - // Copy them to the output folder - for (var i = 0; i < files.length; i++) { - var filename = files[i].substr(files[i].lastIndexOf('\\')); - if(filename.indexOf('.html') === -1) { - var referenceData = IO.readFile(files[i]); - IO.writeFile(outputPath + '/' + filename, referenceData); - } - } -}); diff --git a/tests/cases/unittests/services/baselines/baseline-create.ts b/tests/cases/unittests/services/baselines/baseline-create.ts deleted file mode 100644 index f4bb89649a5..00000000000 --- a/tests/cases/unittests/services/baselines/baseline-create.ts +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// -/// - -describe('Baseline files match (intellisense data)', function() { - var inputPath = 'tests/services/baselines/inputs'; - var outputPath = 'tests/services/baselines/local'; - var referencePath = 'tests/services/baselines/reference'; - - var i; - - // Might need to create this - IO.createDirectory(outputPath); - - // Delete any old reports from the local path - var localFiles = IO.dir(outputPath); - for (i = 0; i < localFiles.length; i++) { - var localFilename = localFiles[i]; - if(localFilename.indexOf('.html') > 0) { - IO.deleteFile(localFilename); - } - } - - // Get a list of all the files in the baseline/inputs folder - var files = IO.dir(inputPath); - - var template = IO.readFile('tests/services/baselines/diff-template.html'); - - // For each file, get data: - // a) Completion - // b) Type signature - // c) etc... - for (i = 0; i < files.length; i++) { - var filename = files[i].substr(files[i].lastIndexOf('\\')); - var scriptText = IO.readFile(files[i]).trim(); - - var outputAndCheck = function(nameSuffix: string, process: any) { - describe(nameSuffix + ' data for ' + filename + ' matches the baseline', function() { - var data = process(scriptText); - var stringified = JSON.stringify(data).trim(); - - var baseFilename = filename + '-' + nameSuffix + '.json'; - IO.writeFile(outputPath + '/' + baseFilename, stringified); - - var referenceFilename = referencePath + '/' + baseFilename; - var reference = IO.fileExists(referenceFilename) ? IO.readFile(referenceFilename) : '[{file: "(no file)"}]'; - reference = reference.trim(); - - if (reference != stringified) { - // Emit a report file in 'local' - var errorReportFile = outputPath + filename + '-' + nameSuffix + '-diff.html'; - IO.writeFile(errorReportFile, - template.replace('/**REFERENCE**/', reference).replace('/**ACTUAL**/', stringified)); - throw new Error('Data does not match reference. Refer to diff report ' + errorReportFile); - } - }); - }; - - // Write that data out to a JSON file in the 'local' folder - outputAndCheck('signatures', getIntellisenseSignatureRegions); - outputAndCheck('completions', getIntellisenseCompletionListRegions); - outputAndCheck('definitions', getIntellisenseDefinitionRegions); - outputAndCheck('types', getIntellisenseTypeRegions); - outputAndCheck('members', getIntellisenseMemberListRegions); - } -}); diff --git a/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts b/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts deleted file mode 100644 index 837c5dbf6fd..00000000000 --- a/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts +++ /dev/null @@ -1,23 +0,0 @@ -module Foo { var testing = ""; test } - -class C1 { - public pubMeth() {this.} // test on 'this.' - private privMeth() {} - public pubProp; - private privProp; -} - -var f = new C1(); -f. // test on F. -module M { - export class C { public pub; private priv; } - export var V = 0; -} - - -var c = new M.C(); - -c. // test on c. - -//Test for comment -//c. \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/inputs/optionsParser.ts b/tests/cases/unittests/services/baselines/inputs/optionsParser.ts deleted file mode 100644 index 5d81a651971..00000000000 --- a/tests/cases/unittests/services/baselines/inputs/optionsParser.ts +++ /dev/null @@ -1,215 +0,0 @@ -interface IOptions { - name: string; - flag: boolean; - short: string; - usage: string; - set: (s: string) => void; - type: string; -} - -class OptionsParser { - private DEFAULT_SHORT_FLAG = "-"; - private DEFAULT_LONG_FLAG = "--"; - - constructor (private host: IIO) { } - - // Find the option record for the given string. Returns null if not found. - private findOption(arg: string) { - - for (var i = 0; i < this.options.length; i++) { - - if (arg === this.options[i].short || arg === this.options[i].name) { - return this.options[i]; - } - } - - return null; - } - - public unnamed: string[] = []; - - public options: IOptions[] = []; - - public printUsage() { - IO.printLine("Syntax: tsc [options] [file ..]"); - IO.printLine(""); - IO.printLine("Examples: tsc hello.ts"); - IO.printLine(" tsc --out foo.js foo.ts"); - IO.printLine(" tsc @args.txt"); - IO.printLine(""); - IO.printLine("Options:"); - - var output = []; - var maxLength = 0; - - this.options = this.options.sort(function(a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - }); - - // Build up output array - for (var i = 0; i < this.options.length; i++) { - var option = this.options[i]; - - if (!option.usage) - break; - - var usageString = " "; - var type = option.type ? " " + option.type.toUpperCase() : ""; - - if (option.short) { - usageString += this.DEFAULT_SHORT_FLAG + option.short + type + ", "; - } - - usageString += this.DEFAULT_LONG_FLAG + option.name + type; - - output.push([usageString, option.usage]); - - if (usageString.length > maxLength) { - maxLength = usageString.length; - } - } - - output.push([" @", "Insert command line options and files from a file."]); - - // Print padded output - for (var i = 0; i < output.length; i++) { - IO.printLine(output[i][0] + (new Array(maxLength - output[i][0].length + 3)).join(" ") + output[i][1]); - } - } - - public option(name: string, config: IOptions); - public option(name: string, config: IOptions, short: string) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = false; - - this.options.push(config); - } - - public flag(name: string, config: IOptions); - public flag(name: string, config: IOptions, short: string) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = true - - this.options.push(config); - } - - - - // Parse an arguments string - public parseString(argString: string) { - var position = 0; - var tokens = argString.match(/\s+|"|[^\s"]+/g); - - function peek() { - return tokens[position]; - } - - function consume() { - return tokens[position++]; - } - - function consumeQuotedString() { - var value = ''; - consume(); // skip opening quote. - - var token = peek(); - - while (token && token !== '"') { - consume(); - - value += token; - - token = peek(); - } - - consume(); // skip ending quote; - - return value; - } - - var args: string[] = []; - var currentArg = ''; - - while (position < tokens.length) { - var token = peek(); - - if (token === '"') { - currentArg += consumeQuotedString(); - } else if (token.match(/\s/)) { - if (currentArg.length > 0) { - args.push(currentArg); - currentArg = ''; - } - - consume(); - } else { - consume(); - currentArg += token; - } - } - - if (currentArg.length > 0) { - args.push(currentArg); - } - - this.parse(args); - } - - // Parse arguments as they come from the platform: split into arguments. - public parse(args: string[]) { - var position = 0; - - function consume() { - return args[position++]; - } - - while (position < args.length) { - var current = consume(); - var match = current.match(/^(--?|\/|@)(.*)/); - var value = null; - - if (match) { - if (match[1] === '@') { - this.parseString(IO.readFile(match[2])); - } else { - var arg = match[2]; - var option = this.findOption(arg); - - if (option === null) { - IO.printLine("Unknown option " + arg); - IO.printLine(""); - this.printUsage(); - } else { - if (!option.flag) - value = consume(); - - option.set(value); - } - } - } else { - this.unnamed.push(current); - } - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json deleted file mode 100644 index 8a473b3c2e2..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":7,"end":11,"data":"(empty)"},{"start":11,"end":21,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":21,"end":29,"data":"(empty)"},{"start":29,"end":31,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":31,"end":34,"data":"(empty)"},{"start":34,"end":46,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":46,"end":49,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":49,"end":55,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":55,"end":58,"data":"(empty)"},{"start":58,"end":71,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":71,"end":79,"data":"(empty)"},{"start":79,"end":118,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":118,"end":127,"data":"(empty)"},{"start":127,"end":141,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":141,"end":149,"data":"(empty)"},{"start":149,"end":164,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":164,"end":173,"data":"(empty)"},{"start":173,"end":181,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":181,"end":188,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":188,"end":190,"data":"(empty)"},{"start":190,"end":207,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":207,"end":220,"data":"(empty)"},{"start":220,"end":221,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":221,"end":228,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":228,"end":230,"data":"(empty)"},{"start":230,"end":237,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":237,"end":250,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":250,"end":252,"data":"(empty)"},{"start":252,"end":261,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":261,"end":265,"data":"(empty)"},{"start":265,"end":278,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":278,"end":283,"data":"(empty)"},{"start":283,"end":290,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":290,"end":306,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":306,"end":308,"data":"(empty)"},{"start":308,"end":316,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":316,"end":325,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":325,"end":327,"data":"(empty)"},{"start":327,"end":347,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":347,"end":360,"data":"(empty)"},{"start":360,"end":364,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":364,"end":382,"data":"(empty)"},{"start":382,"end":384,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json deleted file mode 100644 index 34eaa83d1d1..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":17,"end":31,"data":"0\t17\t34\t\ttesting\t\tFoo"},{"start":33,"end":34,"data":"0\t17\t34\t\ttesting\t\tFoo"},{"start":49,"end":60,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":71,"end":79,"data":"0\t64\t88\t\tpubMeth\t\tC1"},{"start":82,"end":87,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":118,"end":127,"data":"0\t110\t131\t\tprivMeth\t\tC1"},{"start":134,"end":151,"data":"0\t134\t153\t\tpubProp\t\tC1"},{"start":152,"end":153,"data":"0\t134\t153\t\tpubProp\t\tC1"},{"start":156,"end":175,"data":"0\t156\t177\t\tprivProp\t\tC1"},{"start":176,"end":177,"data":"0\t156\t177\t\tprivProp\t\tC1"},{"start":184,"end":192,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":192,"end":200,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":200,"end":201,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":203,"end":206,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":221,"end":230,"data":"0\t221\t315\t\tM\t\t__GLO"},{"start":237,"end":252,"data":"0\t250\t289\t\tC\t\tM"},{"start":254,"end":267,"data":"0\t254\t269\t\tpub\t\tM.C"},{"start":268,"end":269,"data":"0\t254\t269\t\tpub\t\tM.C"},{"start":270,"end":285,"data":"0\t270\t287\t\tpriv\t\tM.C"},{"start":286,"end":287,"data":"0\t270\t287\t\tpriv\t\tM.C"},{"start":295,"end":310,"data":"0\t295\t312\t\tV\t\tM"},{"start":311,"end":312,"data":"0\t295\t312\t\tV\t\tM"},{"start":321,"end":329,"data":"0\t321\t339\t\tc\t\t__GLO"},{"start":329,"end":333,"data":"0\t250\t289\t\tC\t\tM"},{"start":333,"end":335,"data":"0\t221\t315\t\tM\t\t__GLO"},{"start":335,"end":338,"data":"0\t250\t289\t\tC\t\tM"},{"start":338,"end":339,"data":"0\t321\t339\t\tc\t\t__GLO"},{"start":343,"end":346,"data":"0\t321\t339\t\tc\t\t__GLO"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json deleted file mode 100644 index 8c5c53ffe2b..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":87,"end":88,"data":"pubMeth\t() => void\npubProp\tnumber\nprivMeth\t() => void\nprivProp\tnumber\n"},{"start":205,"end":206,"data":"pubMeth\t() => void\npubProp\tnumber\n"},{"start":335,"end":336,"data":"C\tnew() => M.C\nV\tnumber\n"},{"start":345,"end":346,"data":"pub\tnumber\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json deleted file mode 100644 index 1ae96554115..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":192,"end":200,"data":"C1(): C1\n"},{"start":329,"end":338,"data":"C(): C\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json deleted file mode 100644 index c1edf8cf695..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":17,"end":34,"data":"string"},{"start":34,"end":39,"data":"Foo"},{"start":39,"end":43,"data":"any"},{"start":43,"end":45,"data":"Foo"},{"start":49,"end":64,"data":"new() => C1"},{"start":64,"end":82,"data":"() => void"},{"start":82,"end":87,"data":"C1"},{"start":87,"end":88,"data":"() => void"},{"start":88,"end":89,"data":"new() => C1"},{"start":108,"end":110,"data":"new() => C1"},{"start":110,"end":131,"data":"() => void"},{"start":131,"end":134,"data":"new() => C1"},{"start":134,"end":153,"data":"number"},{"start":153,"end":156,"data":"new() => C1"},{"start":156,"end":177,"data":"number"},{"start":177,"end":180,"data":"new() => C1"},{"start":184,"end":196,"data":"C1"},{"start":196,"end":198,"data":"new() => C1"},{"start":198,"end":201,"data":"C1"},{"start":203,"end":205,"data":"C1"},{"start":221,"end":237,"data":"M"},{"start":237,"end":254,"data":"new() => C"},{"start":254,"end":269,"data":"number"},{"start":269,"end":270,"data":"new() => C"},{"start":270,"end":287,"data":"number"},{"start":287,"end":289,"data":"new() => C"},{"start":289,"end":295,"data":"M"},{"start":295,"end":312,"data":"number"},{"start":312,"end":315,"data":"M"},{"start":321,"end":333,"data":"M.C"},{"start":333,"end":334,"data":"M"},{"start":334,"end":336,"data":"new() => M.C"},{"start":336,"end":339,"data":"M.C"},{"start":343,"end":345,"data":"M.C"}] - diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json deleted file mode 100644 index a3343a7405f..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":10,"end":19,"data":"(empty)"},{"start":19,"end":26,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":26,"end":31,"data":"(empty)"},{"start":31,"end":45,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":45,"end":50,"data":"(empty)"},{"start":50,"end":62,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":62,"end":68,"data":"(empty)"},{"start":68,"end":82,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":82,"end":88,"data":"(empty)"},{"start":88,"end":102,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":102,"end":106,"data":"(empty)"},{"start":106,"end":108,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":108,"end":110,"data":"(empty)"},{"start":110,"end":133,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":133,"end":138,"data":"(empty)"},{"start":138,"end":150,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":150,"end":159,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":159,"end":173,"data":"(empty)"},{"start":173,"end":180,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":180,"end":186,"data":"(empty)"},{"start":186,"end":188,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":188,"end":207,"data":"(empty)"},{"start":207,"end":209,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":209,"end":213,"data":"(empty)"},{"start":213,"end":219,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":219,"end":225,"data":"(empty)"},{"start":225,"end":227,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":227,"end":245,"data":"(empty)"},{"start":245,"end":247,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":247,"end":252,"data":"(empty)"},{"start":252,"end":260,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":260,"end":296,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nhost any\n(standard items)"},{"start":296,"end":304,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":304,"end":378,"data":"(empty)"},{"start":378,"end":383,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":383,"end":391,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":391,"end":406,"data":"(empty)"},{"start":406,"end":437,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":437,"end":439,"data":"(empty)"},{"start":439,"end":658,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":658,"end":665,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":665,"end":670,"data":"(empty)"},{"start":670,"end":672,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":672,"end":680,"data":"(empty)"},{"start":680,"end":703,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":703,"end":708,"data":"(empty)"},{"start":708,"end":710,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":710,"end":718,"data":"(empty)"},{"start":718,"end":743,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":743,"end":750,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":750,"end":761,"data":"(empty)"},{"start":761,"end":787,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":787,"end":827,"data":"(empty)"},{"start":827,"end":851,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":851,"end":854,"data":"(empty)"},{"start":854,"end":878,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":878,"end":908,"data":"(empty)"},{"start":908,"end":932,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":932,"end":973,"data":"(empty)"},{"start":973,"end":997,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":997,"end":1027,"data":"(empty)"},{"start":1027,"end":1051,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1051,"end":1054,"data":"(empty)"},{"start":1054,"end":1078,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1078,"end":1089,"data":"(empty)"},{"start":1089,"end":1106,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1106,"end":1113,"data":"(empty)"},{"start":1113,"end":1132,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1132,"end":1142,"data":"(empty)"},{"start":1142,"end":1191,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1191,"end":1225,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1225,"end":1231,"data":"(empty)"},{"start":1231,"end":1272,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1272,"end":1278,"data":"(empty)"},{"start":1278,"end":1509,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1509,"end":1523,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1523,"end":1547,"data":"(empty)"},{"start":1547,"end":1565,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1565,"end":1567,"data":"(empty)"},{"start":1567,"end":1621,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1621,"end":1628,"data":"(empty)"},{"start":1628,"end":1724,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1724,"end":1736,"data":"(empty)"},{"start":1736,"end":1738,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1738,"end":1743,"data":"(empty)"},{"start":1743,"end":1761,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1761,"end":1766,"data":"(empty)"},{"start":1766,"end":1782,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1782,"end":1786,"data":"(empty)"},{"start":1786,"end":1816,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1816,"end":1819,"data":"(empty)"},{"start":1819,"end":1935,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1935,"end":1940,"data":"(empty)"},{"start":1940,"end":2240,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2240,"end":2252,"data":"(empty)"},{"start":2252,"end":2253,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2253,"end":2306,"data":"(empty)"},{"start":2306,"end":2321,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2321,"end":2343,"data":"(empty)"},{"start":2343,"end":2361,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2361,"end":2363,"data":"(empty)"},{"start":2363,"end":2489,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2489,"end":2493,"data":"(empty)"},{"start":2493,"end":2529,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2529,"end":2536,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2536,"end":2543,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2543,"end":2555,"data":"(empty)"},{"start":2555,"end":2564,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2564,"end":2571,"data":"(empty)"},{"start":2571,"end":2583,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2583,"end":2588,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2588,"end":2595,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2595,"end":2607,"data":"(empty)"},{"start":2607,"end":2616,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2616,"end":2623,"data":"(empty)"},{"start":2623,"end":2634,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2634,"end":2640,"data":"(empty)"},{"start":2640,"end":2884,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2884,"end":2891,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2891,"end":2898,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2898,"end":2908,"data":"(empty)"},{"start":2908,"end":2917,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2917,"end":2924,"data":"(empty)"},{"start":2924,"end":2936,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2936,"end":2941,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2941,"end":2948,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2948,"end":2958,"data":"(empty)"},{"start":2958,"end":2967,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2967,"end":2974,"data":"(empty)"},{"start":2974,"end":2985,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2985,"end":2991,"data":"(empty)"},{"start":2991,"end":3233,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":3233,"end":3245,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":3245,"end":3273,"data":"(empty)"},{"start":3273,"end":3278,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":3278,"end":3285,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3285,"end":3307,"data":"(empty)"},{"start":3307,"end":3331,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3331,"end":3340,"data":"(empty)"},{"start":3340,"end":3358,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3358,"end":3365,"data":"(empty)"},{"start":3365,"end":3397,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3397,"end":3400,"data":"(empty)"},{"start":3400,"end":3422,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3422,"end":3427,"data":"(empty)"},{"start":3427,"end":3500,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3500,"end":3508,"data":"(empty)"},{"start":3508,"end":3574,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3574,"end":3583,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3583,"end":3603,"data":"(empty)"},{"start":3603,"end":3624,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3624,"end":3630,"data":"(empty)"},{"start":3630,"end":3632,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3632,"end":3635,"data":"(empty)"},{"start":3635,"end":3661,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3661,"end":3683,"data":"(empty)"},{"start":3683,"end":3702,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3702,"end":3708,"data":"(empty)"},{"start":3708,"end":3759,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3759,"end":3763,"data":"(empty)"},{"start":3763,"end":3906,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3906,"end":3927,"data":"(empty)"},{"start":3927,"end":3967,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3967,"end":3982,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3982,"end":3987,"data":"(empty)"},{"start":3987,"end":4016,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4016,"end":4027,"data":"(empty)"},{"start":4027,"end":4029,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4029,"end":4032,"data":"(empty)"},{"start":4032,"end":4096,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4096,"end":4102,"data":"(empty)"},{"start":4102,"end":4141,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4141,"end":4145,"data":"(empty)"},{"start":4145,"end":4241,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4241,"end":4243,"data":"(empty)"},{"start":4243,"end":4371,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4371,"end":4374,"data":"(empty)"},{"start":4374,"end":4661,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4661,"end":4669,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":4669,"end":4741,"data":"(empty)"},{"start":4741,"end":4746,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":4746,"end":4753,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4753,"end":4764,"data":"(empty)"},{"start":4764,"end":4790,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4790,"end":4799,"data":"(empty)"},{"start":4799,"end":4824,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4824,"end":4832,"data":"(empty)"},{"start":4832,"end":4946,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4946,"end":4954,"data":"(empty)"},{"start":4954,"end":4984,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4984,"end":4990,"data":"(empty)"},{"start":4990,"end":5022,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5022,"end":5024,"data":"(empty)"},{"start":5024,"end":5043,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5043,"end":5049,"data":"(empty)"},{"start":5049,"end":5119,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5119,"end":5123,"data":"(empty)"},{"start":5123,"end":5239,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5239,"end":5243,"data":"(empty)"},{"start":5243,"end":5280,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5280,"end":5287,"data":"(empty)"},{"start":5287,"end":5395,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5395,"end":5413,"data":"(empty)"},{"start":5413,"end":5459,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5459,"end":5462,"data":"(empty)"},{"start":5462,"end":5817,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json deleted file mode 100644 index d421be0f800..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":26,"end":32,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":45,"end":51,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":62,"end":69,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":82,"end":89,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":102,"end":107,"data":"0\t102\t127\t\tset\t\tIOptions"},{"start":108,"end":111,"data":"0\t108\t117\t\ts\t\t"},{"start":133,"end":139,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":153,"end":173,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":180,"end":209,"data":"0\t180\t212\t\tDEFAULT_SHORT_FLAG\t\tOptionsParser"},{"start":219,"end":247,"data":"0\t219\t251\t\tDEFAULT_LONG_FLAG\t\tOptionsParser"},{"start":260,"end":272,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":273,"end":287,"data":"0\t273\t290\t\thost\t\tOptionsParser"},{"start":291,"end":292,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":383,"end":391,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":391,"end":402,"data":"0\t383\t657\t\tfindOption\t\tOptionsParser"},{"start":402,"end":407,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":414,"end":415,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":433,"end":441,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":444,"end":446,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":448,"end":452,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":452,"end":461,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":469,"end":471,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":495,"end":499,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":503,"end":507,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":507,"end":516,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":516,"end":518,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":518,"end":525,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":528,"end":532,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":536,"end":540,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":540,"end":549,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":549,"end":551,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":551,"end":557,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":577,"end":584,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":584,"end":588,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":588,"end":597,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":597,"end":599,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":599,"end":600,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":665,"end":681,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":689,"end":692,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":703,"end":719,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":719,"end":729,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":729,"end":732,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":732,"end":734,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":750,"end":761,"data":"0\t743\t2528\t\tprintUsage\t\tOptionsParser"},{"start":1102,"end":1115,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":1117,"end":1118,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":1128,"end":1144,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":1145,"end":1146,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":1158,"end":1162,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1162,"end":1171,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1173,"end":1177,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1177,"end":1186,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1200,"end":1202,"data":"0\t1200\t1201\t\ta\t\tOptionsParser.printUsage._anonymous"},{"start":1203,"end":1205,"data":"0\t1203\t1204\t\tb\t\tOptionsParser.printUsage._anonymous"},{"start":1221,"end":1233,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1233,"end":1235,"data":"0\t1200\t1201\t\ta\t\tOptionsParser.printUsage._anonymous"},{"start":1253,"end":1254,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1268,"end":1280,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1280,"end":1282,"data":"0\t1203\t1204\t\tb\t\tOptionsParser.printUsage._anonymous"},{"start":1300,"end":1301,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1321,"end":1327,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1329,"end":1335,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1389,"end":1395,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1397,"end":1403,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1561,"end":1569,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1572,"end":1574,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1576,"end":1580,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1580,"end":1589,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1597,"end":1599,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1617,"end":1630,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1630,"end":1634,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1634,"end":1643,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1643,"end":1645,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1645,"end":1646,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1667,"end":1674,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1674,"end":1680,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":1720,"end":1738,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1742,"end":1743,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1757,"end":1768,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1768,"end":1775,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1775,"end":1780,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":1788,"end":1795,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1795,"end":1800,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":1818,"end":1819,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1839,"end":1846,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1846,"end":1852,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":1872,"end":1884,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1887,"end":1891,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1891,"end":1911,"data":"0\t180\t212\t\tDEFAULT_SHORT_FLAG\t\tOptionsParser"},{"start":1913,"end":1920,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1920,"end":1926,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":1928,"end":1933,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1971,"end":1983,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1986,"end":1990,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1990,"end":2009,"data":"0\t219\t251\t\tDEFAULT_LONG_FLAG\t\tOptionsParser"},{"start":2011,"end":2018,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":2018,"end":2023,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":2025,"end":2030,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":2046,"end":2053,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2059,"end":2071,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2072,"end":2079,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":2079,"end":2085,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":2107,"end":2119,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2128,"end":2138,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2158,"end":2168,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2170,"end":2182,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2227,"end":2234,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2357,"end":2365,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2368,"end":2370,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2372,"end":2379,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2387,"end":2389,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2420,"end":2427,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2427,"end":2429,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2446,"end":2456,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2458,"end":2465,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2465,"end":2467,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2496,"end":2503,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2503,"end":2505,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2543,"end":2550,"data":"0\t2588\t2883\t\toption\t\tOptionsParser"},{"start":2550,"end":2556,"data":"0\t2550\t2562\t\tname\t\t"},{"start":2564,"end":2572,"data":"0\t2564\t2580\t\tconfig\t\t"},{"start":2572,"end":2581,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2595,"end":2602,"data":"0\t2588\t2883\t\toption\t\tOptionsParser"},{"start":2602,"end":2608,"data":"0\t2602\t2614\t\tname\t\tOptionsParser.option"},{"start":2616,"end":2624,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2624,"end":2633,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2634,"end":2641,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2665,"end":2672,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2688,"end":2695,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2697,"end":2698,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2702,"end":2708,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2722,"end":2728,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2758,"end":2765,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2765,"end":2770,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":2772,"end":2777,"data":"0\t2602\t2614\t\tname\t\tOptionsParser.option"},{"start":2787,"end":2794,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2794,"end":2800,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":2802,"end":2808,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2818,"end":2825,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2825,"end":2830,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":2850,"end":2854,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":2854,"end":2863,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":2868,"end":2875,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2898,"end":2903,"data":"0\t2941\t3232\t\tflag\t\tOptionsParser"},{"start":2903,"end":2909,"data":"0\t2903\t2915\t\tname\t\t"},{"start":2917,"end":2925,"data":"0\t2917\t2933\t\tconfig\t\t"},{"start":2925,"end":2934,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2948,"end":2953,"data":"0\t2941\t3232\t\tflag\t\tOptionsParser"},{"start":2953,"end":2959,"data":"0\t2953\t2965\t\tname\t\tOptionsParser.flag"},{"start":2967,"end":2975,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":2975,"end":2984,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2985,"end":2992,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3016,"end":3023,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3039,"end":3046,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3048,"end":3049,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":3053,"end":3059,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3073,"end":3079,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3109,"end":3116,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3116,"end":3121,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":3123,"end":3128,"data":"0\t2953\t2965\t\tname\t\tOptionsParser.flag"},{"start":3138,"end":3145,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3145,"end":3151,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":3153,"end":3159,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3169,"end":3176,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3176,"end":3181,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":3199,"end":3203,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":3203,"end":3212,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":3217,"end":3224,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3285,"end":3297,"data":"0\t3278\t4660\t\tparseString\t\tOptionsParser"},{"start":3297,"end":3308,"data":"0\t3297\t3314\t\targString\t\tOptionsParser.parseString"},{"start":3327,"end":3342,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3343,"end":3344,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3354,"end":3367,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3367,"end":3377,"data":"0\t3297\t3314\t\targString\t\tOptionsParser.parseString"},{"start":3400,"end":3401,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3422,"end":3427,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3451,"end":3458,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3458,"end":3467,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3500,"end":3508,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3532,"end":3539,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3539,"end":3548,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3583,"end":3603,"data":"0\t3574\t3966\t\tconsumeQuotedString\t\tOptionsParser.parseString"},{"start":3620,"end":3632,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3634,"end":3635,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3649,"end":3657,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3698,"end":3710,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3710,"end":3715,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3716,"end":3717,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3740,"end":3746,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3749,"end":3755,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3783,"end":3791,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3813,"end":3819,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3822,"end":3828,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3848,"end":3854,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3856,"end":3861,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3894,"end":3902,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3949,"end":3955,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3978,"end":3988,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":3996,"end":3999,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4001,"end":4002,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4012,"end":4029,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4031,"end":4032,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4051,"end":4060,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":4062,"end":4069,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":4092,"end":4104,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4104,"end":4109,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":4110,"end":4111,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4131,"end":4137,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4165,"end":4176,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4179,"end":4199,"data":"0\t3574\t3966\t\tconsumeQuotedString\t\tOptionsParser.parseString"},{"start":4226,"end":4232,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4268,"end":4279,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4314,"end":4319,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4324,"end":4335,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4358,"end":4369,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4413,"end":4421,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":4463,"end":4471,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":4491,"end":4502,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4505,"end":4511,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4553,"end":4564,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4591,"end":4596,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4601,"end":4612,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4636,"end":4640,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":4640,"end":4647,"data":"0\t4746\t5816\t\tparse\t\tOptionsParser"},{"start":4647,"end":4652,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4753,"end":4759,"data":"0\t4746\t5816\t\tparse\t\tOptionsParser"},{"start":4759,"end":4765,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4786,"end":4801,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4802,"end":4803,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4824,"end":4832,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":4856,"end":4861,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4861,"end":4870,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4903,"end":4912,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4914,"end":4919,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4942,"end":4956,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":4956,"end":4964,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":4965,"end":4966,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":4980,"end":4992,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":4992,"end":5000,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":5024,"end":5025,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5039,"end":5051,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5055,"end":5056,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5076,"end":5082,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5106,"end":5112,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5147,"end":5151,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5151,"end":5164,"data":"0\t3278\t4660\t\tparseString\t\tOptionsParser"},{"start":5176,"end":5182,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5235,"end":5245,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5245,"end":5251,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5253,"end":5254,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5276,"end":5289,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5289,"end":5293,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5293,"end":5305,"data":"0\t383\t657\t\tfindOption\t\tOptionsParser"},{"start":5305,"end":5309,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5309,"end":5310,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5338,"end":5345,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5415,"end":5419,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5489,"end":5493,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5493,"end":5505,"data":"0\t743\t2528\t\tprintUsage\t\tOptionsParser"},{"start":5568,"end":5575,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5575,"end":5580,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":5610,"end":5616,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5618,"end":5626,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":5656,"end":5663,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5663,"end":5667,"data":"0\t102\t127\t\tset\t\tIOptions"},{"start":5667,"end":5673,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5756,"end":5760,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5760,"end":5769,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":5774,"end":5782,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json deleted file mode 100644 index 0788916ce55..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":453,"end":454,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":508,"end":509,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":519,"end":520,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":541,"end":542,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":552,"end":553,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":589,"end":590,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1163,"end":1164,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1178,"end":1179,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1581,"end":1582,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1635,"end":1636,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1674,"end":1675,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1775,"end":1776,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1795,"end":1796,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1846,"end":1847,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1892,"end":1893,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1920,"end":1921,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1991,"end":1992,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":2018,"end":2019,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2079,"end":2080,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2765,"end":2766,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2794,"end":2795,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2825,"end":2826,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2855,"end":2856,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":3116,"end":3117,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3145,"end":3146,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3176,"end":3177,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3204,"end":3205,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":4641,"end":4642,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5152,"end":5153,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5294,"end":5295,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5494,"end":5495,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5575,"end":5576,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":5663,"end":5664,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":5761,"end":5762,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json deleted file mode 100644 index 4191964256a..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":3649,"end":3659,"data":"consume(): any\n"},{"start":3710,"end":3716,"data":"peek(): any\n"},{"start":3783,"end":3793,"data":"consume(): any\n"},{"start":3856,"end":3862,"data":"peek(): any\n"},{"start":3894,"end":3904,"data":"consume(): any\n"},{"start":4104,"end":4110,"data":"peek(): any\n"},{"start":4179,"end":4200,"data":"consumeQuotedString(): string\n"},{"start":4413,"end":4423,"data":"consume(): any\n"},{"start":4463,"end":4473,"data":"consume(): any\n"},{"start":4636,"end":4653,"data":"parse(args: string[]): void\n"},{"start":4956,"end":4965,"data":"consume(): string\n"},{"start":5147,"end":5164,"data":"parseString(argString: string): void\n"},{"start":5185,"end":5187,"data":"parseString(argString: string): void\n"},{"start":5289,"end":5309,"data":"findOption(arg: string): IOptions\n"},{"start":5489,"end":5507,"data":"printUsage(): void\n"},{"start":5618,"end":5627,"data":"consume(): string\n"},{"start":5656,"end":5674,"data":"set(s: string): void\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json deleted file mode 100644 index 65995dc49b1..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":26,"end":39,"data":"string"},{"start":39,"end":45,"data":"IOptions"},{"start":45,"end":56,"data":"bool"},{"start":56,"end":62,"data":"IOptions"},{"start":62,"end":76,"data":"string"},{"start":76,"end":82,"data":"IOptions"},{"start":82,"end":96,"data":"string"},{"start":96,"end":102,"data":"IOptions"},{"start":102,"end":108,"data":"(s: string) => void"},{"start":108,"end":117,"data":"string"},{"start":117,"end":122,"data":"(s: string) => void"},{"start":122,"end":126,"data":"void"},{"start":126,"end":127,"data":"(s: string) => void"},{"start":127,"end":133,"data":"IOptions"},{"start":133,"end":146,"data":"string"},{"start":146,"end":149,"data":"IOptions"},{"start":153,"end":180,"data":"new(host: any) => OptionsParser"},{"start":180,"end":212,"data":"string"},{"start":212,"end":219,"data":"new(host: any) => OptionsParser"},{"start":219,"end":251,"data":"string"},{"start":251,"end":273,"data":"new(host: any) => OptionsParser"},{"start":273,"end":290,"data":"any"},{"start":290,"end":303,"data":"new(host: any) => OptionsParser"},{"start":378,"end":383,"data":"new(host: any) => OptionsParser"},{"start":383,"end":402,"data":"(arg: string) => IOptions"},{"start":402,"end":413,"data":"string"},{"start":413,"end":428,"data":"(arg: string) => IOptions"},{"start":428,"end":433,"data":"void"},{"start":433,"end":442,"data":"number"},{"start":442,"end":444,"data":"void"},{"start":444,"end":445,"data":"number"},{"start":445,"end":448,"data":"bool"},{"start":448,"end":452,"data":"OptionsParser"},{"start":452,"end":460,"data":"IOptions[]"},{"start":460,"end":467,"data":"any"},{"start":467,"end":469,"data":"void"},{"start":469,"end":472,"data":"number"},{"start":472,"end":495,"data":"void"},{"start":495,"end":498,"data":"string"},{"start":498,"end":503,"data":"bool"},{"start":503,"end":507,"data":"OptionsParser"},{"start":507,"end":515,"data":"IOptions[]"},{"start":515,"end":516,"data":"IOptions"},{"start":516,"end":517,"data":"number"},{"start":517,"end":518,"data":"IOptions"},{"start":518,"end":524,"data":"string"},{"start":524,"end":528,"data":"bool"},{"start":528,"end":531,"data":"string"},{"start":531,"end":536,"data":"bool"},{"start":536,"end":540,"data":"OptionsParser"},{"start":540,"end":548,"data":"IOptions[]"},{"start":548,"end":549,"data":"IOptions"},{"start":549,"end":550,"data":"number"},{"start":550,"end":551,"data":"IOptions"},{"start":551,"end":556,"data":"string"},{"start":556,"end":577,"data":"void"},{"start":577,"end":584,"data":"IOptions"},{"start":584,"end":588,"data":"OptionsParser"},{"start":588,"end":596,"data":"IOptions[]"},{"start":596,"end":597,"data":"IOptions"},{"start":597,"end":598,"data":"number"},{"start":598,"end":600,"data":"IOptions"},{"start":600,"end":626,"data":"void"},{"start":626,"end":638,"data":"(arg: string) => IOptions"},{"start":638,"end":650,"data":"any"},{"start":650,"end":657,"data":"(arg: string) => IOptions"},{"start":657,"end":665,"data":"new(host: any) => OptionsParser"},{"start":665,"end":681,"data":"string[]"},{"start":681,"end":687,"data":"string"},{"start":687,"end":694,"data":"string[]"},{"start":694,"end":703,"data":"new(host: any) => OptionsParser"},{"start":703,"end":719,"data":"IOptions[]"},{"start":719,"end":727,"data":"IOptions"},{"start":727,"end":734,"data":"IOptions[]"},{"start":734,"end":743,"data":"new(host: any) => OptionsParser"},{"start":743,"end":774,"data":"() => void"},{"start":774,"end":787,"data":"any"},{"start":787,"end":826,"data":"string"},{"start":826,"end":828,"data":"any"},{"start":828,"end":838,"data":"() => void"},{"start":838,"end":851,"data":"any"},{"start":851,"end":853,"data":"string"},{"start":853,"end":855,"data":"any"},{"start":855,"end":865,"data":"() => void"},{"start":865,"end":878,"data":"any"},{"start":878,"end":907,"data":"string"},{"start":907,"end":909,"data":"any"},{"start":909,"end":919,"data":"() => void"},{"start":919,"end":932,"data":"any"},{"start":932,"end":972,"data":"string"},{"start":972,"end":974,"data":"any"},{"start":974,"end":984,"data":"() => void"},{"start":984,"end":997,"data":"any"},{"start":997,"end":1026,"data":"string"},{"start":1026,"end":1028,"data":"any"},{"start":1028,"end":1038,"data":"() => void"},{"start":1038,"end":1051,"data":"any"},{"start":1051,"end":1053,"data":"string"},{"start":1053,"end":1055,"data":"any"},{"start":1055,"end":1065,"data":"() => void"},{"start":1065,"end":1078,"data":"any"},{"start":1078,"end":1088,"data":"string"},{"start":1088,"end":1090,"data":"any"},{"start":1090,"end":1102,"data":"() => void"},{"start":1102,"end":1118,"data":"any[]"},{"start":1118,"end":1128,"data":"() => void"},{"start":1128,"end":1146,"data":"number"},{"start":1146,"end":1158,"data":"() => void"},{"start":1158,"end":1162,"data":"OptionsParser"},{"start":1162,"end":1170,"data":"IOptions[]"},{"start":1170,"end":1173,"data":"any"},{"start":1173,"end":1177,"data":"OptionsParser"},{"start":1177,"end":1185,"data":"IOptions[]"},{"start":1185,"end":1190,"data":"any"},{"start":1190,"end":1191,"data":"IOptions[]"},{"start":1191,"end":1200,"data":"(a: any,b: any) => number"},{"start":1200,"end":1201,"data":"any"},{"start":1201,"end":1203,"data":"(a: any,b: any) => number"},{"start":1203,"end":1204,"data":"any"},{"start":1204,"end":1221,"data":"(a: any,b: any) => number"},{"start":1221,"end":1254,"data":"any"},{"start":1254,"end":1268,"data":"(a: any,b: any) => number"},{"start":1268,"end":1301,"data":"any"},{"start":1301,"end":1317,"data":"(a: any,b: any) => number"},{"start":1317,"end":1321,"data":"void"},{"start":1321,"end":1326,"data":"any"},{"start":1326,"end":1329,"data":"bool"},{"start":1329,"end":1334,"data":"any"},{"start":1334,"end":1355,"data":"void"},{"start":1355,"end":1364,"data":"number"},{"start":1364,"end":1389,"data":"void"},{"start":1389,"end":1394,"data":"any"},{"start":1394,"end":1397,"data":"bool"},{"start":1397,"end":1402,"data":"any"},{"start":1402,"end":1423,"data":"void"},{"start":1423,"end":1433,"data":"number"},{"start":1433,"end":1473,"data":"void"},{"start":1473,"end":1482,"data":"number"},{"start":1482,"end":1497,"data":"void"},{"start":1497,"end":1508,"data":"(a: any,b: any) => number"},{"start":1508,"end":1509,"data":"IOptions[]"},{"start":1509,"end":1510,"data":"any"},{"start":1510,"end":1522,"data":"() => void"},{"start":1547,"end":1556,"data":"() => void"},{"start":1556,"end":1561,"data":"void"},{"start":1561,"end":1570,"data":"number"},{"start":1570,"end":1572,"data":"void"},{"start":1572,"end":1573,"data":"number"},{"start":1573,"end":1576,"data":"bool"},{"start":1576,"end":1580,"data":"OptionsParser"},{"start":1580,"end":1588,"data":"IOptions[]"},{"start":1588,"end":1595,"data":"any"},{"start":1595,"end":1597,"data":"void"},{"start":1597,"end":1600,"data":"number"},{"start":1600,"end":1617,"data":"void"},{"start":1617,"end":1630,"data":"IOptions"},{"start":1630,"end":1634,"data":"OptionsParser"},{"start":1634,"end":1642,"data":"IOptions[]"},{"start":1642,"end":1643,"data":"IOptions"},{"start":1643,"end":1644,"data":"number"},{"start":1644,"end":1646,"data":"IOptions"},{"start":1646,"end":1666,"data":"void"},{"start":1666,"end":1667,"data":"bool"},{"start":1667,"end":1673,"data":"IOptions"},{"start":1673,"end":1679,"data":"string"},{"start":1679,"end":1720,"data":"void"},{"start":1720,"end":1743,"data":"string"},{"start":1743,"end":1757,"data":"void"},{"start":1757,"end":1768,"data":"string"},{"start":1768,"end":1774,"data":"IOptions"},{"start":1774,"end":1788,"data":"string"},{"start":1788,"end":1794,"data":"IOptions"},{"start":1794,"end":1799,"data":"string"},{"start":1799,"end":1813,"data":"any"},{"start":1813,"end":1819,"data":"string"},{"start":1819,"end":1839,"data":"void"},{"start":1839,"end":1845,"data":"IOptions"},{"start":1845,"end":1851,"data":"string"},{"start":1851,"end":1872,"data":"void"},{"start":1872,"end":1887,"data":"string"},{"start":1887,"end":1891,"data":"OptionsParser"},{"start":1891,"end":1913,"data":"string"},{"start":1913,"end":1919,"data":"IOptions"},{"start":1919,"end":1940,"data":"string"},{"start":1940,"end":1971,"data":"void"},{"start":1971,"end":1986,"data":"string"},{"start":1986,"end":1990,"data":"OptionsParser"},{"start":1990,"end":2011,"data":"string"},{"start":2011,"end":2017,"data":"IOptions"},{"start":2017,"end":2030,"data":"string"},{"start":2030,"end":2046,"data":"void"},{"start":2046,"end":2052,"data":"any[]"},{"start":2052,"end":2058,"data":"any"},{"start":2058,"end":2059,"data":"string[]"},{"start":2059,"end":2070,"data":"string"},{"start":2070,"end":2072,"data":"string[]"},{"start":2072,"end":2078,"data":"IOptions"},{"start":2078,"end":2084,"data":"string"},{"start":2084,"end":2085,"data":"string[]"},{"start":2085,"end":2087,"data":"any"},{"start":2087,"end":2107,"data":"void"},{"start":2107,"end":2118,"data":"string"},{"start":2118,"end":2125,"data":"any"},{"start":2125,"end":2128,"data":"bool"},{"start":2128,"end":2137,"data":"number"},{"start":2137,"end":2158,"data":"void"},{"start":2158,"end":2167,"data":"number"},{"start":2167,"end":2170,"data":"any"},{"start":2170,"end":2181,"data":"string"},{"start":2181,"end":2188,"data":"number"},{"start":2188,"end":2189,"data":"any"},{"start":2189,"end":2215,"data":"void"},{"start":2215,"end":2227,"data":"() => void"},{"start":2227,"end":2233,"data":"any[]"},{"start":2233,"end":2239,"data":"any"},{"start":2239,"end":2240,"data":"string[]"},{"start":2240,"end":2251,"data":"string"},{"start":2251,"end":2253,"data":"string[]"},{"start":2253,"end":2305,"data":"string"},{"start":2305,"end":2306,"data":"string[]"},{"start":2306,"end":2308,"data":"any"},{"start":2308,"end":2320,"data":"() => void"},{"start":2343,"end":2352,"data":"() => void"},{"start":2352,"end":2357,"data":"void"},{"start":2357,"end":2366,"data":"number"},{"start":2366,"end":2368,"data":"void"},{"start":2368,"end":2369,"data":"number"},{"start":2369,"end":2372,"data":"bool"},{"start":2372,"end":2378,"data":"any[]"},{"start":2378,"end":2385,"data":"any"},{"start":2385,"end":2387,"data":"void"},{"start":2387,"end":2390,"data":"number"},{"start":2390,"end":2407,"data":"void"},{"start":2407,"end":2420,"data":"any"},{"start":2420,"end":2426,"data":"any[]"},{"start":2426,"end":2427,"data":"any"},{"start":2427,"end":2428,"data":"number"},{"start":2428,"end":2430,"data":"any"},{"start":2430,"end":2431,"data":"number"},{"start":2431,"end":2446,"data":"any"},{"start":2446,"end":2455,"data":"number"},{"start":2455,"end":2458,"data":"any"},{"start":2458,"end":2464,"data":"any[]"},{"start":2464,"end":2465,"data":"any"},{"start":2465,"end":2466,"data":"number"},{"start":2466,"end":2468,"data":"any"},{"start":2468,"end":2469,"data":"number"},{"start":2469,"end":2480,"data":"any"},{"start":2480,"end":2481,"data":"number"},{"start":2481,"end":2489,"data":"any"},{"start":2489,"end":2492,"data":"string"},{"start":2492,"end":2496,"data":"any"},{"start":2496,"end":2502,"data":"any[]"},{"start":2502,"end":2503,"data":"any"},{"start":2503,"end":2504,"data":"number"},{"start":2504,"end":2506,"data":"any"},{"start":2506,"end":2507,"data":"number"},{"start":2507,"end":2510,"data":"any"},{"start":2510,"end":2521,"data":"void"},{"start":2521,"end":2528,"data":"() => void"},{"start":2528,"end":2536,"data":"new(host: any) => OptionsParser"},{"start":2536,"end":2550,"data":"(name: string,config: IOptions): any; "},{"start":2550,"end":2562,"data":"string"},{"start":2562,"end":2564,"data":"(name: string,config: IOptions): any; "},{"start":2564,"end":2580,"data":"IOptions"},{"start":2580,"end":2582,"data":"(name: string,config: IOptions): any; "},{"start":2582,"end":2588,"data":"new(host: any) => OptionsParser"},{"start":2588,"end":2602,"data":"(name: string,config: IOptions): any; "},{"start":2602,"end":2614,"data":"string"},{"start":2614,"end":2616,"data":"(name: string,config: IOptions): any; "},{"start":2616,"end":2632,"data":"IOptions"},{"start":2632,"end":2634,"data":"(name: string,config: IOptions): any; "},{"start":2634,"end":2647,"data":"string"},{"start":2647,"end":2660,"data":"(name: string,config: IOptions): any; "},{"start":2660,"end":2664,"data":"void"},{"start":2664,"end":2665,"data":"bool"},{"start":2665,"end":2671,"data":"IOptions"},{"start":2671,"end":2688,"data":"void"},{"start":2688,"end":2694,"data":"IOptions"},{"start":2694,"end":2697,"data":"any"},{"start":2697,"end":2698,"data":"IOptions"},{"start":2698,"end":2701,"data":"any"},{"start":2701,"end":2702,"data":"IOptions"},{"start":2702,"end":2707,"data":"string"},{"start":2707,"end":2708,"data":"any"},{"start":2708,"end":2722,"data":"void"},{"start":2722,"end":2727,"data":"string"},{"start":2727,"end":2730,"data":"any"},{"start":2730,"end":2734,"data":"string"},{"start":2734,"end":2735,"data":"any"},{"start":2735,"end":2746,"data":"void"},{"start":2746,"end":2758,"data":"(name: string,config: IOptions): any; "},{"start":2758,"end":2764,"data":"IOptions"},{"start":2764,"end":2777,"data":"string"},{"start":2777,"end":2787,"data":"(name: string,config: IOptions): any; "},{"start":2787,"end":2793,"data":"IOptions"},{"start":2793,"end":2808,"data":"string"},{"start":2808,"end":2818,"data":"(name: string,config: IOptions): any; "},{"start":2818,"end":2824,"data":"IOptions"},{"start":2824,"end":2838,"data":"bool"},{"start":2838,"end":2850,"data":"(name: string,config: IOptions): any; "},{"start":2850,"end":2854,"data":"OptionsParser"},{"start":2854,"end":2862,"data":"IOptions[]"},{"start":2862,"end":2868,"data":"any"},{"start":2868,"end":2874,"data":"IOptions"},{"start":2874,"end":2876,"data":"any"},{"start":2876,"end":2883,"data":"(name: string,config: IOptions): any; "},{"start":2883,"end":2891,"data":"new(host: any) => OptionsParser"},{"start":2891,"end":2903,"data":"(name: string,config: IOptions): any; "},{"start":2903,"end":2915,"data":"string"},{"start":2915,"end":2917,"data":"(name: string,config: IOptions): any; "},{"start":2917,"end":2933,"data":"IOptions"},{"start":2933,"end":2935,"data":"(name: string,config: IOptions): any; "},{"start":2935,"end":2941,"data":"new(host: any) => OptionsParser"},{"start":2941,"end":2953,"data":"(name: string,config: IOptions): any; "},{"start":2953,"end":2965,"data":"string"},{"start":2965,"end":2967,"data":"(name: string,config: IOptions): any; "},{"start":2967,"end":2983,"data":"IOptions"},{"start":2983,"end":2985,"data":"(name: string,config: IOptions): any; "},{"start":2985,"end":2998,"data":"string"},{"start":2998,"end":3011,"data":"(name: string,config: IOptions): any; "},{"start":3011,"end":3015,"data":"void"},{"start":3015,"end":3016,"data":"bool"},{"start":3016,"end":3022,"data":"IOptions"},{"start":3022,"end":3039,"data":"void"},{"start":3039,"end":3045,"data":"IOptions"},{"start":3045,"end":3048,"data":"any"},{"start":3048,"end":3049,"data":"IOptions"},{"start":3049,"end":3052,"data":"any"},{"start":3052,"end":3053,"data":"IOptions"},{"start":3053,"end":3058,"data":"string"},{"start":3058,"end":3059,"data":"any"},{"start":3059,"end":3073,"data":"void"},{"start":3073,"end":3078,"data":"string"},{"start":3078,"end":3081,"data":"any"},{"start":3081,"end":3085,"data":"string"},{"start":3085,"end":3086,"data":"any"},{"start":3086,"end":3097,"data":"void"},{"start":3097,"end":3109,"data":"(name: string,config: IOptions): any; "},{"start":3109,"end":3115,"data":"IOptions"},{"start":3115,"end":3128,"data":"string"},{"start":3128,"end":3138,"data":"(name: string,config: IOptions): any; "},{"start":3138,"end":3144,"data":"IOptions"},{"start":3144,"end":3159,"data":"string"},{"start":3159,"end":3169,"data":"(name: string,config: IOptions): any; "},{"start":3169,"end":3175,"data":"IOptions"},{"start":3175,"end":3187,"data":"bool"},{"start":3187,"end":3199,"data":"(name: string,config: IOptions): any; "},{"start":3199,"end":3203,"data":"OptionsParser"},{"start":3203,"end":3211,"data":"IOptions[]"},{"start":3211,"end":3217,"data":"any"},{"start":3217,"end":3223,"data":"IOptions"},{"start":3223,"end":3225,"data":"any"},{"start":3225,"end":3232,"data":"(name: string,config: IOptions): any; "},{"start":3232,"end":3244,"data":"new(host: any) => OptionsParser"},{"start":3273,"end":3278,"data":"new(host: any) => OptionsParser"},{"start":3278,"end":3297,"data":"(argString: string) => void"},{"start":3297,"end":3314,"data":"string"},{"start":3314,"end":3327,"data":"(argString: string) => void"},{"start":3327,"end":3344,"data":"number"},{"start":3344,"end":3354,"data":"(argString: string) => void"},{"start":3354,"end":3367,"data":"any"},{"start":3367,"end":3376,"data":"string"},{"start":3376,"end":3401,"data":"any"},{"start":3401,"end":3413,"data":"(argString: string) => void"},{"start":3413,"end":3444,"data":"() => any"},{"start":3444,"end":3458,"data":"any"},{"start":3458,"end":3466,"data":"number"},{"start":3466,"end":3468,"data":"any"},{"start":3468,"end":3479,"data":"() => any"},{"start":3479,"end":3491,"data":"(argString: string) => void"},{"start":3491,"end":3525,"data":"() => any"},{"start":3525,"end":3539,"data":"any"},{"start":3539,"end":3549,"data":"number"},{"start":3549,"end":3551,"data":"any"},{"start":3551,"end":3562,"data":"() => any"},{"start":3562,"end":3574,"data":"(argString: string) => void"},{"start":3574,"end":3620,"data":"() => string"},{"start":3620,"end":3635,"data":"string"},{"start":3635,"end":3649,"data":"() => string"},{"start":3649,"end":3656,"data":"() => any"},{"start":3656,"end":3659,"data":"any"},{"start":3659,"end":3660,"data":"() => string"},{"start":3683,"end":3698,"data":"() => string"},{"start":3698,"end":3710,"data":"any"},{"start":3710,"end":3714,"data":"() => any"},{"start":3714,"end":3717,"data":"any"},{"start":3717,"end":3733,"data":"() => string"},{"start":3733,"end":3740,"data":"void"},{"start":3740,"end":3745,"data":"any"},{"start":3745,"end":3749,"data":"bool"},{"start":3749,"end":3754,"data":"any"},{"start":3754,"end":3759,"data":"bool"},{"start":3759,"end":3762,"data":"string"},{"start":3762,"end":3783,"data":"void"},{"start":3783,"end":3790,"data":"() => any"},{"start":3790,"end":3793,"data":"any"},{"start":3793,"end":3813,"data":"void"},{"start":3813,"end":3822,"data":"string"},{"start":3822,"end":3827,"data":"any"},{"start":3827,"end":3828,"data":"string"},{"start":3828,"end":3848,"data":"void"},{"start":3848,"end":3856,"data":"any"},{"start":3856,"end":3860,"data":"() => any"},{"start":3860,"end":3863,"data":"any"},{"start":3863,"end":3878,"data":"void"},{"start":3878,"end":3894,"data":"() => string"},{"start":3894,"end":3901,"data":"() => any"},{"start":3901,"end":3904,"data":"any"},{"start":3904,"end":3905,"data":"() => string"},{"start":3927,"end":3942,"data":"() => string"},{"start":3942,"end":3955,"data":"string"},{"start":3955,"end":3966,"data":"() => string"},{"start":3966,"end":3978,"data":"(argString: string) => void"},{"start":3978,"end":3988,"data":"string[]"},{"start":3988,"end":3994,"data":"string"},{"start":3994,"end":4002,"data":"string[]"},{"start":4002,"end":4012,"data":"(argString: string) => void"},{"start":4012,"end":4032,"data":"string"},{"start":4032,"end":4044,"data":"(argString: string) => void"},{"start":4044,"end":4051,"data":"void"},{"start":4051,"end":4059,"data":"number"},{"start":4059,"end":4062,"data":"bool"},{"start":4062,"end":4075,"data":"any"},{"start":4075,"end":4092,"data":"void"},{"start":4092,"end":4104,"data":"any"},{"start":4104,"end":4108,"data":"() => any"},{"start":4108,"end":4111,"data":"any"},{"start":4111,"end":4131,"data":"void"},{"start":4131,"end":4136,"data":"any"},{"start":4136,"end":4141,"data":"bool"},{"start":4141,"end":4144,"data":"string"},{"start":4144,"end":4165,"data":"void"},{"start":4165,"end":4179,"data":"string"},{"start":4179,"end":4198,"data":"() => string"},{"start":4198,"end":4201,"data":"string"},{"start":4201,"end":4226,"data":"void"},{"start":4226,"end":4243,"data":"any"},{"start":4243,"end":4268,"data":"void"},{"start":4268,"end":4278,"data":"string"},{"start":4278,"end":4285,"data":"any"},{"start":4285,"end":4288,"data":"bool"},{"start":4288,"end":4289,"data":"number"},{"start":4289,"end":4314,"data":"void"},{"start":4314,"end":4318,"data":"string[]"},{"start":4318,"end":4324,"data":"any"},{"start":4324,"end":4334,"data":"string"},{"start":4334,"end":4336,"data":"any"},{"start":4336,"end":4358,"data":"void"},{"start":4358,"end":4374,"data":"string"},{"start":4374,"end":4413,"data":"void"},{"start":4413,"end":4420,"data":"() => any"},{"start":4420,"end":4423,"data":"any"},{"start":4423,"end":4463,"data":"void"},{"start":4463,"end":4470,"data":"() => any"},{"start":4470,"end":4473,"data":"any"},{"start":4473,"end":4491,"data":"void"},{"start":4491,"end":4505,"data":"string"},{"start":4505,"end":4510,"data":"any"},{"start":4510,"end":4511,"data":"string"},{"start":4511,"end":4537,"data":"void"},{"start":4537,"end":4549,"data":"(argString: string) => void"},{"start":4549,"end":4553,"data":"void"},{"start":4553,"end":4563,"data":"string"},{"start":4563,"end":4570,"data":"any"},{"start":4570,"end":4573,"data":"bool"},{"start":4573,"end":4574,"data":"number"},{"start":4574,"end":4591,"data":"void"},{"start":4591,"end":4595,"data":"string[]"},{"start":4595,"end":4601,"data":"any"},{"start":4601,"end":4611,"data":"string"},{"start":4611,"end":4613,"data":"any"},{"start":4613,"end":4624,"data":"void"},{"start":4624,"end":4636,"data":"(argString: string) => void"},{"start":4636,"end":4640,"data":"OptionsParser"},{"start":4640,"end":4646,"data":"(args: string[]) => void"},{"start":4646,"end":4647,"data":"void"},{"start":4647,"end":4651,"data":"string[]"},{"start":4651,"end":4653,"data":"void"},{"start":4653,"end":4660,"data":"(argString: string) => void"},{"start":4660,"end":4668,"data":"new(host: any) => OptionsParser"},{"start":4741,"end":4746,"data":"new(host: any) => OptionsParser"},{"start":4746,"end":4759,"data":"(args: string[]) => void"},{"start":4759,"end":4765,"data":"string[]"},{"start":4765,"end":4771,"data":"string"},{"start":4771,"end":4773,"data":"string[]"},{"start":4773,"end":4786,"data":"(args: string[]) => void"},{"start":4786,"end":4803,"data":"number"},{"start":4803,"end":4815,"data":"(args: string[]) => void"},{"start":4815,"end":4849,"data":"() => string"},{"start":4849,"end":4856,"data":"string"},{"start":4856,"end":4860,"data":"string[]"},{"start":4860,"end":4861,"data":"string"},{"start":4861,"end":4871,"data":"number"},{"start":4871,"end":4873,"data":"string"},{"start":4873,"end":4884,"data":"() => string"},{"start":4884,"end":4896,"data":"(args: string[]) => void"},{"start":4896,"end":4903,"data":"void"},{"start":4903,"end":4911,"data":"number"},{"start":4911,"end":4914,"data":"bool"},{"start":4914,"end":4918,"data":"string[]"},{"start":4918,"end":4925,"data":"any"},{"start":4925,"end":4942,"data":"void"},{"start":4942,"end":4956,"data":"string"},{"start":4956,"end":4963,"data":"() => string"},{"start":4963,"end":4966,"data":"string"},{"start":4966,"end":4980,"data":"void"},{"start":4980,"end":4992,"data":"any"},{"start":4992,"end":4999,"data":"string"},{"start":4999,"end":5025,"data":"any"},{"start":5025,"end":5039,"data":"void"},{"start":5039,"end":5056,"data":"any"},{"start":5056,"end":5076,"data":"void"},{"start":5076,"end":5081,"data":"any"},{"start":5081,"end":5106,"data":"void"},{"start":5106,"end":5112,"data":"any"},{"start":5112,"end":5113,"data":"number"},{"start":5113,"end":5114,"data":"any"},{"start":5114,"end":5119,"data":"bool"},{"start":5119,"end":5122,"data":"string"},{"start":5122,"end":5147,"data":"void"},{"start":5147,"end":5151,"data":"OptionsParser"},{"start":5151,"end":5163,"data":"(argString: string) => void"},{"start":5163,"end":5164,"data":"void"},{"start":5164,"end":5182,"data":"any"},{"start":5182,"end":5183,"data":"number"},{"start":5183,"end":5185,"data":"any"},{"start":5185,"end":5235,"data":"void"},{"start":5235,"end":5251,"data":"any"},{"start":5251,"end":5252,"data":"number"},{"start":5252,"end":5254,"data":"any"},{"start":5254,"end":5276,"data":"void"},{"start":5276,"end":5289,"data":"IOptions"},{"start":5289,"end":5293,"data":"OptionsParser"},{"start":5293,"end":5304,"data":"(arg: string) => IOptions"},{"start":5304,"end":5305,"data":"IOptions"},{"start":5305,"end":5308,"data":"any"},{"start":5308,"end":5310,"data":"IOptions"},{"start":5310,"end":5338,"data":"void"},{"start":5338,"end":5344,"data":"IOptions"},{"start":5344,"end":5349,"data":"bool"},{"start":5349,"end":5353,"data":"any"},{"start":5353,"end":5382,"data":"void"},{"start":5382,"end":5395,"data":"any"},{"start":5395,"end":5415,"data":"string"},{"start":5415,"end":5420,"data":"any"},{"start":5420,"end":5446,"data":"void"},{"start":5446,"end":5459,"data":"any"},{"start":5459,"end":5461,"data":"string"},{"start":5461,"end":5463,"data":"any"},{"start":5463,"end":5489,"data":"void"},{"start":5489,"end":5493,"data":"OptionsParser"},{"start":5493,"end":5504,"data":"() => void"},{"start":5504,"end":5567,"data":"void"},{"start":5567,"end":5568,"data":"bool"},{"start":5568,"end":5574,"data":"IOptions"},{"start":5574,"end":5579,"data":"bool"},{"start":5579,"end":5610,"data":"void"},{"start":5610,"end":5615,"data":"any"},{"start":5615,"end":5618,"data":"string"},{"start":5618,"end":5625,"data":"() => string"},{"start":5625,"end":5627,"data":"any"},{"start":5627,"end":5628,"data":"string"},{"start":5628,"end":5656,"data":"void"},{"start":5656,"end":5662,"data":"IOptions"},{"start":5662,"end":5666,"data":"(s: string) => void"},{"start":5666,"end":5667,"data":"void"},{"start":5667,"end":5672,"data":"any"},{"start":5672,"end":5756,"data":"void"},{"start":5756,"end":5760,"data":"OptionsParser"},{"start":5760,"end":5768,"data":"string[]"},{"start":5768,"end":5774,"data":"any"},{"start":5774,"end":5781,"data":"string"},{"start":5781,"end":5783,"data":"any"},{"start":5783,"end":5809,"data":"void"},{"start":5809,"end":5816,"data":"(args: string[]) => void"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/dumpAST.ts b/tests/cases/unittests/services/dumpAST.ts deleted file mode 100644 index b8db724c1d3..00000000000 --- a/tests/cases/unittests/services/dumpAST.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -DumpAST.compareDumpFilesWithBaseline(); diff --git a/tests/cases/unittests/services/dumpAST/baseline-create.ts b/tests/cases/unittests/services/dumpAST/baseline-create.ts deleted file mode 100644 index 26649664545..00000000000 --- a/tests/cases/unittests/services/dumpAST/baseline-create.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -describe('dumpAST-create-baselines', function() { - describe("create test baseline files for AST source locations", function() { - it("create baseline files", function() { - DumpAST.generateBaselineFiles(); - }); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPosition.ts b/tests/cases/unittests/services/getCompletionsAtPosition.ts deleted file mode 100644 index aa3e771919f..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPosition.ts +++ /dev/null @@ -1,220 +0,0 @@ -/// - -debugger; - -describe('getCompletionsAtPosition', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts'; - var fileName4 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts'; - var fileName5 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts'; - var fileName6 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts'; - var fileName7 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts'; - var fileName8 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts'; - var fileName9 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts'; - var fileName10 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts'; - var fileNameBugFixes = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - typescriptLS.addFile(fileName4); - typescriptLS.addFile(fileName5); - typescriptLS.addFile(fileName6); - typescriptLS.addFile(fileName7); - typescriptLS.addFile(fileName8); - typescriptLS.addFile(fileName9); - typescriptLS.addFile(fileName10); - typescriptLS.addFile(fileNameBugFixes); - - var ls = typescriptLS.getLanguageService(); - - // - // line and column are 1-based - // - function lineColToPosition(fileName: string, line: number, col: number): number { - var script = ls.languageService.getScriptAST(fileName); - assert.notNull(script); - - var lineMap = script.locationInfo.lineMap; - - assert.is(line >= 1); - assert.is(col >= 1); - assert.is(line <= lineMap.length); - var offset = lineMap[line - 1] + (col - 1); - - assert.is(offset < script.limChar); - return offset; - } - - // - // line and column are 1-based - // - function getCompletionList(fileName, line, column, isMemberCompletion) { - var position = lineColToPosition(fileName, line, column); - return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); - } - - describe("test cases for completion list", function () { - - //it("contains a private variable defined in a module", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 45, false); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "testing" && x.type == "string"); - //}); - - //it("'this.' member completion for class containing privates", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 85, true); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "privMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); - //}); - - //it("member completion for class containing privates, outside of class scope", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 203, true); - - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); - //}); - - //it("member completion for module-exported class containing privates, outside of class and module scopes", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 343, true); - // assert.notNull(result); - // assert.notNull(result.entries); - // assert.equal(true, result.isMemberCompletion); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pub" && x.type == "number"); - - //}); - - //it("member completion for dotted typeref works", function () { - // assert.equal(125, lineColToPosition(fileName2, 12, 11)); - // var result = getCompletionList(fileName2, 12, 11, true); - // assert.notEqual(null, result); - // assert.notEqual(null, result.entries); - // assert.equal(true, result.isMemberCompletion); - // assert.equal(2, result.entries.length); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Blah"; }); - //}); - - // Negative Cases - it("doesnt return anything from a comment-1", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-2", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-3", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-4", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("checks for completion in comment", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 1, 4), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - /* - it("checks for completion in var decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 2, 5), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in class decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName4, lineColToPosition(fileName4, 1, 7), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in module decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName5, lineColToPosition(fileName5, 1, 7), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("checks for completion in interface decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName6, lineColToPosition(fileName6, 1, 11), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in function decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName7, lineColToPosition(fileName7, 1, 10), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - */ - - it("checks for completion after single dot", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName8, lineColToPosition(fileName8, 1, 1), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - //it("checks for completion at declaration of parameter type", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 9, 17), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - //}); - - //it("checks for completion after class extends", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 5, 30), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bleah"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Foo"; }); - //}); - - //it("checks for completion at reference to function parameter", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName10, lineColToPosition(fileName10, 4, 31), true); - // assert.equal(result.isMemberCompletion, true); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charAt"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charCodeAt"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "length"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "concat"; }); - //}); - - //it("checks for completion at enum", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 7, 22), true); - // assert.equal(result.isMemberCompletion, true); - // assert.equal(result.entries.length, 2); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); - //}); - - //it("checks for completion at imported enum", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 10, 9), true); - // assert.equal(result.isMemberCompletion, true); - // assert.equal(result.entries.length, 2); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); - //}); - - //it("checks for completion inside target typed function", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 15, 40), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "elem" && item.type === "string"; }); - //}); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts deleted file mode 100644 index e79de723081..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts +++ /dev/null @@ -1,55 +0,0 @@ -/// - -describe('getCompletionsAtPositionAfterEdits', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts'; - var fileName2 = 'otherScript.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addScript(fileName2, typescriptLS.getScriptContent(1)); - - var ls = typescriptLS.getLanguageService(); - - // - // line and column are 1-based - // - function getCompletionList(fileName: string, position: number, isMemberCompletion: boolean): Services.CompletionInfo { - return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); - } - - function typeCharacters(fileName: string, line: number, column: number, text: string): number { - var pos = typescriptLS.lineColToPosition(fileName, line, column); - for (var i = 0; i < text.length; i++) { - typescriptLS.editScript(fileName, pos, pos, text.charAt(i)); - pos++; - } - return pos; - } - - describe("test cases for completion list after edits inside source file", function () { - - it("verify function arguments are available after edits at end of function", function () { - // Apply edit - var pos = typescriptLS.lineColToPosition(fileName, 5, 13); - var text = "this.children = ch"; - typescriptLS.editScript(fileName, pos, pos, text); - var result = getCompletionList(fileName, pos + text.length - 2 /*ch*/, false); - var entry = result.entries.filter(x => x.name == "children"); - assert.notNull(entry); - assert.equal(1, entry.length); - }); - - it("verify function arguments are available after edits at end of function after multiple edits", function () { - // Apply edit - var text = "this.children = ch"; - var pos = typeCharacters(fileName2, 5, 13, text); - var result = getCompletionList(fileName2, pos - 2 /*ch*/, false); - var entry = result.entries.filter(x => x.name == "children"); - assert.notNull(entry); - assert.equal(1, entry.length); - }); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts deleted file mode 100644 index 4e1a35b81c2..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts +++ /dev/null @@ -1,100 +0,0 @@ -///// - -//describe('getCompletionsAtPositionObjectLiterals', function () { -// var typescriptls = new Harness.TypeScriptLS(); - -// typescriptls.addDefaultLibrary(); - -// var fileNameObjectLiterals = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts'; - -// typescriptls.addFile(fileNameObjectLiterals); - -// var ls = typescriptls.getLanguageService(); - -// // -// // line and column are 1-based -// // -// function getCompletionList(fileName: string, line: number, column: number, isMemberCompletion: boolean): Services.CompletionInfo { -// var position = typescriptls.lineColToPosition(fileName, line, column); -// return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); -// } - -// function assertIsMemberCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(result.isMemberCompletion, "isMemberCompletion should be set"); -// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); -// assert.is(result.entries.length == 2, "Completion should contain only 2 members of object literal"); -// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "x1" && x.type == "number"); -// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "y1" && x.type == "number"); -// } - -// function assertIsGlobalCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(!result.isMemberCompletion, "isMemberCompletion should be not be set"); -// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); -// assert.is(result.entries.length >= 10, "Completion should be global completion set"); -// } - -// function assertIsNoCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(result.entries.length == 0, "Completion should be empty (i.e. no completion)"); -// } - -// describe("test cases for completion list inside object literals", function () { -// it("Literal member completion inside empty literal", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion for 2nd member name", function () { -// var result = getCompletionList(fileNameObjectLiterals, 13, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion at existing member name location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 17, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion after existing member name location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 17, 12, false); -// assertIsMemberCompletions(result); -// }); - -// }); - -// describe("test cases for global completion list inside object literals", function () { -// it("Literal member completion after member name with empty member expression and missing colon", function () { -// var result = getCompletionList(fileNameObjectLiterals, 27, 13, false); -// assertIsGlobalCompletions(result); - -// var result = getCompletionList(fileNameObjectLiterals, 28, 5, false); -// assertIsGlobalCompletions(result); -// }); - -// it("Literal member completion after member name with empty member expression", function () { -// var result = getCompletionList(fileNameObjectLiterals, 31, 13, false); -// assertIsGlobalCompletions(result); - -// var result = getCompletionList(fileNameObjectLiterals, 31, 22, false); -// assertIsGlobalCompletions(result); -// }); - -// it("No completion on '{' location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 7, 23, false); -// assertIsGlobalCompletions(result); -// }); -// }); - -// describe("test cases for no completion list inside object literals", function () { -// it("No completion on comments (1)", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 12, false); -// assertIsNoCompletions(result); -// }); - -// it("No completion on comments (2)", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 18, false); -// assertIsNoCompletions(result); -// }); -// }); -//}); diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts b/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts deleted file mode 100644 index d9291ed821f..00000000000 --- a/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts +++ /dev/null @@ -1,193 +0,0 @@ -/// - -describe('getDefinitionPositionAtPosition', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - - var ls = typescriptLS.getLanguageService(); - - function lineToOffset(line: number, col = 0, sFile?) { - var script: TypeScript.Script; - if (sFile) { - if (sFile === 1){ - script = ls.languageService.getScriptAST(fileName); - } else if (sFile === 2) { - script = ls.languageService.getScriptAST(fileName2); - } else if (sFile === 3){ - script = ls.languageService.getScriptAST(fileName3); - } - } - else { - script = ls.languageService.getScriptAST(fileName); - } - return script.locationInfo.lineMap[line - 1] + col; - } - - function definitionAtPos(line: number, col: number) { - var result = ls.getDefinitionAtPosition(fileName, lineToOffset(line, col)); - if (result.substr(0,9) === "##ERROR##") { - return null; - } - var parts = result.split('\t'); - var defScriptIndex = parts[0]; - var defPosition = parts[1]; - return { index : defScriptIndex, pos : defPosition } - } - - function verifyDefinition(indexAndPos: {index: string; pos: string;}, line: number, col: number, fileNum: number) { - if (indexAndPos.index !== fileNum.toString()) { - throw new Error("Expected file index to be " + fileNum + " but it was " + indexAndPos.index + " instead."); - } - if (indexAndPos.pos!== lineToOffset(line, col, fileNum).toString()) { - throw new Error("Expected offset to be " + lineToOffset(line, col, fileNum).toString() + " but it was " + indexAndPos.pos + " instead."); - } - } - - describe('GoTo Definition', function() { - /* - LOCAL - */ - - it("A variable that is defined in the same file", function() { - var indexAndPos = definitionAtPos(8, 0); - verifyDefinition(indexAndPos, 2, 0, 1); - }); - - it("A function that is defined in the same file", function() { - var indexAndPos = definitionAtPos(9, 0); - verifyDefinition(indexAndPos, 3, 0, 1); - }); - - it("A class that is defined in the same file", function() { - var indexAndPos = definitionAtPos(10, 16); - verifyDefinition(indexAndPos, 4, 0, 1); - }); - - it("An interface that is defined in the same file", function() { - var indexAndPos = definitionAtPos(11, 26); - verifyDefinition(indexAndPos, 5, 0, 1); - }); - - it("A module that is defined in the same file", function() { - var indexAndPos = definitionAtPos(12, 15); - verifyDefinition(indexAndPos, 6, 0, 1); - }); - - /* - REMOTE - */ - - it("A variable that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(14, 0); - verifyDefinition(indexAndPos, 2, 0, 2); - }); - - it("A function that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(15, 0); - verifyDefinition(indexAndPos, 3, 0, 2); - }); - - it("A class that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(16, 19); - verifyDefinition(indexAndPos, 4, 0, 2); - }); - - it("An interface that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(17, 29); - verifyDefinition(indexAndPos, 5, 0, 2); - }); - - it("A module that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(18, 18); - verifyDefinition(indexAndPos, 6, 0, 2); - }); - - /* - REMOTE -> REMOTE - */ - - it("A variable that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(20, 0); - verifyDefinition(indexAndPos, 1, 0, 3); - }); - - it("A function that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(21, 0); - verifyDefinition(indexAndPos, 2, 0, 3); - }); - - it("A class that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(22, 19); - verifyDefinition(indexAndPos, 3, 0, 3); - }); - - it("An interface that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(23, 29); - verifyDefinition(indexAndPos, 4, 0, 3); - }); - - it("A module that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(24, 18); - verifyDefinition(indexAndPos, 5, 0, 3); - }); - - /* - Others - */ - - it("A shadowed variable inside a module", function() { - var indexAndPos = definitionAtPos(29, 6); - verifyDefinition(indexAndPos, 28, 4, 1); - }); - - it("A function being overloaded on global - 1", function() { - var indexAndPos = definitionAtPos(32, 9); - verifyDefinition(indexAndPos, 34, 0, 1); - }); - - it("A function being overloaded on global - 2", function() { - var indexAndPos = definitionAtPos(36, 0); - verifyDefinition(indexAndPos, 34, 0, 1); - }); - - it("Constructor being overloaded in class", function() { - var indexAndPos = definitionAtPos(40, 4); - verifyDefinition(indexAndPos, 42, 4, 1); - }); - - it("A function being overloaded in class - 1", function() { - var indexAndPos = definitionAtPos(52, 11); - verifyDefinition(indexAndPos, 54, 4, 1); - }); - - it("A static function being overloaded in class - 1", function() { - var indexAndPos = definitionAtPos(50, 11); - verifyDefinition(indexAndPos, 51, 4, 1); - }); - - it("Calling a static function of a class", function() { - var indexAndPos = definitionAtPos(63, 19); - verifyDefinition(indexAndPos, 51, 4, 1); - }); - - it("A class implementing an interface", function() { - var indexAndPos = definitionAtPos(83, 24); - verifyDefinition(indexAndPos, 78, 0, 1); - }); - - it("An ambient variable", function() { - var indexAndPos = definitionAtPos(91, 0); - verifyDefinition(indexAndPos, 89, 0, 1); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts b/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts deleted file mode 100644 index ca22c326aab..00000000000 --- a/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// - -describe('getDefinitionPositionAtPositionPartialInterface', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - - var ls = typescriptLS.getLanguageService() - function definitionAtPos(fileName:string, line: number, col: number) { - return ls.languageService.getDefinitionAtPosition(fileName, typescriptLS.lineColToPosition(fileName, line, col)); - } - - describe('GoTo Definition', function() { - it("returns the location of the first part of a partial interface", function() { - var def = definitionAtPos(fileName2, 8, 13); - assert.notNull(def); - assert.equal(def.unitIndex, 1); - assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).line + 1, 2); - assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).col + 1, 5); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getImplementorsAtPosition.ts b/tests/cases/unittests/services/getImplementorsAtPosition.ts deleted file mode 100644 index 748e1f6f1f9..00000000000 --- a/tests/cases/unittests/services/getImplementorsAtPosition.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// - -describe('getImplementorsAtPosition', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts'; - - typescriptLS.addFile(fileName); - - var ls = typescriptLS.getLanguageService(); - - - function getImplementorsAtPos(fileName:string, line: number, col: number): Services.ReferenceEntry[] { - var pos = typescriptLS.lineColToPosition(fileName, line, col); - - return ls.languageService.getImplementorsAtPosition(fileName, pos); - } - - describe('Get Implementors At Position Simple Tests', function () { - it("Find derived class from base class", function() { - var result = getImplementorsAtPos(fileName, 2, 12); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base class from derived class", function() { - var result = getImplementorsAtPos(fileName, 6, 12); - assert.notNull(result); - assert.equal(1, result.length); - }); - - it("Find derived interface from base interface", function() { - var result = getImplementorsAtPos(fileName, 13, 16); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base interface from derived interface", function() { - var result = getImplementorsAtPos(fileName, 16, 16); - assert.notNull(result); - assert.equal(1, result.length); - }); - - it("Find dervied class from base interface", function() { - var result = getImplementorsAtPos(fileName, 22, 16); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base interface from derived class", function() { - var result = getImplementorsAtPos(fileName, 25, 12); - assert.notNull(result); - assert.equal(1, result.length); - }); - }); - - describe('Get Implementors At Position Complex Tests', function () { - it("Find derived classes and interfaces from top level interface", function() { - var result = getImplementorsAtPos(fileName, 32, 17); - assert.notNull(result); - assert.equal(6, result.length); - }); - - it("Find derived classes and interfaces from middle interface", function() { - var result = getImplementorsAtPos(fileName, 41, 18); - assert.notNull(result); - assert.equal(4, result.length); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getReferencesAtPosition.ts b/tests/cases/unittests/services/getReferencesAtPosition.ts deleted file mode 100644 index 1f3645c2046..00000000000 --- a/tests/cases/unittests/services/getReferencesAtPosition.ts +++ /dev/null @@ -1,188 +0,0 @@ -/// - -debugger; - -describe('getReferencesAtPosition', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName1 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts'; - var fileName4 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts'; - - typescriptLS.addFile(fileName1); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - typescriptLS.addFile(fileName4); - - var ls = typescriptLS.getLanguageService(); - - // Returns the offset corresponding to the line + column given - function lineToOffset(line: number, col = 0, fileName?: string = fileName1) { - var script: TypeScript.Script = ls.languageService.getScriptAST(fileName); - return script.locationInfo.lineMap[line - 1] + col; - } - - describe("local get references", function() { - - it("finds references to comment", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(2, 25)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to type", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 15)); - var count = 0; - // Filter out the lib.d.ts - var items = result.split("\n"); - for (var i = 0; i < items.length; i++) { - if (items[i].split(" ")[0] !== "0") { - count++; - } - } - assert.equal(10, count); - }); - - it("find references to a variable declared in global", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 4)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(8, 8)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to static variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(6, 16)); - assert.equal(7, result.split("\n").length); - }); - - it("find references to a variable declared in a function", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(22, 8)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to a class parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(15, 17)); - assert.equal(2, result.split("\n").length); - }); - - it("find references to a function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(20, 14)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to a function argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(66, 8)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a class argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(65, 29)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to illegal assignment", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(75, 0)); - assert.equal(8, result.split("\n").length); - }); - - it("find references to unresolved symbol", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(76, 0)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to no context", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(77, 0)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to shadowed function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(79, 20)); - assert.equal(4, result.split("\n").length); - }); - - it("find reference misses function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(115, 11)); - assert.equal(3, result.split("\n").length); - }); - }); - - describe("remote get references", function() { - it("find references to a variable declared in global", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(96, 0)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a type", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(87, 23)); - assert.equal(9, result.split("\n").length); - }); - - it("find references to a function argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(91, 19)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a class argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(90, 43)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName2, lineToOffset(5, 8, fileName2)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to static variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName2, lineToOffset(6, 11, fileName2)); - assert.equal(7, result.split("\n").length); - }); - }); - - describe("get references for overrides", function() { - it("find references to a field declared in a base class", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(62, 11, fileName3)); - assert.equal(3, result.length); - }); - - it("find references to a field declared in a base interface", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(65, 11, fileName3)); - assert.equal(3, result.length); - }); - - it("find references to a field declared in a chain of base class and interfaces", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(68, 11, fileName3)); - assert.equal(6, result.length); - }); - }); - - describe("get references for statics with same names as members", function() { - it("find references to a member method with the same name as a static", function() { - /* public foo(): void */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(7, 21, fileName4)); - assert.equal(3, result.length); - }); - - it("find references to a static method with the same name as a member", function() { - /* public static foo(): void */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(9, 28, fileName4)); - assert.equal(2, result.length); - }); - - it("find references to a member property with the same name as a static", function() { - /* bar: Foo */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(4, 14, fileName4)); - assert.equal(3, result.length); - }); - - it("find references to a static property with the same name as a member", function() { - /* static bar: Foo */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(5, 21, fileName4)); - assert.equal(2, result.length); - }); - }); -}); diff --git a/tests/cases/unittests/services/getReferencesAtPosition2.ts b/tests/cases/unittests/services/getReferencesAtPosition2.ts deleted file mode 100644 index 4a0eb2ab1ac..00000000000 --- a/tests/cases/unittests/services/getReferencesAtPosition2.ts +++ /dev/null @@ -1,235 +0,0 @@ -/// - -function testFileForReferenceHighlighting(filename: string, expectedMissingCount ?= 0, expectedExtraCount ?= 0) { - describe( - 'The file ' + filename + ' has ' + expectedMissingCount + ' missing reference highlights and ' + expectedExtraCount + ' extra reference highlights', - function(filename: string, expectedMissingCount: number, expectedExtraCount: number) { - return function() { - validateReferencesFile(filename, expectedMissingCount, expectedExtraCount); - } - }(filename, expectedMissingCount, expectedExtraCount) - ); -} - -function validateReferencesFile(filename: string, expectedMissingCount: number, expectedExtraCount: number) { - var __typescriptLS = new Harness.TypeScriptLS(); - - // Read the input file and split it apart into sub-files - var testFile = IO.readFile(filename); - var testFileParts = splitFile(testFile); - - var testFileNames: string[] = []; - var testFileContents: string[] = []; - - // For each sub-file, add it to the project and collect its spans - var spans: Span[] = []; - var caretPositions: Span[] = []; - var i; - for(i = 0; i < testFileParts.length; i++) { - var partSpans: Span[] = []; - var partCarets: Span[] = []; - var transformedCode = extractCodeSpans(testFileParts[i], partSpans, partCarets); - - partSpans.forEach(function(sp) { - sp.fileIndex = i; - spans.push(sp); - }); - - partCarets.forEach(function(sp) { - sp.fileIndex = i; - caretPositions.push(sp); - }); - - var tempFilename = 'tempFile' + i + '.ts'; - testFileNames.push(tempFilename); - testFileContents.push(transformedCode); - __typescriptLS.addScript(tempFilename , transformedCode); - } - - // Be sure to do this last so file indices don't get off-by-n'd by the default library - __typescriptLS.addDefaultLibrary(); - testFileContents.push(Harness.Compiler.libText); - - // If there's no caret position, someone screwed up the test authoring - if(caretPositions.length === 0) { - throw new Error('No caret positions in ' + filename + ' - did you forget to add some?'); - } - - var __ls = __typescriptLS.getLanguageService(); - - for(var caretIndex = 0; caretIndex < caretPositions.length; caretIndex++) { - var caret = caretPositions[caretIndex]; - describe('Returns the correct references at caret position = ' + caret, function() { - var references = __ls.getReferencesAtPosition(testFileNames[caret.fileIndex], caret.start); - var referencesList = Span.fromReferenceLines(references); - referencesList.forEach(function(rf) { rf.getContent(testFileContents); }); - - var diff = diffLists(spans, referencesList, function(s1, s2) { return s1.equals(s2); }); - if(expectedExtraCount === 0) { - it('Has no extra highlights', function() { - assert.equal('', diff.extraItems.join(', ')); - }); - } else { - it('Has ' + expectedExtraCount + ' extra highlights', function() { - assert.equal(expectedExtraCount, diff.extraItems.length); - }); - } - - if(expectedMissingCount === 0) { - it('Has no missing highlights', function() { - assert.equal('', diff.missingItems.join(', ')); - }); - } else { - it('Has ' + expectedMissingCount + ' missing highlights', function() { - assert.equal(expectedMissingCount, diff.missingItems.length); - }); - } - }); - } -} - -interface ListDiffResult { - areIdentical: boolean; - extraItems: any[]; - missingItems: any[]; -} - -function diffLists(expected: any[], actual: any[], equals: (expct: any, actl: any) => boolean) : ListDiffResult { - var result = { areIdentical: false, extraItems: actual.slice(0), missingItems: expected.slice(0) }; - - var i, j; - for(i = 0; i < result.extraItems.length; i++) { - for(j = 0; j < result.missingItems.length; j++) { - if(equals(result.missingItems[j], result.extraItems[i])) { - result.extraItems.splice(i, 1); - result.missingItems.splice(j, 1); - i--; - break; - } - } - } - - result.areIdentical = result.extraItems.length === 0 && result.missingItems.length === 0; - return result; -} - -class Span { - constructor (public start: number, public length: number, public content: string) { } - - public fileIndex: number = null; - - public getContent(fileContents: string[]) { - this.content = fileContents[this.fileIndex].substr(this.start, this.length); - } - - static fromReferenceLine(line: string): Span { - var parts = line.split(' '); - var fileNumber = parseInt(parts[0]); - var start = parseInt(parts[1]); - var end = parseInt(parts[2]); - - var result = new Span(start, end - start, ""); - result.fileIndex = fileNumber; - return result; - } - - static fromReferenceLines(lines: string): Span[] { - var result: Span[] = []; - lines.split('\n').forEach(function(ln: string) { - if(ln) { - result.push(fromReferenceLine(ln)); - } - }); - return result; - } - - public toString(): string { - return '[File = ' + this.fileIndex + ', Start = ' + this.start + ', Length = ' + this.length + ', Content = "' + this.content + '"]'; - } - - public equals(other: Span) { - if(!other) return false; - // Don't check 'content' as that won't be populated in all cases (it's only for diagnostic purposes) - return other.start === this.start && - other.length === this.length && - other.fileIndex === this.fileIndex; - } -} - -function splitFile(contents: string): string[] { - var delimiterChar = '='; - var delimiterStr = delimiterChar + delimiterChar + delimiterChar + delimiterChar; - - var result: string[] = []; - - while(true) { - var delimIndex = contents.indexOf(delimiterStr); - if(delimIndex === -1) { - result.push(contents); - break; - } else { - result.push(contents.substr(0, delimIndex - 1)); - while(contents.charAt(delimIndex) === delimiterChar) { - delimIndex++; - } - contents = contents.substr(delimIndex); - } - } - - return result; -} - -function extractCodeSpans(code: string, outputSpans: Span[], caretPositions: Span[]): string { - var startTag = '[|'; - var endTag = '|]'; - var caretMarker = '^^'; - var result = code; - while(true) { - var caretIndex = result.indexOf(caretMarker); - var tagStartIndex = result.indexOf(startTag); - if(tagStartIndex === -1 && caretIndex === -1) break; // No more matches - - if(tagStartIndex != -1 && ((tagStartIndex < caretIndex) || (caretIndex === -1))) { - // Tag series is first - var tagEndIndex = result.indexOf(endTag, tagStartIndex + tagStartIndex.length); - if(tagEndIndex === -1) throw new Error('Unbalanced ' + startTag + '/' + endTag + ' pairs - expected to find a ' + startTag); - - var interiorStart = tagStartIndex + startTag.length; - var content = result.substr(interiorStart, tagEndIndex - interiorStart); - var contentCaretIndex = content.indexOf(caretMarker); - // Need to handle the case where there are caret[s] inside the tag markers - while(contentCaretIndex != -1) { - caretPositions.push(new Span(contentCaretIndex + tagStartIndex, 0, '')); - content = content.substring(0, contentCaretIndex) + content.substring(contentCaretIndex + caretMarker.length); - contentCaretIndex = content.indexOf(caretMarker); - } - - outputSpans.push(new Span(tagStartIndex, content.length, content)); - result = result.substr(0, tagStartIndex) + content + result.substr(tagEndIndex + endTag.length); - } else { - // Cursor marker is first - caretPositions.push(new Span(caretIndex, 0, '')); - result = result.substr(0, caretIndex) + result.substr(caretIndex + caretMarker.length); - } - } - - return result; -} - -var refFile = function(fn) { return Harness.userSpecifiedroot + 'tests/cases/unittests/services/testCode/references/' + fn; }; - -testFileForReferenceHighlighting(refFile('classLocal.ts')); - -testFileForReferenceHighlighting(refFile('classParameter.ts')); - -testFileForReferenceHighlighting(refFile('comment.ts')); - -testFileForReferenceHighlighting(refFile('functionOverloads.ts')); -testFileForReferenceHighlighting(refFile('functionParameter.ts')); - -testFileForReferenceHighlighting(refFile('illegalAssignment1.ts')); -testFileForReferenceHighlighting(refFile('illegalAssignment2.ts')); - -testFileForReferenceHighlighting(refFile('noContext.ts')); -testFileForReferenceHighlighting(refFile('referenceToClass.ts')); -testFileForReferenceHighlighting(refFile('static.ts')); diff --git a/tests/cases/unittests/services/getScriptLexicalStructure.ts b/tests/cases/unittests/services/getScriptLexicalStructure.ts deleted file mode 100644 index a9a449d6bf0..00000000000 --- a/tests/cases/unittests/services/getScriptLexicalStructure.ts +++ /dev/null @@ -1,904 +0,0 @@ -/// -describe('getScriptLexicalStructure', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts'; - - typescriptLS.addFile(fileName); - - var __ls = typescriptLS.getLanguageService(); - - - function getScriptLexicalStructure(fileName: string): Services.NavigateToItem[] { - return __ls.languageService.getScriptLexicalStructure(fileName); - } - - describe('Get script lexical structure', function () { - it("Cover all kinds of structure elements", function () { - var result = getScriptLexicalStructure(fileName); - - // Note: This baseline can be easily regenerated by taking the output of the test - // resulting from the call to "assert.equal" below. - var baseline = -[ - { - "name": "Bar", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 0, - "limChar": 1501, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 47, - "limChar": 61, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 92, - "limChar": 114, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 139, - "limChar": 411, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 165, - "limChar": 183, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 212, - "limChar": 225, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 264, - "limChar": 284, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 312, - "limChar": 324, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 363, - "limChar": 375, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 419, - "limChar": 491, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 440, - "limChar": 447, - "containerName": "Bar.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 499, - "limChar": 1498, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 520, - "limChar": 556, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 532, - "limChar": 551, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 597, - "limChar": 620, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 672, - "limChar": 702, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 747, - "limChar": 775, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 822, - "limChar": 844, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 899, - "limChar": 924, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 974, - "limChar": 1006, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1049, - "limChar": 1079, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1124, - "limChar": 1148, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1201, - "limChar": 1220, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1276, - "limChar": 1298, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1351, - "limChar": 1378, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1426, - "limChar": 1447, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "Bar2", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1505, - "limChar": 3051, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1560, - "limChar": 1581, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1613, - "limChar": 1642, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1668, - "limChar": 1947, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1701, - "limChar": 1719, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1748, - "limChar": 1761, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1800, - "limChar": 1820, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1848, - "limChar": 1860, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1899, - "limChar": 1911, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1955, - "limChar": 2034, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1983, - "limChar": 1990, - "containerName": "Bar2.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2042, - "limChar": 3048, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2070, - "limChar": 2106, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2082, - "limChar": 2101, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2147, - "limChar": 2170, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2222, - "limChar": 2252, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2297, - "limChar": 2325, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2372, - "limChar": 2394, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2449, - "limChar": 2474, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2524, - "limChar": 2556, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2599, - "limChar": 2629, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2674, - "limChar": 2698, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2751, - "limChar": 2770, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2826, - "limChar": 2848, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2901, - "limChar": 2928, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2976, - "limChar": 2997, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "Bar3", - "kind": "module", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3057, - "limChar": 3083, - "containerName": "", - "containerKind": "" - }, - { - "name": "Bar4", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3087, - "limChar": 4611, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3134, - "limChar": 3156, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3179, - "limChar": 3206, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3226, - "limChar": 3506, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3260, - "limChar": 3278, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3307, - "limChar": 3320, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3359, - "limChar": 3379, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3407, - "limChar": 3419, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3458, - "limChar": 3470, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3514, - "limChar": 3594, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3543, - "limChar": 3550, - "containerName": "Bar4.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3602, - "limChar": 4608, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3631, - "limChar": 3665, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3644, - "limChar": 3663, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3707, - "limChar": 3730, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3782, - "limChar": 3809, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3857, - "limChar": 3882, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3932, - "limChar": 3951, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4009, - "limChar": 4034, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4084, - "limChar": 4113, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4159, - "limChar": 4186, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4234, - "limChar": 4255, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4311, - "limChar": 4330, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4386, - "limChar": 4405, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4461, - "limChar": 4485, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4536, - "limChar": 4554, - "containerName": "Bar4.Bar", - "containerKind": "class" - } -]; - var baselineText = JSON.stringify(baseline, null, " "); - var resultText = JSON.stringify(result, null, " "); - assert.notNull(result); - assert.equal(79, result.length); - assert.equal(baselineText, resultText); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getSignatureAtPosition.ts b/tests/cases/unittests/services/getSignatureAtPosition.ts deleted file mode 100644 index 72bbf8ba657..00000000000 --- a/tests/cases/unittests/services/getSignatureAtPosition.ts +++ /dev/null @@ -1,493 +0,0 @@ -/// - -describe('getSignatureAtPosition', function () { - var mytypescriptLS = new Harness.TypeScriptLS(); - - mytypescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts'; - - mytypescriptLS.addFile(fileName); - mytypescriptLS.addFile(fileName2); - - var myls = mytypescriptLS.getLanguageService(); - - function singatureAtPos(line: number, col: number): Services.SignatureInfo { - return myls.languageService.getSignatureAtPosition(fileName, mytypescriptLS.lineColToPosition(fileName, line, col)); - } - - function singatureAtPos2(line: number, col: number): Services.SignatureInfo { - return myls.languageService.getSignatureAtPosition(fileName2, mytypescriptLS.lineColToPosition(fileName2, line, col)); - } - - describe('Get signatures from position', function () { - it("Comment", function () { - var result = singatureAtPos(1, 4); - assert.equal(null, result); - }); - - it("No Context", function () { - var result = singatureAtPos(2, 1); - assert.equal(null, result); - }); - - it("Construct expression", function () { - var result = singatureAtPos(3, 23); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("sampleCls", formal.name); - assert.equal(1, formal.signatureGroup.length); - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("str", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("num", formal.signatureGroup[0].parameters[1].name); - assert.equal("number", formal.signatureGroup[0].parameters[1].type); - assert.equal("sampleCls", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 22), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 29), actual.closeParenLimChar); - assert.equal(2, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 23), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 25), actual.parameters[0].limChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 27), actual.parameters[1].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 28), actual.parameters[1].limChar); - - assert.equal(0, result.activeFormal); - }); - - it("Wrong context", function () { - var result = singatureAtPos(4, 11); - assert.equal(null, result); - }); - - it("Call expression", function () { - var result = singatureAtPos(7, 8); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnTest", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("str", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("num", formal.signatureGroup[0].parameters[1].name); - assert.equal("number", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 7), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 9), actual.closeParenLimChar); - assert.equal(0, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Overloaded function", function () { - var result = singatureAtPos(11, 12); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("any", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("any", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 11), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 13), actual.closeParenLimChar); - assert.equal(0, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Overloaded function 2", function () { - var result = singatureAtPos(12, 12); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("any", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("any", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 11), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 15), actual.closeParenLimChar); - assert.equal(1, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 12), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 14), actual.parameters[0].limChar); - - assert.equal(1, result.activeFormal); - }); - - it("Overloaded construct - before open paren", function () { - var result = singatureAtPos(15, 24); - assert.equal(null, result); - }); - - it("Overloaded construct - after close paren", function () { - var result = singatureAtPos(15, 26); - assert.equal(null, result); - }); - - it("Overloaded construct", function () { - var result = singatureAtPos(15, 25); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("clsOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("clsOverload", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("clsOverload", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 24), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 26), actual.closeParenLimChar); - - assert.equal(0, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Overloaded construct: call second overload", function () { - var result = singatureAtPos(16, 25); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("clsOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("clsOverload", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("clsOverload", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 24), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 28), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 25), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 27), actual.parameters[0].limChar); - - assert.equal(1, result.activeFormal); - }); - - it("Incomplete call (with statements after the incomple call)", function () { - var result = singatureAtPos(31, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f1", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 31, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Incomplete call 2 (inside another incomplete call)", function () { - var result = singatureAtPos(32, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f2", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("n", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 32, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Incomplete call 3 (close curly after incomplete call)", function () { - var result = singatureAtPos(33, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f3", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("n", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("s", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 33, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a parameter function", function () { - var result = singatureAtPos(44, 22); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("callback", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 21), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 28), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a returned function", function () { - var result = singatureAtPos(53, 15); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 14), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 21), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a object literal property function", function () { - var result = singatureAtPos(58, 9); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 8), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 15), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off super constructor", function() { - var result = singatureAtPos(69, 19); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("base", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("s", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("base", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("n", formal.signatureGroup[1].parameters[0].name); - assert.equal("number", formal.signatureGroup[1].parameters[0].type); - assert.equal("base", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 18), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 22), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(0, result.activeFormal); - }); - - it("Calling off super of super constructor", function() { - var result = singatureAtPos(79, 19); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("B2", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("s", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("B2", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("n", formal.signatureGroup[1].parameters[0].name); - assert.equal("number", formal.signatureGroup[1].parameters[0].type); - assert.equal("B2", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 18), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 22), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(0, result.activeFormal); - }); - }); - - describe('Get signatures at EOF', function () { - it("Function signature at EOF", function () { - var result = singatureAtPos2(5, 5); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("Foo", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("arg1", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("arg2", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 4), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 5), actual.closeParenLimChar); - assert.equal(0, actual.currentParameter); - - assert.equal(1, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/incrementalParser.ts b/tests/cases/unittests/services/incrementalParser.ts deleted file mode 100644 index 2cb20b0c9f2..00000000000 --- a/tests/cases/unittests/services/incrementalParser.ts +++ /dev/null @@ -1,103 +0,0 @@ -/// - -module IncrementalParserTest { - export class State { - private fileName: string; - private typescriptLS: Harness.TypeScriptLS; - private ls: Services.ILanguageServiceShim; - private logger: TypeScript.BufferedLogger; - private parser: TypeScript.IncrementalParser; - private script: TypeScript.Script; - private newSourceText: TypeScript.IScriptSnapshot; - - public applyEditInRange(fileName, startLine, startCol, endLine, endCol, newText) { - this.initFileName(fileName); - - var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); - if (result === null) { - var sep = "\r\n | "; - throw new Error("Incremental parser should not have bailed out:" + sep + this.logger.logContents.join(sep)); - } - - this.assertTreesAreEqual(result); - } - - public assertBailout(fileName, startLine, startCol, endLine, endCol, newText) { - this.initFileName(fileName); - var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); - assert.is(result == null, "Incremental parser should have bailed out"); - } - - private applyIncrementalParser(startLine, startCol, endLine, endCol, newText): TypeScript.UpdateUnitResult { - var fileName = this.fileName; - var offset1 = this.typescriptLS.lineColToPosition(fileName, startLine, startCol); - var offset2 = this.typescriptLS.lineColToPosition(fileName, endLine, endCol); - var textEdit = new Services.TextEdit(offset1, offset2, newText); - var newContent = this.typescriptLS.applyEdits(this.typescriptLS.getScriptContent(1), [textEdit]); - this.newSourceText = new TypeScript.StringScriptSnapshot(newContent); - - var result = this.parser.attemptIncrementalUpdateUnit(this.script, fileName, this.newSourceText, - new TypeScript.TextChangeRange(TypeScript.TextSpan.fromBounds(offset1, offset2), newText.length)); - return result; - } - - private initFileName(fileName: string) { - this.fileName = fileName; - this.typescriptLS = this.createLS(fileName); - this.ls = this.typescriptLS.getLanguageService(); - this.logger = new TypeScript.BufferedLogger(); - this.parser = new TypeScript.IncrementalParser(this.logger); - this.script = this.ls.languageService.getScriptAST(fileName); - assert.notNull(this.script); - } - - private assertTreesAreEqual(result: TypeScript.UpdateUnitResult) { - assert.notNull(result); - this.parser.mergeTrees(result); - - var finalScript = result.script1; - var nonIncrementalScript = this.typescriptLS.parseSourceText(this.fileName, this.newSourceText); - - var logger1 = new TypeScript.BufferedLogger(); - var astLogger1 = new TypeScript.AstLogger(logger1); - astLogger1.logScript(finalScript); - - var logger2 = new TypeScript.BufferedLogger(); - var astLogger2 = new TypeScript.AstLogger(logger2); - astLogger2.logScript(nonIncrementalScript); - - var log1 = logger1.logContents.join("\r\n"); - var log2 = logger2.logContents.join("\r\n"); - - assert.noDiff(log1, log2); - } - - private createLS(fileName: string): Harness.TypeScriptLS { - var typescriptLS = new Harness.TypeScriptLS(); - typescriptLS.addDefaultLibrary(); - typescriptLS.addFile(fileName); - return typescriptLS; - } - } -} - -describe('incrementalParser tests', function () { - var fileName = 'tests/cases/unittests/services/testCode/incrementalParser.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/incrementalParser2.ts'; - - - describe('Incremental edits to unit', function () { - it("Simple delete inside a function should be incremental", function () { - new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 39, ""); - }); - it("Simple insert inside a function should be incremental", function () { - new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 6, "test-test-test"); - }); - }); - - describe('Bail out tests', function () { - it("Adding semicolon at end of interface function should force bailout", function () { - new IncrementalParserTest.State().assertBailout(fileName2, 4, 16, 4, 16, ";"); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/overridesCollector.ts b/tests/cases/unittests/services/overridesCollector.ts deleted file mode 100644 index 13251f5df66..00000000000 --- a/tests/cases/unittests/services/overridesCollector.ts +++ /dev/null @@ -1,82 +0,0 @@ -/// - -describe('overridesCollector', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/overridesCollector.ts'; - - typescriptLS.addFile(fileName); - - var ls = typescriptLS.getLanguageService(); - - - function getOverridesAtPos(fileName:string, line: number, col: number): Services.SymbolSet { - var pos = typescriptLS.lineColToPosition(fileName, line, col); - - var script = ls.languageService.getScriptAST(fileName); - assert.notNull(script); - - var sym = ls.languageService.getSymbolAtPosition(script, pos); - assert.notNull(sym); - - var symbolTree = ls.languageService.getSymbolTree(); - assert.notNull(symbolTree); - - var collector = new Services.OverridesCollector(symbolTree); - return collector.findMemberOverrides(sym); - } - - describe('Overrides Collector Simple Tests', function () { - it("Find method override from base class", function() { - var result = getOverridesAtPos(fileName, 3, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from derived class", function() { - var result = getOverridesAtPos(fileName, 7, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from derived interface", function() { - var result = getOverridesAtPos(fileName, 17, 10); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from base interface", function() { - var result = getOverridesAtPos(fileName, 14, 10); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find interface method override from derived class", function() { - var result = getOverridesAtPos(fileName, 26, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find interface method override from base interface", function() { - var result = getOverridesAtPos(fileName, 23, 11); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - }); - describe('Overrides Collector Complex Tests', function () { - it("Find field override in deep hierarchy", function() { - var result = getOverridesAtPos(fileName, 42, 12); - assert.notNull(result); - assert.equal(5, result.getAll().length); - }); - - it("Find method override in deep hierarchy", function() { - var result = getOverridesAtPos(fileName, 46, 13); - assert.notNull(result); - assert.equal(3, result.getAll().length); - }); - }); -}); - diff --git a/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts b/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts deleted file mode 100644 index 92be52aa947..00000000000 --- a/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts +++ /dev/null @@ -1,27 +0,0 @@ -module Foo { - class Bar { - private f() { - var a:any[] = [[1, 2], [3, 4], 5]; - return ((1 + 1)); - } - - private f2() { - if(true) { }{ }; - } - } -} - - -// { } -// ( ) -// [ ] -// < > - -class TemplateTest { - public foo(a, b) { - return a; - } - public bar(a, b) { - return a < b || a > b; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts deleted file mode 100644 index 41e46ea0628..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts +++ /dev/null @@ -1,23 +0,0 @@ -module Foo { var testing = ""; test } - -class C1 { - public pubMeth() {this.} // test on 'this.' - private privMeth() {} - public pubProp = 0; - private privProp = 0; -} - -var f = new C1(); -f. // test on F. -module M { - export class C { public pub = 0; private priv = 1; } - export var V = 0; -} - - -var c = new M.C(); - -c. // test on c. - -//Test for comment -//c. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts deleted file mode 100644 index 478027ee2ca..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts +++ /dev/null @@ -1,5 +0,0 @@ -module Test10 -{ - var x: string[] = []; - x.forEach(function(y) { y. }); -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts deleted file mode 100644 index 9cad47b6d6e..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts +++ /dev/null @@ -1,12 +0,0 @@ -module Foo { - export class Bar { - - } - - - export module Blah { - - } -} - -var x:Foo. diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts deleted file mode 100644 index d1416fad86f..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts +++ /dev/null @@ -1,2 +0,0 @@ -// -var \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts deleted file mode 100644 index 56150d40069..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts +++ /dev/null @@ -1,4 +0,0 @@ -class -{ - -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts deleted file mode 100644 index a5a89ed024d..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts +++ /dev/null @@ -1,3 +0,0 @@ -module -{ -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts deleted file mode 100644 index 29a9a9d3b14..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts +++ /dev/null @@ -1 +0,0 @@ -interface \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts deleted file mode 100644 index fe6292bfdbb..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts +++ /dev/null @@ -1 +0,0 @@ -function \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts deleted file mode 100644 index 5109df29b73..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts deleted file mode 100644 index 37369dc33fb..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts +++ /dev/null @@ -1,10 +0,0 @@ -module Bar -{ - export class Bleah { - } - export class Foo extends Bleah { - } -} - -function Blah(x:Bar.Bleah) { -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts deleted file mode 100644 index 9cc47b34ee6..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts +++ /dev/null @@ -1,8 +0,0 @@ -module Test1 { - class Person { - children: string[]; - constructor (public name:string, children:string[]) { - - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts deleted file mode 100644 index 08d056b6b6e..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts +++ /dev/null @@ -1,16 +0,0 @@ -module BugFixes { - enum Foo { - bar, - baz - } - - var f: Foo = Foo./*here*/; - - import foo f = Foo; - foo./*here*/; -} - -module BugFix2 { - interface iFace { (event: string); } - var foo: iFace = function (elem) { /*here*/ } -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts deleted file mode 100644 index d127a8a34bd..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts +++ /dev/null @@ -1,33 +0,0 @@ -module ObjectLiterals { - interface MyPoint { - x1: number; - y1: number; - } - - var p1: MyPoint = { - /*here*/ - }; - - var p2: MyPoint = { - x1: 5, - /*here*/ - }; - - var p3: MyPoint = { - x1 /*here*/ - }; - - var p4: MyPoint = { - x1: 5, - y1 /*here*/ : 6 - }; - - // Negative cases (global completion) - var n4: MyPoint = { - x1: /*here*/ - }; - - var n2: MyPoint = { - x1: /*here*/, - }; -} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts deleted file mode 100644 index 5228083a667..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts +++ /dev/null @@ -1,91 +0,0 @@ -/// -var locVar; -function locFn() { } -class locCls { } -interface locInt{ } -module locMod{ export var foo = 1;} - -locVar = 1; -locFn(); -var foo = new locCls(); -class fooCls implements locInt { } -var fooVar = locMod.foo; - -remVar = 1; -remFn(); -var remfoo = new remCls(); -class remfooCls implements remInt { } -var remfooVar = remMod.foo; - -rem2Var = 1; -rem2Fn(); -var rem2foo = new rem2Cls(); -class rem2fooCls implements rem2Int { } -var rem2fooVar = rem2Mod.foo; - -var shdVar = "foo"; -module shdModule { - var shdVar; - shdVar = 1; -} - -function fnOverload( ); -function fnOverload(foo: string); -function fnOverload(foo: any) { }; - -fnOverload(); -fnOverload("test"); - -class clsOverload { - constructor (); - constructor (foo: string); - constructor (foo: any) { } -}; - -var clsOverloadVar = new clsOverload(); -clsOverloadVar = new clsOverload("test"); - -class clsInOverload { - static fnOverload( ); - static fnOverload(foo: string); - static fnOverload(foo: any) { }; - public fnOverload():any; - public fnOverload(foo: string); - public fnOverload(foo: any) { return "foo" }; - public fnOverload1():any; - public fnOverload1(foo: string); - public fnOverload1(foo: any) { return "foo" }; - - constructor () { } -} - -clsInOverload.fnOverload(); -clsInOverload.fnOverload("test"); - -var clsInOverloadVar = new clsInOverload(); -var foo3 = clsInOverloadVar.fnOverload(); -foo3 = clsInOverloadVar.fnOverload("test"); - -function fnInOverload() { - static fnOverload():any; - static fnOverload(foo: string); - static fnOverload(foo: any){ return "foo" }; -} - -fnInOverload.fnOverload(); -fnInOverload.fnOverload("test"); - -interface sInt { - sVar: number; - sFn: () => void; -} - -class iClass implements sInt { - public sVar = 1; - public sFn() { - } -} - -declare var ambientVar; - -ambientVar = 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts deleted file mode 100644 index ebee920b984..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -var remVar; -function remFn() { } -class remCls { } -interface remInt{ } -module remMod{ export var foo;} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts deleted file mode 100644 index 23005628529..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts +++ /dev/null @@ -1,5 +0,0 @@ -var rem2Var; -function rem2Fn() { } -class rem2Cls { } -interface rem2Int{ } -module rem2Mod{ export var foo; } diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts deleted file mode 100644 index f251b2c5b0a..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts +++ /dev/null @@ -1,5 +0,0 @@ -module A { - export interface IA { - y: string; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts deleted file mode 100644 index 39a1e7fbf46..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -module A { - export interface IA { - x: number; - } - - var x: IA; -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts b/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts deleted file mode 100644 index 1791e1395f4..00000000000 --- a/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts +++ /dev/null @@ -1,57 +0,0 @@ -module SimpleClassTest { - class Foo { - public foo(): void { - } - } - class Bar extends Foo { - public foo(): void { - } - } -} - -module SimpleInterfaceTest { - interface IFoo { - foo(): void; - } - interface IBar extends IFoo { - foo(): void; - } -} - -module SimpleClassInterfaceTest { - interface IFoo { - foo(): void; - } - class Bar implements IFoo { - public foo(): void { - } - } -} - -module Test { - interface IBase { - field: string; - method(): void; - } - - interface IBlah extends IBase { - field: string; - } - - interface IBlah2 extends IBlah { - field: string; - } - - interface IDerived extends IBlah2 { - method(): void; - } - - class Bar implements IDerived { - public field: string; - public method(): void { } - } - - class BarBlah extends Bar { - public field: string; - } -} diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts deleted file mode 100644 index 4014f438809..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts +++ /dev/null @@ -1,117 +0,0 @@ -/// -// Comment Refence Test: globalVar -var globalVar: number = 2; - -class fooCls { - static clsSVar = 1; - //Declare - clsVar = 1; - - constructor (public clsParam: number) { - //Increments - globalVar++; - this.clsVar++; - fooCls.clsSVar++; - this.clsParam++; - modTest.modVar++; - } -} - -function foo(x: number) { - //Declare - var fnVar = 1; - - //Increments - fooCls.clsSVar++; - globalVar++; - modTest.modVar++; - fnVar++; - - //Return - return x++; -} - -module modTest { - //Declare - export var modVar:number; - - //Increments - globalVar++; - fooCls.clsSVar++; - modVar++; - - class testCls { - static boo = foo; - } - - function testFn(){ - static boo = foo; - - //Increments - globalVar++; - fooCls.clsSVar++; - modVar++; - } - - module testMod { - var boo = foo; - } -} - -//Type test -var clsTest: fooCls; - -//Arguments -clsTest = new fooCls(globalVar); -foo(globalVar); - -//Increments -fooCls.clsSVar++; -modTest.modVar++; -globalVar = globalVar + globalVar; - -//ETC - Other cases -globalVar = 3; -foo = foo + 1; -err = err++; - -//Shadowed fn Parameter -function shdw(globalVar: number) { - //Increments - globalVar++; - return globalVar; -} - -//Remotes -//Type test -var remoteclsTest: remotefooCls; - -//Arguments -remoteclsTest = new remotefooCls(remoteglobalVar); -remotefoo(remoteglobalVar); - -//Increments -remotefooCls.remoteclsSVar++; -remotemodTest.remotemodVar++; -remoteglobalVar = remoteglobalVar + remoteglobalVar; - -//ETC - Other cases -remoteglobalVar = 3; - -//Find References misses method param -var - - - - array = ["f", "o", "o"]; - -array.forEach( - - -function(str) { - - - - return str + " "; - -}); diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts deleted file mode 100644 index 67aa438a639..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts +++ /dev/null @@ -1,59 +0,0 @@ -var remoteglobalVar: number = 2; - -class remotefooCls { - //Declare - remoteclsVar = 1; - static remoteclsSVar = 1; - - constructor (public remoteclsParam: number) { - //Increments - remoteglobalVar++; - this.remoteclsVar++; - remotefooCls.remoteclsSVar++; - this.remoteclsParam++; - remotemodTest.remotemodVar++; - } -} - -function remotefoo(remotex: number) { - //Declare - var remotefnVar = 1; - - //Increments - remotefooCls.remoteclsSVar++; - remoteglobalVar++; - remotemodTest.remotemodVar++; - remotefnVar++; - - //Return - return remotex++; -} - -module remotemodTest { - //Declare - export var remotemodVar:number; - - //Increments - remoteglobalVar++; - remotefooCls.remoteclsSVar++; - remotemodVar++; - - class remotetestCls { - static remoteboo = remotefoo; - } - - function remotetestFn(){ - static remoteboo = remotefoo; - - //Increments - remoteglobalVar++; - remotefooCls.remoteclsSVar++; - remotemodVar++; - } - - module remotetestMod { - var remoteboo = remotefoo; - } -} - - diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts deleted file mode 100644 index 4dd668b29b1..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts +++ /dev/null @@ -1,70 +0,0 @@ -module FindRef3 { - module SimpleClassTest { - export class Foo { - public foo(): void { - } - } - export class Bar extends Foo { - public foo(): void { - } - } - } - - module SimpleInterfaceTest { - export interface IFoo { - foo(): void; - } - export interface IBar extends IFoo { - foo(): void; - } - } - - module SimpleClassInterfaceTest { - export interface IFoo { - foo(): void; - } - export class Bar implements IFoo { - public foo(): void { - } - } - } - - module Test { - export interface IBase { - field: string; - method(): void; - } - - export interface IBlah extends IBase { - field: string; - } - - export interface IBlah2 extends IBlah { - field: string; - } - - export interface IDerived extends IBlah2 { - method(): void; - } - - export class Bar implements IDerived { - public field: string; - public method(): void { } - } - - export class BarBlah extends Bar { - public field: string; - } - } - - function test() { - var x = new SimpleClassTest.Bar(); - x.foo(); - - var y: SimpleInterfaceTest.IBar = null; - y.foo(); - - var z = new Test.BarBlah(); - z.field = ""; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts deleted file mode 100644 index 4f705e721e8..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts +++ /dev/null @@ -1,28 +0,0 @@ -module FindRef4 { - module MixedStaticsClassTest { - export class Foo { - bar: Foo; - static bar: Foo; - - public foo(): void { - } - public static foo(): void { - } - } - } - - function test() { - // instance function - var x = new MixedStaticsClassTest.Foo(); - x.foo(); - x.bar; - - var y = new MixedStaticsClassTest.Foo(); - y.foo(); - y.bar; - - // static function - MixedStaticsClassTest.Foo.foo(); - MixedStaticsClassTest.Foo.bar; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts b/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts deleted file mode 100644 index afac9249cc0..00000000000 --- a/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts +++ /dev/null @@ -1,112 +0,0 @@ -module Bar { // Module - var x: number; // Variable - function f(): void { } // Function - - interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - enum Blah { - foo = 2 // EnumMemberDeclaration - } - - class Bar { - constructor(private barVar: Bar) { } // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void { } // MemberFunctionDeclaration - public get prop1(): void { } // MemberAccessorDeclaration - public set prop1() { } // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void { } // MemberFunctionDeclaration - private get prop1P(): void { } // MemberAccessorDeclaration - private set prop1P() { } // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void { } // StaticFunctionDeclaration - static get foo2(): void { } // StaticAccessorDeclaration - static set foo2() { } // StaticAccessorDeclaration - } -} - -module Bar2 { // Module - export var x: number; // Variable - export function f(): void { } // Function - - export interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - export enum Blah { - foo = 2 // EnumMemberDeclaration - } - - export class Bar { - constructor(private barVar: Bar) { } // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void { } // MemberFunctionDeclaration - public get prop1(): void { } // MemberAccessorDeclaration - public set prop1() { } // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void { } // MemberFunctionDeclaration - private get prop1P(): void { } // MemberAccessorDeclaration - private set prop1P() { } // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void { } // StaticFunctionDeclaration - static get foo2(): void { } // StaticAccessorDeclaration - static set foo2() { } // StaticAccessorDeclaration - } -} - - -declare module Bar3 { - -} - -module Bar4 { // Module - declare var x: number; // Variable - declare function f(): void; // Function - - declare interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - declare enum Blah { - foo = 2 // EnumMemberDeclaration - } - - declare class Bar { - constructor (private barVar: Bar); // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void; // MemberFunctionDeclaration - public get prop1(): void; // MemberAccessorDeclaration - public set prop1(); // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void; // MemberFunctionDeclaration - private get prop1P(): void; // MemberAccessorDeclaration - private set prop1P(); // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void; // StaticFunctionDeclaration - static get foo2(): void; // StaticAccessorDeclaration - static set foo2(); // StaticAccessorDeclaration - } -} diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts deleted file mode 100644 index 882216cb88d..00000000000 --- a/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts +++ /dev/null @@ -1,85 +0,0 @@ -//Comment -class sampleCls { constructor (str: string, num: number) { } } -var x = new sampleCls("", 5); // new() test -sampleCls(); // negative test - -function fnTest(str: string, num: number) { } -fnTest(); // simple function test - -function fnOverload(); -function fnOverload(test: string); function fnOverload(test: string) { } -fnOverload() -fnOverload("") - -class clsOverload { constructor (); constructor (test: string); constructor (test?: string) { } } -var x = new clsOverload(); -var x = new clsOverload(""); - -module SimpleTests { - module CallExpressions { - class Foo { - public f1() { } - public f2(n: number) { } - public f3(n: number, s: string) { } - - } - - var x = new Foo(); - x.f1(); - x.f2(5); - x.f3(5, ""); - x.f1( - x.f2(5, - x.f3(5, - } - - module NewExpressions { - - } -} - -module OverloadTests { - module CallExpressions { - function foo(callback: (a: number, b: string) => string) { - callback(5, ""); - } - } -} - -module AnonymousFunctionTest { - var x2 = function (n: number, s: string): (a: number, b: string) => string { - return null; - } - x2(5, "")(1, ""); -} - -module ObjectLiteralTest { - var x = { n: 5, s: "", f: (a: number, b: string) => "" }; - x.f(4, ""); -} - -module SuperCallTest { - class base { - constructor(s: string); - constructor(n: number); - constructor(a: any) { } - } - class A extends base { - constructor() { - super(""); - } - } - - class B extends base { - } - class B2 extends B { - } - class B3 extends B2 { - constructor() { - super(""); - } - } - -} - - diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts deleted file mode 100644 index 562fd566ce2..00000000000 --- a/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts +++ /dev/null @@ -1,5 +0,0 @@ -function Foo(arg1: string, arg2: string) { - -} - -Foo( \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts deleted file mode 100644 index 2649484f465..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts +++ /dev/null @@ -1,132 +0,0 @@ -module Foo { - - class Bar { - - private foo:string = ""; - - private f() { - var a:any[] = [[1, 2], [3, 4], 5]; - - return ((1 + 1)); - } - - private f2() { - if(true) { }{ }; - } - } - - interface Foo { - - x:number; - - foo():number; - - } - - module Foo2 { - - function f() { - } - - var x: number; - - } - - enum Foo3 { - - val1, - - val2, - - } - -} - -function foo(bar, - blah, - -); - - -function test() { - for (var i = 0; i < 10; i++) { - - } - - for (var e in foo.bar) { - - } - - with (foo.bar) { - - } - - switch(foo.bar) { - - } - - switch (foo.bar) { - - case 1: - - break; - - } - -} - -function tryCatch() { - - try { - - } - - catch(err) { - - } - -} - - -function tryFinally() { - - try { - - } - - finally { - - } - -} - -function tryCatchFinally() { - - try { - - } - - catch(err) { - - } - - finally { - - } - -} - - -module SwitchTest { - var a = 3; - - if (a == 5) { - switch (a) { - case 1: - if (a == 5) { - - } - break; - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts deleted file mode 100644 index d4ab3136565..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts +++ /dev/null @@ -1,8 +0,0 @@ -// -// Note: Do not add more tests at the end of this file, as -// the purpose of this test is to verity smart indent -// works for unterminated function arguments at the end of a file. -// - -function foo(a, - diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts deleted file mode 100644 index 8122651914b..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts +++ /dev/null @@ -1,6 +0,0 @@ -// -// Note: Do not add more tests at the end of this file, as -// the purpose of this test is to verity smart indent -// works for unterminated if statements at the end of a file. -// -if (true) diff --git a/tests/cases/unittests/services/testCode/incrementalParser.ts b/tests/cases/unittests/services/testCode/incrementalParser.ts deleted file mode 100644 index f5290476b80..00000000000 --- a/tests/cases/unittests/services/testCode/incrementalParser.ts +++ /dev/null @@ -1,24 +0,0 @@ -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds - -function tryCatchFinally() { - addsdfsdafsdafsdfdsfdsfsfsaafdsddfsdaf; - try { - - } - - catch(err) { - - } - - finally { - - } - -} - diff --git a/tests/cases/unittests/services/testCode/incrementalParser2.ts b/tests/cases/unittests/services/testCode/incrementalParser2.ts deleted file mode 100644 index 86ec00ebd65..00000000000 --- a/tests/cases/unittests/services/testCode/incrementalParser2.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface bah { - (y: number); - x: number; - (z: string) -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/overridesCollector.ts b/tests/cases/unittests/services/testCode/overridesCollector.ts deleted file mode 100644 index 1791e1395f4..00000000000 --- a/tests/cases/unittests/services/testCode/overridesCollector.ts +++ /dev/null @@ -1,57 +0,0 @@ -module SimpleClassTest { - class Foo { - public foo(): void { - } - } - class Bar extends Foo { - public foo(): void { - } - } -} - -module SimpleInterfaceTest { - interface IFoo { - foo(): void; - } - interface IBar extends IFoo { - foo(): void; - } -} - -module SimpleClassInterfaceTest { - interface IFoo { - foo(): void; - } - class Bar implements IFoo { - public foo(): void { - } - } -} - -module Test { - interface IBase { - field: string; - method(): void; - } - - interface IBlah extends IBase { - field: string; - } - - interface IBlah2 extends IBlah { - field: string; - } - - interface IDerived extends IBlah2 { - method(): void; - } - - class Bar implements IDerived { - public field: string; - public method(): void { } - } - - class BarBlah extends Bar { - public field: string; - } -} diff --git a/tests/cases/unittests/services/testCode/references/classLocal.ts b/tests/cases/unittests/services/testCode/references/classLocal.ts deleted file mode 100644 index 34eda48baee..00000000000 --- a/tests/cases/unittests/services/testCode/references/classLocal.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Local inside a class - -var n = 14; - -class foo { - private ^^[|n|] = 0; - - public bar() { - this.[|n|] = 9; - } - - constructor() { - this.[|n|]^^ = 4; - } - - public bar2() { - var n = 12; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/classParameter.ts b/tests/cases/unittests/services/testCode/references/classParameter.ts deleted file mode 100644 index fad418de765..00000000000 --- a/tests/cases/unittests/services/testCode/references/classParameter.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Reference to a class parameter - -var p = 2; - -class p { } - -class foo { - constructor (public p: any) { - } - - public f(p) { - this.^^[|p|] = p; - } - -} - -var n = new foo(undefined); -n.^^[|p|] = null; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/comment.ts b/tests/cases/unittests/services/testCode/references/comment.ts deleted file mode 100644 index e6b8edaa015..00000000000 --- a/tests/cases/unittests/services/testCode/references/comment.ts +++ /dev/null @@ -1,4 +0,0 @@ -// References to ^^foo or b^^ar -/* in comments should not find fo^^o or bar^^ */ -class foo { } -var bar = 0; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionOverloads.ts b/tests/cases/unittests/services/testCode/references/functionOverloads.ts deleted file mode 100644 index d382f8818fa..00000000000 --- a/tests/cases/unittests/services/testCode/references/functionOverloads.ts +++ /dev/null @@ -1,6 +0,0 @@ -// function overloads should be highlighted together - -function [|^^foo|](x: string); -function [|^^foo|](x: string, y: number) { - [|^^foo|]('', 43); -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionParameter.ts b/tests/cases/unittests/services/testCode/references/functionParameter.ts deleted file mode 100644 index 67f63c35e72..00000000000 --- a/tests/cases/unittests/services/testCode/references/functionParameter.ts +++ /dev/null @@ -1,7 +0,0 @@ -var x; -var n; - -function n(x: number, [|n|]^^: number) { - ^^[|n|] = 32; - x = [|n|]; -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/globals.ts b/tests/cases/unittests/services/testCode/references/globals.ts deleted file mode 100644 index 1ebef4e885e..00000000000 --- a/tests/cases/unittests/services/testCode/references/globals.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Global variable reference - -var ^^global = 2; - -class foo { - constructor (public global) { } - public f(global) { } - public f2(global) { } -} - -class bar { - constructor () { - var n = [|global|]; - - var f = new foo(''); - f.global = ''; - } -} - -var k = [|global|]; - -================ -var m = [|global|]; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts deleted file mode 100644 index d1837f12555..00000000000 --- a/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Neither should cause highlighting to occur -f^^oo = fo^^o; diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts deleted file mode 100644 index 7ea1545517e..00000000000 --- a/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Should still highlight even though it's invalid assignment -var ^^[|foo|] = function() { }; - -[|fo^^o|] = [|f^^oo|] + 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/noContext.ts b/tests/cases/unittests/services/testCode/references/noContext.ts deleted file mode 100644 index fd1ef87c783..00000000000 --- a/tests/cases/unittests/services/testCode/references/noContext.ts +++ /dev/null @@ -1,20 +0,0 @@ -module modTest { - //Declare - export var modVar:number; - ^^ - - //Increments - modVar++; - - class testCls{ - ^^ - } - - function testFn(){ - //Increments - modVar++; - } ^^ -^^ - module testMod { - } -} diff --git a/tests/cases/unittests/services/testCode/references/referenceToClass.ts b/tests/cases/unittests/services/testCode/references/referenceToClass.ts deleted file mode 100644 index 28c6ca509db..00000000000 --- a/tests/cases/unittests/services/testCode/references/referenceToClass.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Class references should work across file and not find local variables -class [|foo|]^^ { - public n: ^^[|foo|]; - public foo: number; -} - -class bar { - public n: [|f^^o^^o|]; - public k = new [|foo|](); -} - -module mod { - var k: [|foo|] = null; -} - -=================== -var k: ^^[|foo|]; diff --git a/tests/cases/unittests/services/testCode/references/static.ts b/tests/cases/unittests/services/testCode/references/static.ts deleted file mode 100644 index 68fa11cd4a5..00000000000 --- a/tests/cases/unittests/services/testCode/references/static.ts +++ /dev/null @@ -1,28 +0,0 @@ -// reference a class static - -var n = 43; - -class foo { - static [|n|] = ''; - - public bar() { - foo.^^[|n|] = "'"; - if(foo.[|n|]) { - var x = foo.[|n|]; - } - } -} - -class foo2 { - private x = foo.[|n|]^^; - constructor() { - foo.^^[|n|] = x; - } - - function b(n) { - n = foo.[|n|]; - } -} - -================= -var q = foo.[|n|]; \ No newline at end of file From d502ae20e5da7b9cdb0c9463088b715e17aa6153 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:35:27 -0700 Subject: [PATCH 10/21] move formatting unit tests to a diffrent folder --- .../{ls => services}/documentRegistry.ts | 0 .../documentFormattingTests.json | 0 .../{ => formatting}/formatDiffTemplate.html | 0 .../getFormattingEditsForRange.ts | 0 .../getSmartIndentAtLineNumber.ts | 0 .../importedJavaScriptFormatting.ts | 0 .../{ => formatting}/ruleFormattingTests.json | 0 .../testCode/formatting/classes.ts | 0 .../testCode/formatting/classesBaseline.ts | 0 .../testCode/formatting/colonAndQMark.ts | 0 .../formatting/colonAndQMarkBaseline.ts | 0 .../formatting/documentReadyFunction.ts | 0 .../documentReadyFunctionBaseLine.ts | 0 .../testCode/formatting/emptyBlock.ts | 0 .../testCode/formatting/emptyBlockBaseline.ts | 0 .../formatting/emptyInterfaceLiteral.ts | 0 .../emptyInterfaceLiteralBaseLine.ts | 0 .../testCode/formatting/fatArrowFunctions.ts | 0 .../formatting/fatArrowFunctionsBaseline.ts | 0 .../formatting/formatDebuggerStatement.ts | 0 .../formatDebuggerStatementBaseline.ts | 0 .../formatvariableDeclarationList.ts | 0 .../formatvariableDeclarationListBaseline.ts | 0 .../testCode/formatting/implicitModule.ts | 0 .../formatting/implicitModuleBaseline.ts | 0 .../testCode/formatting/importDeclaration.ts | 0 .../formatting/importDeclarationBaseline.ts | 0 .../testCode/formatting/main.ts | 0 .../testCode/formatting/mainBaseline.ts | 0 .../testCode/formatting/moduleIndentation.ts | 0 .../formatting/moduleIndentationBaseline.ts | 0 .../testCode/formatting/modules.ts | 0 .../testCode/formatting/modulesBaseline.ts | 0 .../testCode/formatting/objectLiteral.ts | 0 .../formatting/objectLiteralBaseline.ts | 0 .../testCode/formatting/onClosingBracket.ts | 0 .../formatting/onClosingBracketBaseLine.ts | 0 .../testCode/formatting/onSemiColon.ts | 0 .../formatting/onSemiColonBaseline.ts | 0 .../formatting/spaceAfterConstructor.ts | 0 .../spaceAfterConstructorBaseline.ts | 0 .../testCode/formatting/tabAfterCloseCurly.ts | 0 .../formatting/tabAfterCloseCurlyBaseline.ts | 0 .../formatting/typescriptConstructs.ts | 0 .../typescriptConstructsBaseline.ts | 0 .../testCode/formatting/various.ts | 0 .../testCode/formatting/variousBaseline.ts | 0 .../testCode/formatting/withStatement.ts | 0 .../formatting/withStatementBaseline.ts | 0 .../testCode/testCode/formatting/classes.ts | 79 ++++++++++++ .../testCode/formatting/classesBaseline.ts | 79 ++++++++++++ .../testCode/formatting/colonAndQMark.ts | 4 + .../formatting/colonAndQMarkBaseline.ts | 4 + .../formatting/documentReadyFunction.ts | 3 + .../documentReadyFunctionBaseLine.ts | 3 + .../testCode/formatting/emptyBlock.ts | 1 + .../testCode/formatting/emptyBlockBaseline.ts | 1 + .../formatting/emptyInterfaceLiteral.ts | 10 ++ .../emptyInterfaceLiteralBaseLine.ts | 10 ++ .../testCode/formatting/fatArrowFunctions.ts | 112 ++++++++++++++++++ .../formatting/fatArrowFunctionsBaseline.ts | 112 ++++++++++++++++++ .../formatting/formatDebuggerStatement.ts | 2 + .../formatDebuggerStatementBaseline.ts | 2 + .../formatvariableDeclarationList.ts | 13 ++ .../formatvariableDeclarationListBaseline.ts | 13 ++ .../testCode/formatting/implicitModule.ts | 3 + .../formatting/implicitModuleBaseline.ts | 3 + .../testCode/formatting/importDeclaration.ts | 6 + .../formatting/importDeclarationBaseline.ts | 6 + .../testCode/testCode/formatting/main.ts | 95 +++++++++++++++ .../testCode/formatting/mainBaseline.ts | 98 +++++++++++++++ .../testCode/formatting/moduleIndentation.ts | 3 + .../formatting/moduleIndentationBaseline.ts | 3 + .../testCode/testCode/formatting/modules.ts | 76 ++++++++++++ .../testCode/formatting/modulesBaseline.ts | 76 ++++++++++++ .../testCode/formatting/objectLiteral.ts | 27 +++++ .../formatting/objectLiteralBaseline.ts | 31 +++++ .../testCode/formatting/onClosingBracket.ts | 32 +++++ .../formatting/onClosingBracketBaseLine.ts | 28 +++++ .../testCode/formatting/onSemiColon.ts | 1 + .../formatting/onSemiColonBaseline.ts | 1 + .../formatting/spaceAfterConstructor.ts | 1 + .../spaceAfterConstructorBaseline.ts | 1 + .../testCode/formatting/tabAfterCloseCurly.ts | 10 ++ .../formatting/tabAfterCloseCurlyBaseline.ts | 9 ++ .../formatting/typescriptConstructs.ts | 65 ++++++++++ .../typescriptConstructsBaseline.ts | 58 +++++++++ .../testCode/testCode/formatting/various.ts | 17 +++ .../testCode/formatting/variousBaseline.ts | 17 +++ .../testCode/formatting/withStatement.ts | 9 ++ .../formatting/withStatementBaseline.ts | 6 + 91 files changed, 1130 insertions(+) rename tests/cases/unittests/{ls => services}/documentRegistry.ts (100%) rename tests/cases/unittests/services/{ => formatting}/documentFormattingTests.json (100%) rename tests/cases/unittests/services/{ => formatting}/formatDiffTemplate.html (100%) rename tests/cases/unittests/services/{ => formatting}/getFormattingEditsForRange.ts (100%) rename tests/cases/unittests/services/{ => formatting}/getSmartIndentAtLineNumber.ts (100%) rename tests/cases/unittests/services/{ => formatting}/importedJavaScriptFormatting.ts (100%) rename tests/cases/unittests/services/{ => formatting}/ruleFormattingTests.json (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/classes.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/classesBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/colonAndQMark.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/colonAndQMarkBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/documentReadyFunction.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/documentReadyFunctionBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyBlock.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyBlockBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyInterfaceLiteral.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyInterfaceLiteralBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/fatArrowFunctions.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/fatArrowFunctionsBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatDebuggerStatement.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatDebuggerStatementBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatvariableDeclarationList.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatvariableDeclarationListBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/implicitModule.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/implicitModuleBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/importDeclaration.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/importDeclarationBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/main.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/mainBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/moduleIndentation.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/moduleIndentationBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/modules.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/modulesBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/objectLiteral.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/objectLiteralBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onClosingBracket.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onClosingBracketBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onSemiColon.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onSemiColonBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/spaceAfterConstructor.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/spaceAfterConstructorBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/tabAfterCloseCurly.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/tabAfterCloseCurlyBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/typescriptConstructs.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/typescriptConstructsBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/various.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/variousBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/withStatement.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/withStatementBaseline.ts (100%) create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts diff --git a/tests/cases/unittests/ls/documentRegistry.ts b/tests/cases/unittests/services/documentRegistry.ts similarity index 100% rename from tests/cases/unittests/ls/documentRegistry.ts rename to tests/cases/unittests/services/documentRegistry.ts diff --git a/tests/cases/unittests/services/documentFormattingTests.json b/tests/cases/unittests/services/formatting/documentFormattingTests.json similarity index 100% rename from tests/cases/unittests/services/documentFormattingTests.json rename to tests/cases/unittests/services/formatting/documentFormattingTests.json diff --git a/tests/cases/unittests/services/formatDiffTemplate.html b/tests/cases/unittests/services/formatting/formatDiffTemplate.html similarity index 100% rename from tests/cases/unittests/services/formatDiffTemplate.html rename to tests/cases/unittests/services/formatting/formatDiffTemplate.html diff --git a/tests/cases/unittests/services/getFormattingEditsForRange.ts b/tests/cases/unittests/services/formatting/getFormattingEditsForRange.ts similarity index 100% rename from tests/cases/unittests/services/getFormattingEditsForRange.ts rename to tests/cases/unittests/services/formatting/getFormattingEditsForRange.ts diff --git a/tests/cases/unittests/services/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/formatting/getSmartIndentAtLineNumber.ts similarity index 100% rename from tests/cases/unittests/services/getSmartIndentAtLineNumber.ts rename to tests/cases/unittests/services/formatting/getSmartIndentAtLineNumber.ts diff --git a/tests/cases/unittests/services/importedJavaScriptFormatting.ts b/tests/cases/unittests/services/formatting/importedJavaScriptFormatting.ts similarity index 100% rename from tests/cases/unittests/services/importedJavaScriptFormatting.ts rename to tests/cases/unittests/services/formatting/importedJavaScriptFormatting.ts diff --git a/tests/cases/unittests/services/ruleFormattingTests.json b/tests/cases/unittests/services/formatting/ruleFormattingTests.json similarity index 100% rename from tests/cases/unittests/services/ruleFormattingTests.json rename to tests/cases/unittests/services/formatting/ruleFormattingTests.json diff --git a/tests/cases/unittests/services/testCode/formatting/classes.ts b/tests/cases/unittests/services/formatting/testCode/formatting/classes.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/classes.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/classes.ts diff --git a/tests/cases/unittests/services/testCode/formatting/classesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/classesBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/classesBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/classesBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts b/tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMark.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMark.ts diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMarkBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMarkBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts b/tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunction.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunction.ts diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunctionBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunctionBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlock.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyBlock.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyBlock.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyBlock.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyBlockBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyBlockBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteral.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteral.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteralBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteralBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts b/tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctions.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctions.ts diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctionsBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctionsBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatement.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatement.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatementBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatementBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationList.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationList.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationListBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationListBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModule.ts b/tests/cases/unittests/services/formatting/testCode/formatting/implicitModule.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/implicitModule.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/implicitModule.ts diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/implicitModuleBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/implicitModuleBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclaration.ts b/tests/cases/unittests/services/formatting/testCode/formatting/importDeclaration.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/importDeclaration.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/importDeclaration.ts diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/importDeclarationBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/importDeclarationBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/main.ts b/tests/cases/unittests/services/formatting/testCode/formatting/main.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/main.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/main.ts diff --git a/tests/cases/unittests/services/testCode/formatting/mainBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/mainBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/mainBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/mainBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts b/tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentation.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentation.ts diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentationBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentationBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/modules.ts b/tests/cases/unittests/services/formatting/testCode/formatting/modules.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/modules.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/modules.ts diff --git a/tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/modulesBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/modulesBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteral.ts b/tests/cases/unittests/services/formatting/testCode/formatting/objectLiteral.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/objectLiteral.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/objectLiteral.ts diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/objectLiteralBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/objectLiteralBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracket.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracket.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracketBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracketBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColon.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onSemiColon.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onSemiColon.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onSemiColon.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onSemiColonBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onSemiColonBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts b/tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructor.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructor.ts diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructorBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructorBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts b/tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurly.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurly.ts diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurlyBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurlyBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts b/tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructs.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructs.ts diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructsBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructsBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/various.ts b/tests/cases/unittests/services/formatting/testCode/formatting/various.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/various.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/various.ts diff --git a/tests/cases/unittests/services/testCode/formatting/variousBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/variousBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/variousBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/variousBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/withStatement.ts b/tests/cases/unittests/services/formatting/testCode/formatting/withStatement.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/withStatement.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/withStatement.ts diff --git a/tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/withStatementBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/withStatementBaseline.ts diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts new file mode 100644 index 00000000000..e779f69810f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts @@ -0,0 +1,79 @@ + class a { + constructor ( n : number ) ; + constructor ( s : string ) ; + constructor ( ns : any ) { + + } + + public pgF ( ) { } ; + + public pv ; + public get d ( ) { + return 30 ; + } + public set d ( ) { + } + + public static get p2 ( ) { + return { x : 30 , y : 40 } ; + } + + private static d2 ( ) { + } + private static get p3 ( ) { + return "string" ; + } + private pv3 ; + + private foo ( n : number ) : string ; + private foo ( s : string ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } +} + + class b extends a { +} + + class m1b { + +} + + interface m1ib { + + } + class c extends m1b { +} + + class ib2 implements m1ib { +} + + declare class aAmbient { + constructor ( n : number ) ; + constructor ( s : string ) ; + public pgF ( ) : void ; + public pv ; + public d : number ; + static p2 : { x : number ; y : number ; } ; + static d2 ( ) ; + static p3 ; + private pv3 ; + private foo ( s ) ; +} + + class d { + private foo ( n : number ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; +} + + class e { + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; + private foo ( n : number ) : string ; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts new file mode 100644 index 00000000000..e7e69b44125 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts @@ -0,0 +1,79 @@ +class a { + constructor(n: number); + constructor(s: string); + constructor(ns: any) { + + } + + public pgF() { }; + + public pv; + public get d() { + return 30; + } + public set d() { + } + + public static get p2() { + return { x: 30, y: 40 }; + } + + private static d2() { + } + private static get p3() { + return "string"; + } + private pv3; + + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } +} + +class b extends a { +} + +class m1b { + +} + +interface m1ib { + +} +class c extends m1b { +} + +class ib2 implements m1ib { +} + +declare class aAmbient { + constructor(n: number); + constructor(s: string); + public pgF(): void; + public pv; + public d: number; + static p2: { x: number; y: number; }; + static d2(); + static p3; + private pv3; + private foo(s); +} + +class d { + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; +} + +class e { + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + private foo(n: number): string; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts new file mode 100644 index 00000000000..5562e142046 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts @@ -0,0 +1,4 @@ +class foo { + constructor (n?: number, m? = 5, o?: string = "") { } + x:number = 1?2:3; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts new file mode 100644 index 00000000000..52bbe56251d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts @@ -0,0 +1,4 @@ +class foo { + constructor(n?: number, m? = 5, o?: string = "") { } + x: number = 1 ? 2 : 3; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts new file mode 100644 index 00000000000..35daa4d895c --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts @@ -0,0 +1,3 @@ +$ ( document ) . ready ( function ( ) { + alert ( 'i am ready' ) ; + } ); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts new file mode 100644 index 00000000000..838ef682207 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts @@ -0,0 +1,3 @@ +$(document).ready(function() { + alert('i am ready'); +}); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts new file mode 100644 index 00000000000..6f31cf5a2e6 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts @@ -0,0 +1 @@ +{ } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts new file mode 100644 index 00000000000..1feec453d03 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts @@ -0,0 +1,10 @@ + function foo ( x : { } ) { } + +foo ( { } ) ; + + + + interface bar { + x : { } ; + y : ( ) => { } ; + } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts new file mode 100644 index 00000000000..04f3c0bc9b9 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts @@ -0,0 +1,10 @@ +function foo(x: {}) { } + +foo({}); + + + +interface bar { + x: {}; + y: () => {}; +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts new file mode 100644 index 00000000000..ebbf54557fa --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts @@ -0,0 +1,112 @@ +// valid + ( ) => 1 ; + ( arg ) => 2 ; + arg => 2 ; + ( arg = 1 ) => 3 ; + ( arg ? ) => 4 ; + ( arg : number ) => 5 ; + ( arg : number = 0 ) => 6 ; + ( arg ? : number ) => 7 ; + ( ... arg : number [ ] ) => 8 ; + ( arg1 , arg2 ) => 12 ; + ( arg1 = 1 , arg2 =3 ) => 13 ; + ( arg1 ? , arg2 ? ) => 14 ; + ( arg1 : number , arg2 : number ) => 15 ; + ( arg1 : number = 0 , arg2 : number = 1 ) => 16 ; + ( arg1 ? : number , arg2 ? : number ) => 17 ; + ( arg1 , ... arg2 : number [ ] ) => 18 ; + ( arg1 , arg2 ? : number ) => 19 ; + +// in paren + ( ( ) => 21 ) ; + ( ( arg ) => 22 ) ; + ( ( arg = 1 ) => 23 ) ; + ( ( arg ? ) => 24 ) ; + ( ( arg : number ) => 25 ) ; + ( ( arg : number = 0 ) => 26 ) ; + ( ( arg ? : number ) => 27 ) ; + ( ( ... arg : number [ ] ) => 28 ) ; + +// in multiple paren + ( ( ( ( ( arg ) => { return 32 ; } ) ) ) ) ; + +// in ternary exression + false ? ( ) => 41 : null ; + false ? ( arg ) => 42 : null ; + false ? ( arg = 1 ) => 43 : null ; + false ? ( arg ? ) => 44 : null ; + false ? ( arg : number ) => 45 : null ; + false ? ( arg ? : number ) => 46 : null ; + false ? ( arg ? : number = 0 ) => 47 : null ; + false ? ( ... arg : number [ ] ) => 48 : null ; + +// in ternary exression within paren + false ? ( ( ) => 51 ) : null ; + false ? ( ( arg ) => 52 ) : null ; + false ? ( ( arg = 1 ) => 53 ) : null ; + false ? ( ( arg ? ) => 54 ) : null ; + false ? ( ( arg : number ) => 55 ) : null ; + false ? ( ( arg ? : number ) => 56 ) : null ; + false ? ( ( arg ? : number = 0 ) => 57 ) : null ; + false ? ( ( ... arg : number [ ] ) => 58 ) : null ; + +// ternary exression's else clause + false ? null : ( ) => 61 ; + false ? null : ( arg ) => 62 ; + false ? null : ( arg = 1 ) => 63 ; + false ? null : ( arg ? ) => 64 ; + false ? null : ( arg : number ) => 65 ; + false ? null : ( arg ? : number ) => 66 ; + false ? null : ( arg ? : number = 0 ) => 67 ; + false ? null : ( ... arg : number [ ] ) => 68 ; + + +// nested ternary expressions + ( a ? ) => { return a ; } ? ( b ? ) => { return b ; } : ( c ? ) => { return c ; } ; + +//multiple levels + ( a ? ) => { return a ; } ? ( b ) => ( c ) => 81 : ( c ) => ( d ) => 82 ; + + +// In Expressions + ( ( arg ) => 90 ) instanceof Function ; + ( ( arg = 1 ) => 91 ) instanceof Function ; + ( ( arg ? ) => 92 ) instanceof Function ; + ( ( arg : number ) => 93 ) instanceof Function ; + ( ( arg : number = 1 ) => 94 ) instanceof Function ; + ( ( arg ? : number ) => 95 ) instanceof Function ; + ( ( ... arg : number [ ] ) => 96 ) instanceof Function ; + +'' + ( arg ) => 100 ; + ( ( arg ) => 0 ) + '' + ( arg ) => 101 ; + ( ( arg = 1 ) => 0 ) + '' + ( arg = 2 ) => 102 ; + ( ( arg ? ) => 0 ) + '' + ( arg ? ) => 103 ; + ( ( arg : number ) => 0 ) + '' + ( arg : number ) => 104 ; + ( ( arg : number = 1 ) => 0 ) + '' + ( arg : number = 2 ) => 105 ; + ( ( arg ? : number = 1 ) => 0 ) + '' + ( arg ? : number = 2 ) => 106 ; + ( ( ... arg : number [ ] ) => 0 ) + '' + ( ... arg : number [ ] ) => 107 ; + ( ( arg1 , arg2 ? ) => 0 ) + '' + ( arg1 , arg2 ? ) => 108 ; + ( ( arg1 , ... arg2 : number [ ] ) => 0 ) + '' + ( arg1 , ... arg2 : number [ ] ) => 108 ; + + +// Function Parameters +function foo ( ... arg : any [ ] ) { } + +foo ( + ( a ) => 110 , + ( ( a ) => 111 ) , + ( a ) => { + return 112 ; + } , + ( a ? ) => 113 , + ( a , b ? ) => 114 , + ( a : number ) => 115 , + ( a : number = 0 ) => 116 , + ( a = 0 ) => 117 , + ( a ? : number = 0 ) => 118 , + ( a ? , b ? : number = 0 ) => 118 , + ( ... a : number [ ] ) => 119 , + ( a , b ? = 0 , ... c : number [ ] ) => 120 , + ( a ) => ( b ) => ( c ) => 121 , + false ? ( a ) => 0 : ( b ) => 122 + ) ; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts new file mode 100644 index 00000000000..7a1ef86f5af --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts @@ -0,0 +1,112 @@ +// valid +() => 1; +(arg) => 2; +arg => 2; +(arg = 1) => 3; +(arg?) => 4; +(arg: number) => 5; +(arg: number = 0) => 6; +(arg?: number) => 7; +(...arg: number[]) => 8; +(arg1, arg2) => 12; +(arg1 = 1, arg2 = 3) => 13; +(arg1?, arg2?) => 14; +(arg1: number, arg2: number) => 15; +(arg1: number = 0, arg2: number = 1) => 16; +(arg1?: number, arg2?: number) => 17; +(arg1, ...arg2: number[]) => 18; +(arg1, arg2?: number) => 19; + +// in paren +(() => 21); +((arg) => 22); +((arg = 1) => 23); +((arg?) => 24); +((arg: number) => 25); +((arg: number = 0) => 26); +((arg?: number) => 27); +((...arg: number[]) => 28); + +// in multiple paren +(((((arg) => { return 32; })))); + +// in ternary exression +false ? () => 41 : null; +false ? (arg) => 42 : null; +false ? (arg = 1) => 43 : null; +false ? (arg?) => 44 : null; +false ? (arg: number) => 45 : null; +false ? (arg?: number) => 46 : null; +false ? (arg?: number = 0) => 47 : null; +false ? (...arg: number[]) => 48 : null; + +// in ternary exression within paren +false ? (() => 51) : null; +false ? ((arg) => 52) : null; +false ? ((arg = 1) => 53) : null; +false ? ((arg?) => 54) : null; +false ? ((arg: number) => 55) : null; +false ? ((arg?: number) => 56) : null; +false ? ((arg?: number = 0) => 57) : null; +false ? ((...arg: number[]) => 58) : null; + +// ternary exression's else clause +false ? null : () => 61; +false ? null : (arg) => 62; +false ? null : (arg = 1) => 63; +false ? null : (arg?) => 64; +false ? null : (arg: number) => 65; +false ? null : (arg?: number) => 66; +false ? null : (arg?: number = 0) => 67; +false ? null : (...arg: number[]) => 68; + + +// nested ternary expressions +(a?) => { return a; } ? (b?) => { return b; } : (c?) => { return c; }; + +//multiple levels +(a?) => { return a; } ? (b) => (c) => 81 : (c) => (d) => 82; + + +// In Expressions +((arg) => 90) instanceof Function; +((arg = 1) => 91) instanceof Function; +((arg?) => 92) instanceof Function; +((arg: number) => 93) instanceof Function; +((arg: number = 1) => 94) instanceof Function; +((arg?: number) => 95) instanceof Function; +((...arg: number[]) => 96) instanceof Function; + +'' + (arg) => 100; +((arg) => 0) + '' + (arg) => 101; +((arg = 1) => 0) + '' + (arg = 2) => 102; +((arg?) => 0) + '' + (arg?) => 103; +((arg: number) => 0) + '' + (arg: number) => 104; +((arg: number = 1) => 0) + '' + (arg: number = 2) => 105; +((arg?: number = 1) => 0) + '' + (arg?: number = 2) => 106; +((...arg: number[]) => 0) + '' + (...arg: number[]) => 107; +((arg1, arg2?) => 0) + '' + (arg1, arg2?) => 108; +((arg1, ...arg2: number[]) => 0) + '' + (arg1, ...arg2: number[]) => 108; + + +// Function Parameters +function foo(...arg: any[]) { } + +foo( + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a?) => 113, + (a, b?) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + (a?, b?: number = 0) => 118, + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + (a) => (b) => (c) => 121, + false ? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts new file mode 100644 index 00000000000..314cd416a81 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts @@ -0,0 +1,2 @@ +if(false){debugger;} + if ( false ) { debugger ; } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts new file mode 100644 index 00000000000..c03acf91ecf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts @@ -0,0 +1,2 @@ +if (false) { debugger; } +if (false) { debugger; } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts new file mode 100644 index 00000000000..956309d2c4d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts @@ -0,0 +1,13 @@ +var fun1 = function ( ) { + var x = 'foo' , + z = 'bar' ; + return x ; +}, + +fun2 = ( function ( f ) { + var fun = function ( ) { + console . log ( f ( ) ) ; + }, + x = 'Foo' ; + return fun ; +} ( fun1 ) ) ; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts new file mode 100644 index 00000000000..f1d32283fd7 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts @@ -0,0 +1,13 @@ +var fun1 = function() { + var x = 'foo', + z = 'bar'; + return x; +}, + +fun2 = (function(f) { + var fun = function() { + console.log(f()); + }, + x = 'Foo'; + return fun; +} (fun1)); diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts new file mode 100644 index 00000000000..352a252593b --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts @@ -0,0 +1,3 @@ + export class A { + + } diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts new file mode 100644 index 00000000000..df93540466f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts @@ -0,0 +1,3 @@ +export class A { + +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts new file mode 100644 index 00000000000..afd010fe8b7 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2=Foo; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts new file mode 100644 index 00000000000..d0a4e190d95 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2 = Foo; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts new file mode 100644 index 00000000000..7640013af8b --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts @@ -0,0 +1,95 @@ + +var a;var c , b;var $d +var $e +var f +a++;b++; + +function f ( ) { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m (a[b[c][d]])]; + break; + + switch ( variable){ + case 1: abc += 425; +break; +case 404 : a [x--/2]%=3 ; + break ; + case vari : v[--x ] *=++y*( m + n / k[z]); + for (a in b){ + for (a = 0; a < 10; ++a) { + a++;--a; + if (a == b) { + a++;b--; + } +else +if (a == c){ +++a; +(--c)+=d; +$c = $a + --$b; +} +if (a == b) +if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--;++b; +a++ + } + } + } + for (x in y) { +m-=m; +k=1+2+3+4; +} +} + break; + + } + } + var a ={b:function(){}}; + return {a:1,b:2} +} + +var z = 1; + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) +for (k = 0; k < 10; ++k) { +z++; +} + +for (k = 0; k < 10; k += 2) { +z++; +} + + $(document).ready (); + + + function pageLoad() { + $('#TextBox1' ) . unbind ( ) ; +$('#TextBox1' ) . datepicker ( ) ; +} + + function pageLoad ( ) { + var webclass=[ + { 'student' : + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + } , +{ 'student': +{'id':'2','name':'Adam Davidson','legacySkill':'Cobol,MainFrame'} +} , + { 'student': +{ 'id':'3','name':'Charles Boyer' ,'legacySkill':'HTML, XML'} +} + ]; + +$create(Sys.UI.DataView,{data:webclass},null,null,$get('SList')); + +} + +$( document ).ready(function(){ +alert('hello'); + } ) ; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts new file mode 100644 index 00000000000..30756f547ca --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts @@ -0,0 +1,98 @@ + +var a; var c, b; var $d +var $e +var f +a++; b++; + +function f() { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m(a[b[c][d]])]; + break; + + switch (variable) { + case 1: abc += 425; + break; + case 404: a[x-- / 2] %= 3; + break; + case vari: v[--x] *= ++y * (m + n / k[z]); + for (a in b) { + for (a = 0; a < 10; ++a) { + a++; --a; + if (a == b) { + a++; b--; + } + else + if (a == c) { + ++a; + (--c) += d; + $c = $a + --$b; + } + if (a == b) + if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--; ++b; + a++ + } + } + } + for (x in y) { + m -= m; + k = 1 + 2 + 3 + 4; + } + } + break; + + } + } + var a = { b: function() { } }; + return { a: 1, b: 2 } +} + +var z = 1; +for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + for (k = 0; k < 10; ++k) { + z++; + } + +for (k = 0; k < 10; k += 2) { + z++; +} + +$(document).ready(); + + +function pageLoad() { + $('#TextBox1').unbind(); + $('#TextBox1').datepicker(); +} + +function pageLoad() { + var webclass = [ + { + 'student': + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + }, +{ + 'student': + { 'id': '2', 'name': 'Adam Davidson', 'legacySkill': 'Cobol,MainFrame' } +}, + { + 'student': + { 'id': '3', 'name': 'Charles Boyer', 'legacySkill': 'HTML, XML' } + } + ]; + + $create(Sys.UI.DataView, { data: webclass }, null, null, $get('SList')); + +} + +$(document).ready(function() { + alert('hello'); +}); diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts new file mode 100644 index 00000000000..3030a36630a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts @@ -0,0 +1,3 @@ + module Foo { + export module A . B . C { } + } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts new file mode 100644 index 00000000000..0013b367dcf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts @@ -0,0 +1,3 @@ +module Foo { + export module A.B.C { } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts new file mode 100644 index 00000000000..5ce0d19b632 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts @@ -0,0 +1,76 @@ + module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + + module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + + class c extends mod1.b { +} + + class ib2 implements mod1.ib { +} + + declare export module "m4" { + export class d { + } ; + var x : d ; + export function foo ( ) : d ; +} + + import m4 = module ( "m4" ) ; + export var x4 = m4.x ; + export var d4 = m4.d ; + export var f4 = m4.foo ( ) ; + + export module m1 { + declare export module "m2" { + export class d { + } ; + var x: d ; + export function foo ( ) : d ; + } + import m2 = module ( "m2" ) ; + import m3 = module ( "m4" ) ; + + export var x2 = m2.x ; + export var d2 = m2.d ; + export var f2 = m2.foo ( ) ; + + export var x3 = m3.x ; + export var d3 = m3.d ; + export var f3 = m3.foo ( ) ; +} + + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; + + export module m5 { + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts new file mode 100644 index 00000000000..e6f62024fe6 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts @@ -0,0 +1,76 @@ +module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + +module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + +class c extends mod1.b { +} + +class ib2 implements mod1.ib { +} + +declare export module "m4" { + export class d { + }; + var x: d; + export function foo(): d; +} + +import m4 = module("m4"); +export var x4 = m4.x; +export var d4 = m4.d; +export var f4 = m4.foo(); + +export module m1 { + declare export module "m2" { + export class d { + }; + var x: d; + export function foo(): d; + } + import m2 = module("m2"); + import m3 = module("m4"); + + export var x2 = m2.x; + export var d2 = m2.d; + export var f2 = m2.foo(); + + export var x3 = m3.x; + export var d3 = m3.d; + export var f3 = m3.foo(); +} + +export var x2 = m1.m2.x; +export var d2 = m1.m2.d; +export var f2 = m1.m2.foo(); + +export var x3 = m1.m3.x; +export var d3 = m1.m3.d; +export var f3 = m1.m3.foo(); + +export module m5 { + export var x2 = m1.m2.x; + export var d2 = m1.m2.d; + export var f2 = m1.m2.foo(); + + export var x3 = m1.m3.x; + export var d3 = m1.m3.d; + export var f3 = m1.m3.foo(); +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts new file mode 100644 index 00000000000..dbecc4d4fec --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts @@ -0,0 +1,27 @@ +var x = {foo: 1, +bar: "tt", +boo: 1 + 5}; + +var x2 = {foo: 1, +bar: "tt",boo:1+5}; + +function Foo() { +var typeICalc = { +clear: { +"()": [1, 2, 3] +} +} +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: +3, + 'bar': + { a: 1, b : 2} +}; + +var x={ }; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts new file mode 100644 index 00000000000..3a7fa63d927 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts @@ -0,0 +1,31 @@ +var x = { + foo: 1, + bar: "tt", + boo: 1 + 5 +}; + +var x2 = { + foo: 1, + bar: "tt", boo: 1 + 5 +}; + +function Foo() { + var typeICalc = { + clear: { + "()": [1, 2, 3] + } + } +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: + 3, + 'bar': + { a: 1, b: 2 } +}; + +var x = {}; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts new file mode 100644 index 00000000000..0161f04308d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts @@ -0,0 +1,32 @@ +function f( ) { +var x = 3; + var z = 2 ; + a = z ++ - 2 * x ; + for ( ; ; ) { + a+=(g +g)*a%t; + b -- ; +} + + switch ( a ) + { + case 1 : { + a ++ ; + b--; + if(a===a) + return; + else + { + for(a in b) + if(a!=a) + { + for(a in b) + { +a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts new file mode 100644 index 00000000000..051a4ebd13a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts @@ -0,0 +1,28 @@ +function f() { + var x = 3; + var z = 2; + a = z++ - 2 * x; + for (; ;) { + a += (g + g) * a % t; + b--; + } + + switch (a) { + case 1: { + a++; + b--; + if (a === a) + return; + else { + for (a in b) + if (a != a) { + for (a in b) { + a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts new file mode 100644 index 00000000000..3b5b5456a6f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts @@ -0,0 +1 @@ +var a=b+c^d-e*++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts new file mode 100644 index 00000000000..2ba96e4f88a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts @@ -0,0 +1 @@ +var a = b + c ^ d - e * ++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts new file mode 100644 index 00000000000..7d98d5a8f43 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts @@ -0,0 +1 @@ +class test { constructor () { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts new file mode 100644 index 00000000000..bc124d41baf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts @@ -0,0 +1 @@ +class test { constructor() { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts new file mode 100644 index 00000000000..ec093e0e376 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts @@ -0,0 +1,10 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob + { + Blah=1, Bleah=2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts new file mode 100644 index 00000000000..d0a3db2d51a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts @@ -0,0 +1,9 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob { + Blah = 1, Bleah = 2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts new file mode 100644 index 00000000000..43ef3710ef1 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts @@ -0,0 +1,65 @@ + module MyModule + { + module A.B.C { +module F { +} + } +interface Blah +{ +boo: string; +} + + class Foo + { + +} + +class Foo2 { +public foo():number { +return 5 * 6; +} +public foo2() { +if (1 === 2) + + +{ +var y : number= 76; +return y; +} + + while (2 == 3) { + if ( y == null ) { + +} + } +} + +public foo3() { +if (1 === 2) + +//comment preventing line merging +{ +var y = 76; +return y; +} + +} + } + } + +function foo(a:number, b:number):number +{ +return 0; +} + +function bar(a:number, b:number) :number[] { +return []; +} + +module BugFix3 { +declare var f: { + (): any; + (x: number): string; + foo: number; +}; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts new file mode 100644 index 00000000000..929334e4730 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts @@ -0,0 +1,58 @@ +module MyModule { + module A.B.C { + module F { + } + } + interface Blah { + boo: string; + } + + class Foo { + + } + + class Foo2 { + public foo(): number { + return 5 * 6; + } + public foo2() { + if (1 === 2) { + var y: number = 76; + return y; + } + + while (2 == 3) { + if (y == null) { + + } + } + } + + public foo3() { + if (1 === 2) + + //comment preventing line merging + { + var y = 76; + return y; + } + + } + } +} + +function foo(a: number, b: number): number { + return 0; +} + +function bar(a: number, b: number): number[] { + return []; +} + +module BugFix3 { + declare var f: { + (): any; + (x: number): string; + foo: number; + }; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts new file mode 100644 index 00000000000..bd814c2348e --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts @@ -0,0 +1,17 @@ +function f(a,b,c,d){ +for(var i=0;i<10;i++){ +var a=0; +var b=a+a+a*a%a/2-1; +b+=a; +++b; +f(a,b,c,d); +if(1===1){ +var m=function(e,f){ +return e^f; +} +} +} +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts new file mode 100644 index 00000000000..a4b5ceeb1c2 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts @@ -0,0 +1,17 @@ +function f(a, b, c, d) { + for (var i = 0; i < 10; i++) { + var a = 0; + var b = a + a + a * a % a / 2 - 1; + b += a; + ++b; + f(a, b, c, d); + if (1 === 1) { + var m = function(e, f) { + return e ^ f; + } + } + } +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts new file mode 100644 index 00000000000..66ec4bf546f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts @@ -0,0 +1,9 @@ +with (foo.bar) + + { + + } + +with (bar.blah) +{ +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts new file mode 100644 index 00000000000..f81378d7f82 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts @@ -0,0 +1,6 @@ +with (foo.bar) { + +} + +with (bar.blah) { +} From d028c060348a3890dbb1e5c272a5c2aa964ca518 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:32:18 -0700 Subject: [PATCH 11/21] remove unused folders from unitest runner --- src/harness/runner.ts | 12 +++--------- src/harness/unittestrunner.ts | 28 ++++------------------------ 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 7ea996b24e6..331a19819b3 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -68,17 +68,11 @@ if (testConfigFile !== '') { runners.push(new GeneratedFourslashRunner()); break; case 'unittests': - runners.push(new UnitTestRunner(UnittestTestType.Compiler)); + runners.push(new UnitTestRunner()); break; case 'rwc': runners.push(new RWCRunner()); break; - case 'ls': - runners.push(new UnitTestRunner(UnittestTestType.LanguageService)); - break; - case 'services': - runners.push(new UnitTestRunner(UnittestTestType.Services)); - break; case 'reverse': reverse = true; break; @@ -96,12 +90,12 @@ if (runners.length === 0) { runners.push(new ProjectRunner()); } - //// language services + // language services runners.push(new FourslashRunner()); //runners.push(new GeneratedFourslashRunner()); // unittests - runners.push(new UnitTestRunner(UnittestTestType.Services)); + runners.push(new UnitTestRunner()); } sys.newLine = '\r\n'; diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts index 7b9019788e6..c91b82a0d96 100644 --- a/src/harness/unittestrunner.ts +++ b/src/harness/unittestrunner.ts @@ -1,34 +1,13 @@ /// /// -enum UnittestTestType { - Compiler, - LanguageService, - Services, -} - class UnitTestRunner extends RunnerBase { - constructor(public testType: UnittestTestType) { + constructor() { super(); } public initializeTests() { - switch (this.testType) { - case UnittestTestType.Compiler: - this.tests = this.enumerateFiles('tests/cases/unittests/compiler'); - break; - case UnittestTestType.LanguageService: - this.tests = this.enumerateFiles('tests/cases/unittests/ls'); - break; - case UnittestTestType.Services: - this.tests = this.enumerateFiles('tests/cases/unittests/services', /colorization.ts/); - break; - default: - if (this.tests.length === 0) { - throw new Error('Unsupported test cases: ' + this.testType); - } - break; - } + this.tests = this.enumerateFiles('tests/cases/unittests/services'); var outfile = new Harness.Compiler.WriterAggregator() var outerr = new Harness.Compiler.WriterAggregator(); @@ -63,7 +42,8 @@ class UnitTestRunner extends RunnerBase { after: after, Harness: Harness, IO: Harness.IO, - ts:ts + ts: ts, + TypeScript: TypeScript // FourSlash: FourSlash }; } From 38cacc967fd0a4bc61dceff9dc1995ed48847f64 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:32:43 -0700 Subject: [PATCH 12/21] Enable unit tests for DocumentRegistry --- src/services/services.ts | 5 +- src/services/shims.ts | 4 +- .../unittests/services/documentRegistry.ts | 174 ++---------------- 3 files changed, 24 insertions(+), 159 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 19845f86483..f00825e4b41 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -693,8 +693,7 @@ module ts { compilationSettings: CompilerOptions, scriptSnapshot: TypeScript.IScriptSnapshot, version: number, - isOpen: boolean, - referencedFiles: string[]): SourceFile; + isOpen: boolean): SourceFile; updateDocument( soruceFile: SourceFile, @@ -1350,7 +1349,7 @@ module ts { sourceFile = documentRegistry.updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange); } else { - sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen, []); + sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen); } // Remeber the new sourceFile diff --git a/src/services/shims.ts b/src/services/shims.ts index 891b9e1d913..36e28d3e060 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -837,8 +837,8 @@ module ts { public createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim { try { var hostAdapter = new LanguageServiceShimHostAdapter(host); - var pullLanguageService = createLanguageService(hostAdapter, this.documentRegistry); - return new LanguageServiceShimObject(this, host, pullLanguageService); + var languageService = createLanguageService(hostAdapter, this.documentRegistry); + return new LanguageServiceShimObject(this, host, languageService); } catch (err) { logInternalError(host, err); diff --git a/tests/cases/unittests/services/documentRegistry.ts b/tests/cases/unittests/services/documentRegistry.ts index 871989cc232..a7ed030f44c 100644 --- a/tests/cases/unittests/services/documentRegistry.ts +++ b/tests/cases/unittests/services/documentRegistry.ts @@ -1,172 +1,38 @@ -/// /// -/// - -class TestSourceFile { - constructor( - public fileName: string, - public version: number, - public scriptSnapshot: TypeScript.IScriptSnapshot, - public isOpen: boolean, - public byteOrderMark: TypeScript.ByteOrderMark = TypeScript.ByteOrderMark.Utf8) { - } -} - -class TestHostSettings { - constructor( - public files: TypeScript.StringHashTable, - public compilationSettings: TypeScript.CompilationSettings = TypeScript.ImmutableCompilationSettings.defaultSettings().toCompilationSettings()) { - } -} - -describe("testDocumentRetrievalAndUpdate", () => { - function getHost(settings: TestHostSettings): TypeScript.Services.ILanguageServiceHost { - return { - getCompilationSettings(): TypeScript.CompilationSettings { - return settings.compilationSettings; - }, - - getScriptFileNames(): string[]{ - return settings.files.getAllKeys(); - }, - - getScriptVersion(fileName: string): number { - return settings.files.lookup(fileName).version; - }, - - getScriptIsOpen(fileName: string): boolean { - return settings.files.lookup(fileName).isOpen; - }, - - getScriptByteOrderMark(fileName: string): TypeScript.ByteOrderMark { - return settings.files.lookup(fileName).byteOrderMark; - }, - - getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot { - return settings.files.lookup(fileName).scriptSnapshot; - }, - - getDiagnosticsObject(): TypeScript.Services.ILanguageServicesDiagnostics { - throw TypeScript.Errors.notYetImplemented(); - }, - - getLocalizedDiagnosticMessages(): any { - return null; - }, - - information(): boolean { - return false; - }, - - debug(): boolean { - return false; - }, - - warning(): boolean { - return false; - }, - - error(): boolean { - return false; - }, - - fatal(): boolean { - return false; - }, - - log(s: string): void { - }, - - resolveRelativePath(path: string, directory: string): string { - throw TypeScript.Errors.notYetImplemented(); - }, - fileExists(path: string): boolean { - throw TypeScript.Errors.notYetImplemented(); - }, - directoryExists(path: string): boolean { - throw TypeScript.Errors.notYetImplemented(); - }, - getParentDirectory(path: string): string { - throw TypeScript.Errors.notYetImplemented(); - }, - getCancellationToken(): TypeScript.ICancellationToken { - return TypeScript.CancellationToken.None; - } - } - } - - function getLanguageServiceCompiler(ls: TypeScript.Services.ILanguageService): TypeScript.Services.LanguageServiceCompiler { - return (ls).compiler - } +describe("DocumentRegistry", () => { it("documents are shared between projects", () => { - function ensureDocumentIsShared(prefix: string, ls1: TypeScript.Services.ILanguageService, ls2: TypeScript.Services.ILanguageService, fileName: string): void { - var c1 = getLanguageServiceCompiler(ls1); - var c2 = getLanguageServiceCompiler(ls2); - // getDocument synchronized its internal state with host - var doc1 = c1.getDocument(fileName); - var doc2 = c2.getDocument(fileName); - if (doc1 !== doc2) { - throw new Error(prefix + ":document should be shared between language services"); - } - } - var files = new TypeScript.StringHashTable(); - var f1 = new TestSourceFile("file1.ts", 1, TypeScript.ScriptSnapshot.fromString("var x = 1;"), false); - files.add(f1.fileName, f1); - var factory = new TypeScript.Services.TypeScriptServicesFactory(); + var documentRegistry = ts.createDocumentRegistry(); + var defaultCompilerOptions = ts.getDefaultCompilerOptions(); - var hostSettings = new TestHostSettings(files); - var ls1 = factory.createPullLanguageService(getHost(hostSettings)); - var ls2 = factory.createPullLanguageService(getHost(hostSettings)); + var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); - ensureDocumentIsShared("==1==", ls1, ls2, f1.fileName); - - f1.version = 2; - f1.scriptSnapshot = TypeScript.ScriptSnapshot.fromString("var x = 2;"); - - ensureDocumentIsShared("==2==", ls1, ls2, f1.fileName); + assert(f1 === f2, "DocumentRegistry should return the same document for the same name"); }); it("documents are refreshed when settings in compilation settings affect syntax", () => { - var files = new TypeScript.StringHashTable(); - var f1 = new TestSourceFile("file1.ts", 1, TypeScript.ScriptSnapshot.fromString("var x = 1;"), false); - files.add(f1.fileName, f1); - var factory = new TypeScript.Services.TypeScriptServicesFactory(); - - var hostSettings = new TestHostSettings(files); - - var factory = new TypeScript.Services.TypeScriptServicesFactory(); - var ls = factory.createPullLanguageService(getHost(hostSettings)); - var compiler = getLanguageServiceCompiler(ls); - - var d1 = compiler.getDocument(f1.fileName); + var documentRegistry = ts.createDocumentRegistry(); + var compilerOptions: ts.CompilerOptions = { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.AMD }; // change compilation setting that doesn't affect parsing - should have the same document - hostSettings.compilationSettings.generateDeclarationFiles = !hostSettings.compilationSettings.generateDeclarationFiles; - var d2 = compiler.getDocument(f1.fileName); + compilerOptions.declaration = true; + var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + compilerOptions.declaration = false; + var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + + assert(f1 === f2, "Expected to have the same document instance"); - if (d1 !== d2) { - throw new Error("Expected to have the same document instance"); - } // change value of compilation setting that is used during production of AST - new document is required - hostSettings.compilationSettings.codeGenTarget = TypeScript.LanguageVersion.EcmaScript5; - var d3 = compiler.getDocument(f1.fileName); - if (d2 === d3) { - throw new Error("Changed codeGenTarget: Expected to have different instances of document"); - } + compilerOptions.target = ts.ScriptTarget.ES3; + var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); - hostSettings.compilationSettings.propagateEnumConstants = !hostSettings.compilationSettings.propagateEnumConstants; - var d4 = compiler.getDocument(f1.fileName); - if (d3 === d4) { - throw new Error("Changed propagateEnumConstants: Expected to have different instances of document"); - } + assert(f1 !== f3, "Changed target: Expected to have different instances of document"); - hostSettings.compilationSettings.allowAutomaticSemicolonInsertion = !hostSettings.compilationSettings.allowAutomaticSemicolonInsertion; - var d5 = compiler.getDocument(f1.fileName); - if (d4 === d5) { - throw new Error("Changed allowAutomaticSemicolonInsertion: Expected to have different instances of document"); - } + compilerOptions.module = ts.ModuleKind.CommonJS; + var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + assert(f1 !== f4, "Changed module: Expected to have different instances of document"); }); }); \ No newline at end of file From bae6ddd1b54cf6ab9d855af339cbeb4db56ee3cd Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:51:15 -0700 Subject: [PATCH 13/21] add unterminated multiline comment classification tests --- tests/cases/unittests/services/colorization.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index 157c31fbec7..cba14ae6957 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -191,4 +191,22 @@ describe('Colorization', function () { assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); }); }); + + describe("test cases for colorizing unterminted multi-line comment", function () { + it("unterminated multi-line comment correctelly", function () { + var results = getClassifications("/*", ts.EndOfLineState.Start); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 2, ts.TokenClass.Comment); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); + }); + + it("unterminated multi-line comment with trailing space correctelly", function () { + var results = getClassifications("/* ", ts.EndOfLineState.Start); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 3, ts.TokenClass.Comment); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); + }); + }); }); \ No newline at end of file From ad9a87dfb6e9d9c7b811e92c2320ae306bbdc115 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 10:37:10 -0700 Subject: [PATCH 14/21] Add some huristic optimization to not colorize a keyword if precceded by a dot or a keyword. this should handel cases for "a.var" or "module string { }" --- src/services/services.ts | 83 +++++++++++-------- .../cases/unittests/services/colorization.ts | 33 +++++++- 2 files changed, 82 insertions(+), 34 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index f00825e4b41..63feb8fed42 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -659,6 +659,8 @@ module ts { InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, + EndingWithKeyword, + EndingWithDotToken, } export enum TokenClass { @@ -2217,25 +2219,33 @@ module ts { function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; var lastTokenOrCommentEnd = 0; - var inMultiLineComment = false; + var lastToken = SyntaxKind.Unknown; + var inUnterminatedMultiLineComment = false; - if (lexState !== EndOfLineState.Start) { - // If we're in a string literal, then prepend: "\ - // (and a newline). That way when we lex we'll think we're still in a string literal. - // - // If we're in a multiline comment, then prepend: /* - // (and a newline). That way when we lex we'll think we're still in a multiline comment. - if (lexState === EndOfLineState.InDoubleQuoteStringLiteral) { + // If we're in a string literal, then prepend: "\ + // (and a newline). That way when we lex we'll think we're still in a string literal. + // + // If we're in a multiline comment, then prepend: /* + // (and a newline). That way when we lex we'll think we're still in a multiline comment. + switch (lexState) { + case EndOfLineState.InDoubleQuoteStringLiteral: text = '"\\\n' + text; - } - else if (lexState === EndOfLineState.InSingleQuoteStringLiteral) { + offset = 3; + break; + case EndOfLineState.InSingleQuoteStringLiteral: text = "'\\\n" + text; - } - else if (lexState === EndOfLineState.InMultiLineCommentTrivia) { + offset = 3; + break; + case EndOfLineState.InMultiLineCommentTrivia: text = "/*\n" + text; - } - - offset = 3; + offset = 3; + break; + case EndOfLineState.EndingWithDotToken: + lastToken = SyntaxKind.DotToken; + break; + case EndOfLineState.EndingWithKeyword: + lastToken = SyntaxKind.FirstKeyword; + break; } var result: ClassificationResult = { @@ -2245,11 +2255,8 @@ module ts { scanner = createScanner(ScriptTarget.ES5, text, onError, processComment); - var lastToken = SyntaxKind.Unknown; var token = SyntaxKind.Unknown; do { - inMultiLineComment = false; - token = scanner.scan(); if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastToken]) { @@ -2257,6 +2264,9 @@ module ts { token = SyntaxKind.RegularExpressionLiteral; } } + else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) { + token = SyntaxKind.Identifier; + } lastToken = token; @@ -2268,7 +2278,7 @@ module ts { function onError(message: DiagnosticMessage): void { - inMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; + inUnterminatedMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; } function processComment(start: number, end: number) { @@ -2291,21 +2301,24 @@ module ts { if (end >= text.length) { // We're at the end. - if (inMultiLineComment) { + if (inUnterminatedMultiLineComment) { result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; - return; } - - if (token === SyntaxKind.StringLiteral) { + else if (token === SyntaxKind.StringLiteral) { var tokenText = scanner.getTokenText(); if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.backslash) { var quoteChar = tokenText.charCodeAt(0); result.finalLexState = quoteChar === CharacterCodes.doubleQuote ? EndOfLineState.InDoubleQuoteStringLiteral : EndOfLineState.InSingleQuoteStringLiteral; - return; } } + else if (token === SyntaxKind.DotToken) { + result.finalLexState = EndOfLineState.EndingWithDotToken; + } + else if (isKeyword(token)) { + result.finalLexState = EndOfLineState.EndingWithKeyword; + } } } @@ -2331,8 +2344,8 @@ module ts { } } - function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - switch (tokenKind) { + function isBinaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { case SyntaxKind.AsteriskToken: case SyntaxKind.SlashToken: case SyntaxKind.PercentToken: @@ -2374,8 +2387,8 @@ module ts { } } - function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - switch (tokenKind) { + function isPrefixUnaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { case SyntaxKind.PlusToken: case SyntaxKind.MinusToken: case SyntaxKind.TildeToken: @@ -2388,18 +2401,22 @@ module ts { } } - function classFromKind(kind: SyntaxKind) { - if (kind >= SyntaxKind.FirstKeyword && kind <= SyntaxKind.LastKeyword) { + function isKeyword(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstKeyword && token <= SyntaxKind.LastKeyword; + } + + function classFromKind(token: SyntaxKind) { + if (isKeyword(token)) { return TokenClass.Keyword; } - else if (isBinaryExpressionOperatorToken(kind) || isPrefixUnaryExpressionOperatorToken(kind)) { + else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return TokenClass.Operator; } - else if (kind >= SyntaxKind.FirstPunctuation && kind <= SyntaxKind.LastPunctuation) { + else if (token >= SyntaxKind.FirstPunctuation && token <= SyntaxKind.LastPunctuation) { return TokenClass.Punctuation; } - switch (kind) { + switch (token) { case SyntaxKind.NumericLiteral: return TokenClass.NumberLiteral; case SyntaxKind.StringLiteral: diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index cba14ae6957..2b9afdb6ef1 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -28,15 +28,21 @@ describe('Colorization', function () { var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; + var computedLength = 0; for (; i < classResult.length - 1; i += 2) { - tuples[i / 2] = { + var t = tuples[i / 2] = { length: parseInt(classResult[i]), class: parseInt(classResult[i + 1]) }; + + assert.isTrue(t.length > 0, "Result length should be greater than 0, got :" + t.length); + computedLength += t.length; } var finalEndOfLineState = classResult[classResult.length - 1]; + assert.equal(computedLength, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + computedLength); + return { tuples: tuples, finalEndOfLineState: parseInt(finalEndOfLineState) @@ -209,4 +215,29 @@ describe('Colorization', function () { assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); }); }); + + describe("test cases for colorizing keywords", function () { + it("classifies keyword after a dot", function () { + var results = getClassifications("a.var", ts.EndOfLineState.Start); + verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); + }); + + it("classifies keyword after a keyword", function () { + var results = getClassifications("module string", ts.EndOfLineState.Start); + verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier); + }); + + it("reports correct state with a line ending in a keyword", function () { + var results = getClassifications("module", ts.EndOfLineState.Start); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword); + }); + + it("classifies keyword after a dot on previous line", function () { + var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 3, ts.TokenClass.Identifier); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); + }); + }); }); \ No newline at end of file From 17c45ed986921fde08ea37097b38962b5b393130 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 16:43:31 -0700 Subject: [PATCH 15/21] revert changes to classify a keyword as an identifier if the last token is keyword --- src/services/services.ts | 9 +-------- tests/cases/unittests/services/colorization.ts | 10 ---------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 63feb8fed42..7379ce5747f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -659,7 +659,6 @@ module ts { InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, - EndingWithKeyword, EndingWithDotToken, } @@ -2243,9 +2242,6 @@ module ts { case EndOfLineState.EndingWithDotToken: lastToken = SyntaxKind.DotToken; break; - case EndOfLineState.EndingWithKeyword: - lastToken = SyntaxKind.FirstKeyword; - break; } var result: ClassificationResult = { @@ -2264,7 +2260,7 @@ module ts { token = SyntaxKind.RegularExpressionLiteral; } } - else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) { + else if (lastToken === SyntaxKind.DotToken) { token = SyntaxKind.Identifier; } @@ -2316,9 +2312,6 @@ module ts { else if (token === SyntaxKind.DotToken) { result.finalLexState = EndOfLineState.EndingWithDotToken; } - else if (isKeyword(token)) { - result.finalLexState = EndOfLineState.EndingWithKeyword; - } } } diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index 2b9afdb6ef1..e395f20490c 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -222,16 +222,6 @@ describe('Colorization', function () { verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); }); - it("classifies keyword after a keyword", function () { - var results = getClassifications("module string", ts.EndOfLineState.Start); - verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier); - }); - - it("reports correct state with a line ending in a keyword", function () { - var results = getClassifications("module", ts.EndOfLineState.Start); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword); - }); - it("classifies keyword after a dot on previous line", function () { var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); From be47b94c8f6a025b0bba9c453c42930296dba45e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 16:45:10 -0700 Subject: [PATCH 16/21] clean up tests --- .../cases/unittests/services/colorization.ts | 281 +++++++----------- 1 file changed, 113 insertions(+), 168 deletions(-) diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index e395f20490c..414942bbded 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -1,4 +1,5 @@ interface Classification { + position: number; length: number; class: ts.TokenClass; } @@ -8,17 +9,10 @@ interface ClassiferResult { finalEndOfLineState: ts.EndOfLineState; } -var TokenClassNames = {}; -TokenClassNames[ts.TokenClass.Punctuation] = "Punctuation"; -TokenClassNames[ts.TokenClass.Keyword] = "Keyword"; -TokenClassNames[ts.TokenClass.Operator] = "Operator"; -TokenClassNames[ts.TokenClass.Comment] = "Comment"; -TokenClassNames[ts.TokenClass.Whitespace] = "Whitespace"; -TokenClassNames[ts.TokenClass.Identifier] = "Identifier"; -TokenClassNames[ts.TokenClass.NumberLiteral] = "NumberLiteral"; -TokenClassNames[ts.TokenClass.StringLiteral] = "StringLiteral"; -TokenClassNames[ts.TokenClass.RegExpLiteral] = "RegExpLiteral"; - +interface ClassificationEntry { + value: any; + class: ts.TokenClass; +} describe('Colorization', function () { var mytypescriptLS = new Harness.LanguageService.TypeScriptLS(); @@ -28,20 +22,21 @@ describe('Colorization', function () { var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; - var computedLength = 0; + var position = 0; for (; i < classResult.length - 1; i += 2) { var t = tuples[i / 2] = { + position: position, length: parseInt(classResult[i]), class: parseInt(classResult[i + 1]) }; assert.isTrue(t.length > 0, "Result length should be greater than 0, got :" + t.length); - computedLength += t.length; + position += t.length; } var finalEndOfLineState = classResult[classResult.length - 1]; - assert.equal(computedLength, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + computedLength); + assert.equal(position, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + position); return { tuples: tuples, @@ -52,182 +47,132 @@ describe('Colorization', function () { function verifyClassification(classification: Classification, expectedLength: number, expectedClass: number) { assert.isNotNull(classification); assert.equal(classification.length, expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); - assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class]); + assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + ts.TokenClass[expectedClass] + ", Actual: " + ts.TokenClass[classification.class]); } - describe("test cases for colorization", function () { - var results = getClassifications('var x:string = "foo"; //Hello'); + function getEntryAtPosistion(result: ClassiferResult, position: number) { + for (var i = 0, n = result.tuples.length; i < n; i++) { + if (result.tuples[i].position === position) return result.tuples[i]; + } + return undefined; + } - it("checks for a keyword", function () { - verifyClassification(results.tuples[0], 3, ts.TokenClass.Keyword); + function punctuation(text: string) { return { value: text, class: ts.TokenClass.Punctuation }; } + function keyword(text: string) { return { value: text, class: ts.TokenClass.Keyword }; } + function operator(text: string) { return { value: text, class: ts.TokenClass.Operator }; } + function comment(text: string) { return { value: text, class: ts.TokenClass.Comment }; } + function whitespace(text: string) { return { value: text, class: ts.TokenClass.Whitespace }; } + function identifier(text: string) { return { value: text, class: ts.TokenClass.Identifier }; } + function numberLiteral(text: string) { return { value: text, class: ts.TokenClass.NumberLiteral }; } + function stringLiteral(text: string) { return { value: text, class: ts.TokenClass.StringLiteral }; } + function regExpLiteral(text: string) { return { value: text, class: ts.TokenClass.RegExpLiteral }; } + function finalEndOfLineState(value: number) { return { value: value, class: undefined }; } + + function test(text: string, initialEndOfLineState: ts.EndOfLineState, ...expectedEntries: ClassificationEntry[]): void { + var result = getClassifications(text, initialEndOfLineState); + + for (var i = 0, n = expectedEntries.length; i < n; i++) { + var expectedEntry = expectedEntries[i]; + + if (expectedEntry.class === undefined) { + assert.equal(result.finalEndOfLineState, expectedEntry.value, "final endOfLineState does not match expected."); + } + else { + var actualEntryPosition = text.indexOf(expectedEntry.value); + assert(actualEntryPosition >= 0, "token: '" + expectedEntry.value + "' does not exit in text: '" + text + "'."); + + var actualEntry = getEntryAtPosistion(result, actualEntryPosition); + + assert(actualEntry, "Could not find classification entry for '" + expectedEntry.value + "' at position: " + actualEntryPosition); + assert.equal(actualEntry.length, expectedEntry.value.length, "Classification class does not match expected."); + assert.equal(actualEntry.class, expectedEntry.class, "Classification class does not match expected."); + } + } + } + + describe("test getClassifications", function () { + it("Returns correct token classes", function () { + test("var x: string = \"foo\"; //Hello", + ts.EndOfLineState.Start, + keyword("var"), + whitespace(" "), + identifier("x"), + punctuation(":"), + keyword("string"), + operator("="), + stringLiteral("\"foo\""), + comment("//Hello"), + punctuation(";")); }); - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); + it("classifies correctelly a comment after a divide operator", function () { + test("1 / 2 // comment", + ts.EndOfLineState.Start, + numberLiteral("1"), + whitespace(" "), + operator("/"), + numberLiteral("2"), + comment("// comment")); }); - it("checks for a identifier", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Identifier); + it("classifies correctelly a literal after a divide operator", function () { + test("1 / 2, 3 / 4", + ts.EndOfLineState.Start, + numberLiteral("1"), + whitespace(" "), + operator("/"), + numberLiteral("2"), + numberLiteral("3"), + numberLiteral("4"), + operator(",")); }); - it("checks for an punctuation", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Punctuation); + it("classifies correctelly an unterminated multi-line string", function () { + test("'line1\\", + ts.EndOfLineState.Start, + stringLiteral("'line1\\"), + finalEndOfLineState(ts.EndOfLineState.InSingleQuoteStringLiteral)); }); - it("checks for a operator", function () { - verifyClassification(results.tuples[6], 1, ts.TokenClass.Operator); + it("classifies correctelly the second line of an unterminated multi-line string", function () { + test("\\", + ts.EndOfLineState.InDoubleQuoteStringLiteral, + stringLiteral("\\"), + finalEndOfLineState(ts.EndOfLineState.InDoubleQuoteStringLiteral)); }); - it("checks for a string literal", function () { - verifyClassification(results.tuples[8], 5, ts.TokenClass.StringLiteral); + it("classifies correctelly the last line of a multi-line string", function () { + test("'", + ts.EndOfLineState.InSingleQuoteStringLiteral, + stringLiteral("'"), + finalEndOfLineState(ts.EndOfLineState.Start)); }); - it("checks for a comment", function () { - verifyClassification(results.tuples[11], 7, ts.TokenClass.Comment); - }); - }); - - describe("test comment colorization after a divide operator", function () { - var results = getClassifications('1 / 1 // comment'); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); + it("classifies correctelly an unterminated multiline comment", function () { + test("/*", + ts.EndOfLineState.Start, + comment("/*"), + finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia)); }); - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); + it("classifies correctelly an unterminated multiline comment with trailing space", function () { + test("/* ", + ts.EndOfLineState.Start, + comment("/* "), + finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia)); }); - it("checks for a operator", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[5], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a comment", function () { - verifyClassification(results.tuples[6], 10, ts.TokenClass.Comment); - }); - }); - - describe("test literal colorization after a divide operator", function () { - var results = getClassifications('1 / 2, 1 / 2'); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[5], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[6], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[7], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[8], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[9], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[10], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[11], 1, ts.TokenClass.NumberLiteral); - }); - - }); - - describe("test cases for colorizing multi-line string", function () { - it("classifies first line correctelly", function () { - var results = getClassifications("'line1\\", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 7, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InSingleQuoteStringLiteral); - }); - - it("classifies second line correctelly", function () { - var results = getClassifications("\\", ts.EndOfLineState.InDoubleQuoteStringLiteral); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InDoubleQuoteStringLiteral); - }); - - it("classifies third line correctelly", function () { - var results = getClassifications("'", ts.EndOfLineState.InSingleQuoteStringLiteral); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); - }); - }); - - describe("test cases for colorizing unterminted multi-line comment", function () { - it("unterminated multi-line comment correctelly", function () { - var results = getClassifications("/*", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 2, ts.TokenClass.Comment); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); - }); - - it("unterminated multi-line comment with trailing space correctelly", function () { - var results = getClassifications("/* ", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 3, ts.TokenClass.Comment); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); - }); - }); - - describe("test cases for colorizing keywords", function () { - it("classifies keyword after a dot", function () { - var results = getClassifications("a.var", ts.EndOfLineState.Start); - verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); + it("classifies correctelly a keyword after a dot", function () { + test("a.var", + ts.EndOfLineState.Start, + identifier("var")); }); it("classifies keyword after a dot on previous line", function () { - var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 3, ts.TokenClass.Identifier); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); + test("var", + ts.EndOfLineState.EndingWithDotToken, + identifier("var"), + finalEndOfLineState(ts.EndOfLineState.Start)); }); }); }); \ No newline at end of file From e6c42faa7c6a0b17b2a3801590022ed0b5afa913 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 12 Aug 2014 13:47:48 -0700 Subject: [PATCH 17/21] Addressed CR feedback, removed NoPrefix messages. --- src/compiler/diagnosticInformationMap.generated.ts | 14 +++++++------- src/compiler/diagnosticMessages.json | 14 +++++++------- src/compiler/parser.ts | 2 +- src/compiler/types.ts | 1 - 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index ccf9f9249d3..b14bb896a10 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -23,7 +23,7 @@ module ts { An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_am_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede am 'implements' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." }, A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, @@ -53,7 +53,7 @@ module ts { Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_comment: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid reference comment." }, + Invalid_reference_directive_syntax: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, @@ -208,12 +208,12 @@ module ts { Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Index_signature_is_missing_in_type_0: { code: 4003, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible_Colon: { code: 4004, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 4024, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: DiagnosticCategory.NoPrefix, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4b037688492..770cba1509b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -84,7 +84,7 @@ "category": "Error", "code": 1024 }, - "An 'extends' clause must precede am 'implements' clause.": { + "An 'extends' clause must precede an 'implements' clause.": { "category": "Error", "code": 1025 }, @@ -204,7 +204,7 @@ "category": "Error", "code": 1079 }, - "Invalid reference comment.": { + "Invalid 'reference' directive syntax.": { "category": "Error", "code": 1084 }, @@ -827,19 +827,19 @@ "code": 4004 }, "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "NoPrefix", + "category": "Error", "code": 4016 }, "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "NoPrefix", + "category": "Error", "code": 4017 }, "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "category": "NoPrefix", + "category": "Error", "code": 4018 }, "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "category": "NoPrefix", + "category": "Error", "code": 4019 }, "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { @@ -847,7 +847,7 @@ "code": 4024 }, "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { - "category": "NoPrefix", + "category": "Error", "code": 4032 }, "The current host does not support the '{0}' option.": { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6ce418452cc..b8ac11efc20 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3501,7 +3501,7 @@ module ts { if (!matchResult) { var start = range.pos; var length = range.end - start; - errorAtPos(start, length, Diagnostics.Invalid_reference_comment); + errorAtPos(start, length, Diagnostics.Invalid_reference_directive_syntax); } else { referencedFiles.push({ diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2c9284052d5..57319ff58b2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -931,7 +931,6 @@ module ts { Warning, Error, Message, - NoPrefix } export interface CompilerOptions { From 978855678db190f9e1303a5e085ea766e1546946 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 12 Aug 2014 15:15:45 -0700 Subject: [PATCH 18/21] Removed duplicate diagnostic. --- src/compiler/diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index b14bb896a10..bf4fca34f10 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -48,7 +48,7 @@ module ts { A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, + Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 770cba1509b..ea6f596eb5a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1291,10 +1291,6 @@ "category": "Error", "code": -9999999 }, - "Enum member must have initializer.": { - "category": "Error", - "code": -9999999 - }, "Ambient external modules cannot be nested in other modules.": { "category": "Error", "code": -9999999 From a366984bc94d42f12ae2ca1aee76bd5ccdfad90f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 18 Aug 2014 15:35:37 -0700 Subject: [PATCH 19/21] Reassigned diagnostic codes. --- .../diagnosticInformationMap.generated.ts | 514 ++--- src/compiler/diagnosticMessages.json | 1824 +++++++++-------- src/compiler/parser.ts | 5 +- .../reference/ExportAssignment7.errors.txt | 4 +- .../reference/ExportAssignment8.errors.txt | 4 +- .../arrowFunctionContexts.errors.txt | 8 +- .../reference/callOverloads1.errors.txt | 4 +- ...faceIncompatibleWithBaseIndexer.errors.txt | 8 +- ...ontShowCompilerGeneratedMembers.errors.txt | 4 +- .../duplicateSymbolsExportMatching.errors.txt | 4 +- ...rsiveImplicitConstructorErrors3.errors.txt | 4 +- ...dexSignaturesFromDifferentBases.errors.txt | 8 +- .../interfaceExtendingClass2.errors.txt | 4 +- ...OverloadMixingStaticAndInstance.errors.txt | 16 +- .../parserExportAssignment7.errors.txt | 4 +- .../parserExportAssignment8.errors.txt | 4 +- .../reference/parserForStatement3.errors.txt | 4 +- .../parserGenericsInTypeContexts1.errors.txt | 4 +- .../parserGenericsInTypeContexts2.errors.txt | 4 +- .../reference/parserStrictMode14.errors.txt | 4 +- .../parserWithStatement1.d.errors.txt | 4 +- .../propertiesAndIndexers.errors.txt | 8 +- ...rUsedAsTypeParameterConstraint4.errors.txt | 16 +- .../reference/unknownSymbols1.errors.txt | 4 +- 24 files changed, 1234 insertions(+), 1233 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 972968c115a..eb787cf91e0 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -2,9 +2,6 @@ /// module ts { export var Diagnostics = { - Unknown_compiler_option_0: { code: 6001, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, - File_0_not_found: { code: 6002, category: DiagnosticCategory.Error, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." }, _0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." }, @@ -70,7 +67,6 @@ module ts { Invalid_use_of_0_in_strict_mode: { code: 1100, category: DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, - Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, @@ -88,193 +84,259 @@ module ts { An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, - Duplicate_identifier_0: { code: 2000, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 2020, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2021, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2022, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 2023, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 2024, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 2025, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 2026, category: DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 2027, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2028, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2029, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2030, category: DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 2031, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 2032, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 2033, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 2034, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2035, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2036, category: DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 2037, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 2038, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 2039, category: DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 2040, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2041, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2042, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2043, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2044, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2045, category: DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2046, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2047, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2048, category: DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 2049, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 2050, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 2051, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 2052, category: DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 2053, category: DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 2054, category: DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 2055, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 2056, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 2057, category: DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 2058, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 2059, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 2060, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 2061, category: DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 2062, category: DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 2063, category: DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 2064, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 2065, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 2066, category: DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 2067, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Import_declaration_0_is_using_private_name_1: { code: 2181, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2208, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2209, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 2210, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 2211, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 2212, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 2213, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2214, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2215, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2216, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2217, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2218, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 2219, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 2220, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 2221, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2222, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2223, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: DiagnosticCategory.Error, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: DiagnosticCategory.Error, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: DiagnosticCategory.Error, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: DiagnosticCategory.Error, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: DiagnosticCategory.Error, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: DiagnosticCategory.Error, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: DiagnosticCategory.Error, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: DiagnosticCategory.Error, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: DiagnosticCategory.Error, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: DiagnosticCategory.Error, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: DiagnosticCategory.Error, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: DiagnosticCategory.Error, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: DiagnosticCategory.Error, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: DiagnosticCategory.Error, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: DiagnosticCategory.Error, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: DiagnosticCategory.Error, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: DiagnosticCategory.Error, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: DiagnosticCategory.Error, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, - A_class_may_only_implement_another_class_or_interface: { code: 2074, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, - get_and_set_accessor_must_have_the_same_type: { code: 2096, category: DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, - Static_members_cannot_reference_class_type_parameters: { code: 2099, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2126, category: DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2131, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - Setters_cannot_return_a_value: { code: 2122, category: DiagnosticCategory.Error, key: "Setters cannot return a value." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2135, category: DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - Overload_signatures_must_all_be_public_or_private: { code: 2150, category: DiagnosticCategory.Error, key: "Overload signatures must all be public or private." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2161, category: DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2189, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2192, category: DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2200, category: DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2206, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: DiagnosticCategory.Error, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Duplicate_string_index_signature: { code: 2232, category: DiagnosticCategory.Error, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2233, category: DiagnosticCategory.Error, key: "Duplicate number index signature." }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Function_implementation_name_must_be_0: { code: 2239, category: DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2240, category: DiagnosticCategory.Error, key: "Constructor implementation is missing." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, - Function_overload_must_be_static: { code: 2247, category: DiagnosticCategory.Error, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2248, category: DiagnosticCategory.Error, key: "Function overload must not be static." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2249, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2250, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2251, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2252, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2253, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2254, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 2255, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 2256, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 2257, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 2258, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 2259, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 2260, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Circular_definition_of_import_alias_0: { code: 3000, category: DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 3001, category: DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 3002, category: DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - Cannot_find_external_module_0: { code: 3003, category: DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 3006, category: DiagnosticCategory.Error, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, - Generic_type_0_requires_1_type_argument_s: { code: 3008, category: DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 3009, category: DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, - Cannot_find_global_type_0: { code: 3010, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, - this_cannot_be_referenced_in_a_module_body: { code: 3013, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, - this_cannot_be_referenced_in_current_location: { code: -9999999, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, - super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, - Property_0_does_not_exist_on_type_1: { code: 3017, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 3027, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 3029, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}' and '{1}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Duplicate_function_implementation: { code: 3034, category: DiagnosticCategory.Error, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Index_signature_is_missing_in_type_0: { code: 4003, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 4004, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 4024, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: DiagnosticCategory.Error, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: 2325, category: DiagnosticCategory.Error, key: "Private property '{0}' cannot be reimplemented." }, + Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: DiagnosticCategory.Error, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_inaccessible: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 2367, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}' and '{1}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: DiagnosticCategory.Error, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: DiagnosticCategory.Error, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_or_private: { code: 2385, category: DiagnosticCategory.Error, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: DiagnosticCategory.Error, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: DiagnosticCategory.Error, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: DiagnosticCategory.Error, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: DiagnosticCategory.Error, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: DiagnosticCategory.Error, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: DiagnosticCategory.Error, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.Error, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, @@ -306,13 +368,15 @@ module ts { Generates_corresponding_map_file: { code: 6043, category: DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6045, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6047, category: DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6048, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 7004, category: DiagnosticCategory.Message, key: "Warn on expressions and declarations with an implied 'any' type." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: DiagnosticCategory.Message, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: DiagnosticCategory.Error, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -325,69 +389,5 @@ module ts { Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Variable_declaration_list_cannot_be_empty: { code: -9999999, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: -9999999, category: DiagnosticCategory.Error, key: "Unexpected end of text." }, - Invalid_character: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid character." }, - Declaration_or_statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration or statement expected." }, - Statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Statement expected." }, - case_or_default_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Property or signature expected." }, - Enum_member_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum member expected." }, - Type_reference_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type reference expected." }, - Variable_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Variable declaration expected." }, - Argument_expression_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Argument expression expected." }, - Property_assignment_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type argument expected." }, - String_literal_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "String literal expected." }, - Line_break_not_permitted_here: { code: -9999999, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration expected." }, - File_0_is_not_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: -9999999, category: DiagnosticCategory.Error, key: "Private property '{0}' cannot be reimplemented." }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: DiagnosticCategory.Error, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: DiagnosticCategory.Error, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, - Import_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Type_parameter_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, - Class_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, - Interface_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, - Enum_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, - Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Property_0_is_inaccessible: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, - Class_0_incorrectly_implements_interface_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: DiagnosticCategory.Error, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: DiagnosticCategory.Error, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: -9999999, category: DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: -9999999, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5daacb1f7aa..104cd76b5a0 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1,17 +1,4 @@ { - "Unknown compiler option '{0}'.": { - "category": "Error", - "code": 6001 - }, - "File '{0}' not found.": { - "category": "Error", - "code": 6002 - }, - "File '{0}' must have extension '.ts' or '.d.ts'.": { - "category": "Error", - "code": 6003 - }, - "Unterminated string literal.": { "category": "Error", "code": 1002 @@ -272,10 +259,6 @@ "category": "Error", "code": 1102 }, - "Invalid left-hand side in 'for...in' statement.": { - "category": "Error", - "code": 1103 - }, "A 'continue' statement can only be used within an enclosing iteration statement.": { "category": "Error", "code": 1104 @@ -344,740 +327,1002 @@ "category": "Error", "code": 1121 }, - "Duplicate identifier '{0}'.": { + "Variable declaration list cannot be empty.": { "category": "Error", - "code": 2000 + "code": 1123 }, - "Extends clause of exported class '{0}' has or is using private name '{1}'.": { + "Digit expected.": { "category": "Error", - "code": 2018 + "code": 1124 }, - "Implements clause of exported class '{0}' has or is using private name '{1}'.": { + "Hexadecimal digit expected.": { "category": "Error", - "code": 2019 + "code": 1125 }, - "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { + "Unexpected end of text.": { "category": "Error", - "code": 2020 + "code": 1126 }, - "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { + "Invalid character.": { "category": "Error", - "code": 2021 + "code": 1127 }, - "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { + "Declaration or statement expected.": { "category": "Error", - "code": 2022 + "code": 1128 }, - "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'.": { + "Statement expected.": { "category": "Error", - "code": 2023 + "code": 1129 }, - "Public static property '{0}' of exported class has or is using private name '{1}'.": { + "'case' or 'default' expected.": { "category": "Error", - "code": 2024 + "code": 1130 }, - "Public property '{0}' of exported class has or is using private name '{1}'.": { + "Property or signature expected.": { "category": "Error", - "code": 2025 + "code": 1131 }, - "Property '{0}' of exported interface has or is using private name '{1}'.": { + "Enum member expected.": { "category": "Error", - "code": 2026 + "code": 1132 }, - "Exported variable '{0}' has or is using private name '{1}'.": { + "Type reference expected.": { "category": "Error", - "code": 2027 + "code": 1133 }, - "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "Variable declaration expected.": { "category": "Error", - "code": 2028 + "code": 1134 }, - "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "Argument expression expected.": { "category": "Error", - "code": 2029 + "code": 1135 }, - "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { + "Property assignment expected.": { "category": "Error", - "code": 2030 + "code": 1136 }, - "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { + "Expression or comma expected.": { "category": "Error", - "code": 2031 + "code": 1137 }, - "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { + "Parameter declaration expected.": { "category": "Error", - "code": 2032 + "code": 1138 }, - "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { + "Type parameter declaration expected.": { "category": "Error", - "code": 2033 + "code": 1139 }, - "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { + "Type argument expected.": { "category": "Error", - "code": 2034 + "code": 1140 }, - "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "String literal expected.": { "category": "Error", - "code": 2035 + "code": 1141 }, - "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "Line break not permitted here.": { "category": "Error", - "code": 2036 + "code": 1142 }, - "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "'catch' or 'finally' expected.": { "category": "Error", - "code": 2037 + "code": 1143 }, - "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "Block or ';' expected.": { "category": "Error", - "code": 2038 + "code": 1144 }, - "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "Modifiers not permitted on index signature members.": { "category": "Error", - "code": 2039 + "code": 1145 }, - "Parameter '{0}' of exported function has or is using private name '{1}'.": { + "Declaration expected.": { "category": "Error", - "code": 2040 + "code": 1146 }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { + "Import declarations in an internal module cannot reference an external module.": { "category": "Error", - "code": 2041 + "code": 1147 }, - "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "Cannot compile external modules unless the '--module' flag is provided.": { "category": "Error", - "code": 2042 + "code": 1148 }, - "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "Filename '{0}' differs from already included filename '{1}' only in casing": { "category": "Error", - "code": 2043 - }, - "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2044 - }, - "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2045 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2046 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2047 - }, - "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2048 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2049 - }, - "Return type of public static property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 2050 - }, - "Return type of public property getter from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 2051 - }, - "Return type of constructor signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 2052 - }, - "Return type of call signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 2053 - }, - "Return type of index signature from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 2054 - }, - "Return type of public static method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 2055 - }, - "Return type of public method from exported class has or is using private name '{0}'.": { - "category": "Error", - "code": 2056 - }, - "Return type of method from exported interface has or is using private name '{0}'.": { - "category": "Error", - "code": 2057 - }, - "Return type of exported function has or is using private name '{0}'.": { - "category": "Error", - "code": 2058 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2059 - }, - "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2060 - }, - "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2061 - }, - "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2062 - }, - "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2063 - }, - "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2064 - }, - "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2065 - }, - "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2066 - }, - "Return type of exported function has or is using name '{0}' from private module '{1}'.": { - "category": "Error", - "code": 2067 - }, - "Import declaration '{0}' is using private name '{1}'.": { - "category": "Error", - "code": 2181 - }, - "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 2208 - }, - "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 2209 - }, - "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 2210 - }, - "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 2211 - }, - "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 2212 - }, - "Type parameter '{0}' of exported function has or is using private name '{1}'.": { - "category": "Error", - "code": 2213 - }, - "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2214 - }, - "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2215 - }, - "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2216 - }, - "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2217 - }, - "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2218 - }, - "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2219 - }, - "Type parameter '{0}' of exported class has or is using private name '{1}'.": { - "category": "Error", - "code": 2220 - }, - "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { - "category": "Error", - "code": 2221 - }, - "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2222 - }, - "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 2223 + "code": 1149 }, "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { + "category": "Error", + "code": 1150 + }, + + "Duplicate identifier '{0}'.": { "category": "Error", - "code": 2068 - }, - "Multiple constructor implementations are not allowed.": { - "category": "Error", - "code": 2070 - }, - "A class may only implement another class or interface.": { - "category": "Error", - "code": 2074 - }, - "'get' and 'set' accessor must have the same type.": { - "category": "Error", - "code": 2096 - }, - "Static members cannot reference class type parameters.": { - "category": "Error", - "code": 2099 - }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { - "category": "Error", - "code": 2102 - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2112 - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2113 - }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { - "category": "Error", - "code": 2114 - }, - "The left-hand side of a 'for...in' statement cannot use a type annotation.": { - "category": "Error", - "code": 2115 - }, - "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { - "category": "Error", - "code": 2116 - }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2117 - }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { - "category": "Error", - "code": 2118 - }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { - "category": "Error", - "code": 2119 - }, - "A 'get' accessor must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2126 - }, - "Getter and setter accessors do not agree in visibility.": { - "category": "Error", - "code": 2127 - }, - "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { - "category": "Error", - "code": 2131 - }, - "Untyped function calls may not accept type arguments.": { - "category": "Error", - "code": 2158 - }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { - "category": "Error", - "code": 2120 - }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { - "category": "Error", - "code": 2121 - }, - "Setters cannot return a value.": { - "category": "Error", - "code": 2122 - }, - "Invalid left-hand side of assignment expression.": { - "category": "Error", - "code": 2130 - }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { - "category": "Error", - "code": 2134 - }, - "All symbols within a 'with' block will be resolved to 'any'.": { - "category": "Error", - "code": 2135 - }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { - "category": "Error", - "code": 2139 - }, - "Overload signatures must all be public or private.": { - "category": "Error", - "code": 2150 - }, - "Overload signatures must all be exported or not exported.": { - "category": "Error", - "code": 2151 - }, - "Overload signatures must all be ambient or non-ambient.": { - "category": "Error", - "code": 2152 - }, - "Overload signatures must all be optional or required.": { - "category": "Error", - "code": 2153 - }, - "'this' cannot be referenced in constructor arguments.": { - "category": "Error", - "code": 2155 - }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { - "category": "Error", - "code": 2161 - }, - "A signature with an implementation cannot use a string literal type.": { - "category": "Error", - "code": 2163 - }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { - "category": "Error", - "code": 2189 - }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { - "category": "Error", - "code": 2190 - }, - "Individual declarations in merged declaration {0} must be all exported or all local.": { - "category": "Error", - "code": 2192 - }, - "'super' cannot be referenced in constructor arguments.":{ - "category": "Error", - "code": 2193 - }, - "Return type of constructor signature must be assignable to the instance type of the class":{ - "category": "Error", - "code": 2194 - }, - "Ambient external module declaration cannot specify relative module name.":{ - "category": "Error", - "code": 2196 - }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { - "category": "Error", - "code": 2197 - }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { - "category": "Error", - "code": 2200 - }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { - "category": "Error", - "code": 2205 - }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { - "category": "Error", - "code": 2206 - }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { - "category": "Error", - "code": 2207 - }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { - "category": "Error", - "code": 2224 - }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { - "category": "Error", - "code": 2225 - }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { - "category": "Error", - "code": 2229 + "code": 2300 }, "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { "category": "Error", - "code": 2230 + "code": 2301 }, - "Parameter '{0}' cannot be referenced in its initializer.": { + "Static members cannot reference class type parameters.": { "category": "Error", - "code": 2231 - }, - "Duplicate string index signature.": { - "category": "Error", - "code": 2232 - }, - "Duplicate number index signature.": { - "category": "Error", - "code": 2233 - }, - "All declarations of an interface must have identical type parameters.": { - "category": "Error", - "code": 2234 - }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { - "category": "Error", - "code": 2235 - }, - "Function implementation name must be '{0}'.": { - "category": "Error", - "code": 2239 - }, - "Constructor implementation is missing.": { - "category": "Error", - "code": 2240 - }, - "An export assignment cannot be used in a module with other exported elements.": { - "category": "Error", - "code": 2245 - }, - "A parameter property is only allowed in a constructor implementation.": { - "category": "Error", - "code": 2246 - }, - "Function overload must be static.": { - "category": "Error", - "code": 2247 - }, - "Function overload must not be static.": { - "category": "Error", - "code": 2248 - }, - "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2249 - }, - "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2250 - }, - "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2251 - }, - "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2252 - }, - "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2253 - }, - "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2254 - }, - "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 2255 - }, - "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 2256 - }, - "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 2257 - }, - "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 2258 - }, - "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 2259 - }, - "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { - "category": "Error", - "code": 2260 + "code": 2302 }, "Circular definition of import alias '{0}'.": { "category": "Error", - "code": 3000 + "code": 2303 }, "Cannot find name '{0}'.": { "category": "Error", - "code": 3001 + "code": 2304 }, "Module '{0}' has no exported member '{1}'.": { "category": "Error", - "code": 3002 + "code": 2305 + }, + "File '{0}' is not an external module.": { + "category": "Error", + "code": 2306 }, "Cannot find external module '{0}'.": { "category": "Error", - "code": 3003 + "code": 2307 }, "A module cannot have more than one export assignment.": { "category": "Error", - "code": 3004 + "code": 2308 + }, + "An export assignment cannot be used in a module with other exported elements.": { + "category": "Error", + "code": 2309 }, "Type '{0}' recursively references itself as a base type.": { "category": "Error", - "code": 3005 + "code": 2310 }, "A class may only extend another class.": { "category": "Error", - "code": 3006 + "code": 2311 }, "An interface may only extend a class or another interface.": { "category": "Error", - "code": 3007 + "code": 2312 + }, + "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { + "category": "Error", + "code": 2313 }, "Generic type '{0}' requires {1} type argument(s).": { "category": "Error", - "code": 3008 + "code": 2314 }, "Type '{0}' is not generic.": { "category": "Error", - "code": 3009 - }, - "Cannot find global type '{0}'.": { - "category": "Error", - "code": 3010 + "code": 2315 }, "Global type '{0}' must be a class or interface type.": { "category": "Error", - "code": 3011 + "code": 2316 }, "Global type '{0}' must have {1} type parameter(s).": { "category": "Error", - "code": 3012 + "code": 2317 }, - "'this' cannot be referenced in a module body.": { + "Cannot find global type '{0}'.": { "category": "Error", - "code": 3013 - }, - "'this' cannot be referenced in a static property initializer.": { - "category": "Error", - "code": 3014 - }, - "'this' cannot be referenced in current location.": { - "category": "Error", - "code": -9999999 - }, - "'super' can only be referenced in a derived class.": { - "category": "Error", - "code": 3015 - }, - "Property '{0}' does not exist on type '{1}'.": { - "category": "Error", - "code": 3017 - }, - "An index expression argument must be of type 'string', 'number', or 'any'.": { - "category": "Error", - "code": 3018 - }, - "Type '{0}' does not satisfy the constraint '{1}':": { - "category": "Error", - "code": 3019 - }, - "Type '{0}' does not satisfy the constraint '{1}'.": { - "category": "Error", - "code": 3019 - }, - "Supplied parameters do not match any signature of call target.": { - "category": "Error", - "code": 3020 - }, - "Cannot invoke an expression whose type lacks a call signature.": { - "category": "Error", - "code": 3021 - }, - "Only a void function can be called with the 'new' keyword.": { - "category": "Error", - "code": 3022 - }, - "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { - "category": "Error", - "code": 3023 - }, - "Neither type '{0}' nor type '{1}' is assignable to the other:": { - "category": "Error", - "code": 3024 - }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { - "category": "Error", - "code": 3024 - }, - "No best common type exists among return expressions.": { - "category": "Error", - "code": 3027 - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { - "category": "Error", - "code": 3028 - }, - "No best common type exists between '{0}' and '{1}'.": { - "category": "Error", - "code": 3029 - }, - "No best common type exists between '{0}', '{1}', and '{2}'.": { - "category": "Error", - "code": 3030 - }, - "A rest parameter must be of an array type.": { - "category": "Error", - "code": 3031 - }, - "A parameter initializer is only allowed in a function or constructor implementation.": { - "category": "Error", - "code": 3032 - }, - "Specialized overload signature is not assignable to any non-specialized signature.": { - "category": "Error", - "code": 3033 - }, - "Duplicate function implementation.": { - "category": "Error", - "code": 3034 - }, - "Overload signature is not compatible with function implementation.": { - "category": "Error", - "code": 3035 - }, - "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { - "category": "Error", - "code": 3036 - }, - - - "Index signature is missing in type '{0}'.": { - "category": "Error", - "code": 4003 - }, - "Index signatures are incompatible:": { - "category": "Error", - "code": 4004 - }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 4016 - }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "category": "Error", - "code": 4017 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "category": "Error", - "code": 4018 - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "category": "Error", - "code": 4019 - }, - "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { - "category": "Error", - "code": 4024 + "code": 2318 }, "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { + "category": "Error", + "code": 2319 + }, + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { + "category": "Error", + "code": 2320 + }, + "Excessive stack depth comparing types '{0}' and '{1}'.": { + "category": "Error", + "code": 2321 + }, + "Type '{0}' is not assignable to type '{1}':": { + "category": "Error", + "code": 2322 + }, + "Type '{0}' is not assignable to type '{1}'.": { + "category": "Error", + "code": 2323 + }, + "Property '{0}' is missing in type '{1}'.": { + "category": "Error", + "code": 2324 + }, + "Private property '{0}' cannot be reimplemented.": { + "category": "Error", + "code": 2325 + }, + "Types of property '{0}' are incompatible:": { + "category": "Error", + "code": 2326 + }, + "Required property '{0}' cannot be reimplemented with optional property in '{1}'.": { + "category": "Error", + "code": 2327 + }, + "Types of parameters '{0}' and '{1}' are incompatible:": { + "category": "Error", + "code": 2328 + }, + "Index signature is missing in type '{0}'.": { + "category": "Error", + "code": 2329 + }, + "Index signatures are incompatible:": { + "category": "Error", + "code": 2330 + }, + "'this' cannot be referenced in a module body.": { + "category": "Error", + "code": 2331 + }, + "'this' cannot be referenced in current location.": { + "category": "Error", + "code": 2332 + }, + "'this' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2333 + }, + "'this' cannot be referenced in a static property initializer.": { + "category": "Error", + "code": 2334 + }, + "'super' can only be referenced in a derived class.": { + "category": "Error", + "code": 2335 + }, + "'super' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2336 + }, + "Super calls are not permitted outside constructors or in nested functions inside constructors": { + "category": "Error", + "code": 2337 + }, + "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { + "category": "Error", + "code": 2338 + }, + "Property '{0}' does not exist on type '{1}'.": { + "category": "Error", + "code": 2339 + }, + "Only public methods of the base class are accessible via the 'super' keyword": { + "category": "Error", + "code": 2340 + }, + "Property '{0}' is inaccessible.": { + "category": "Error", + "code": 2341 + }, + "An index expression argument must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 2342 + }, + "Type '{0}' does not satisfy the constraint '{1}':": { + "category": "Error", + "code": 2343 + }, + "Type '{0}' does not satisfy the constraint '{1}'.": { + "category": "Error", + "code": 2344 + }, + "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { + "category": "Error", + "code": 2345 + }, + "Supplied parameters do not match any signature of call target.": { + "category": "Error", + "code": 2346 + }, + "Untyped function calls may not accept type arguments.": { + "category": "Error", + "code": 2347 + }, + "Value of type '{0}' is not callable. Did you mean to include 'new'?": { + "category": "Error", + "code": 2348 + }, + "Cannot invoke an expression whose type lacks a call signature.": { + "category": "Error", + "code": 2349 + }, + "Only a void function can be called with the 'new' keyword.": { + "category": "Error", + "code": 2350 + }, + "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { + "category": "Error", + "code": 2351 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other.": { + "category": "Error", + "code": 2352 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other:": { + "category": "Error", + "code": 2353 + }, + "No best common type exists among return expressions.": { + "category": "Error", + "code": 2354 + }, + "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2355 + }, + "An arithmetic operand must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2356 + }, + "The operand of an increment or decrement operator must be a variable, property or indexer.": { + "category": "Error", + "code": 2357 + }, + "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2358 + }, + "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { + "category": "Error", + "code": 2359 + }, + "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { + "category": "Error", + "code": 2360 + }, + "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { + "category": "Error", + "code": 2361 + }, + "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2362 + }, + "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2363 + }, + "Invalid left-hand side of assignment expression.": { + "category": "Error", + "code": 2364 + }, + "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { + "category": "Error", + "code": 2365 + }, + "No best common type exists between '{0}', '{1}', and '{2}'.": { + "category": "Error", + "code": 2366 + }, + "No best common type exists between '{0}' and '{1}'.": { + "category": "Error", + "code": 2367 + }, + "Type parameter name cannot be '{0}'": { + "category": "Error", + "code": 2368 + }, + "A parameter property is only allowed in a constructor implementation.": { + "category": "Error", + "code": 2369 + }, + "A rest parameter must be of an array type.": { + "category": "Error", + "code": 2370 + }, + "A parameter initializer is only allowed in a function or constructor implementation.": { + "category": "Error", + "code": 2371 + }, + "Parameter '{0}' cannot be referenced in its initializer.": { + "category": "Error", + "code": 2372 + }, + "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { + "category": "Error", + "code": 2373 + }, + "Duplicate string index signature.": { + "category": "Error", + "code": 2374 + }, + "Duplicate number index signature.": { + "category": "Error", + "code": 2375 + }, + "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { + "category": "Error", + "code": 2376 + }, + "Constructors for derived classes must contain a 'super' call.": { + "category": "Error", + "code": 2377 + }, + "A 'get' accessor must return a value or consist of a single 'throw' statement.": { + "category": "Error", + "code": 2378 + }, + "Getter and setter accessors do not agree in visibility.": { + "category": "Error", + "code": 2379 + }, + "'get' and 'set' accessor must have the same type.": { + "category": "Error", + "code": 2380 + }, + "A signature with an implementation cannot use a string literal type.": { + "category": "Error", + "code": 2381 + }, + "Specialized overload signature is not assignable to any non-specialized signature.": { + "category": "Error", + "code": 2382 + }, + "Overload signatures must all be exported or not exported.": { + "category": "Error", + "code": 2383 + }, + "Overload signatures must all be ambient or non-ambient.": { + "category": "Error", + "code": 2384 + }, + "Overload signatures must all be public or private.": { + "category": "Error", + "code": 2385 + }, + "Overload signatures must all be optional or required.": { + "category": "Error", + "code": 2386 + }, + "Function overload must be static.": { + "category": "Error", + "code": 2387 + }, + "Function overload must not be static.": { + "category": "Error", + "code": 2388 + }, + "Function implementation name must be '{0}'.": { + "category": "Error", + "code": 2389 + }, + "Constructor implementation is missing.": { + "category": "Error", + "code": 2390 + }, + "Function implementation is missing or not immediately following the declaration.": { + "category": "Error", + "code": 2391 + }, + "Multiple constructor implementations are not allowed.": { + "category": "Error", + "code": 2392 + }, + "Duplicate function implementation.": { + "category": "Error", + "code": 2393 + }, + "Overload signature is not compatible with function implementation.": { + "category": "Error", + "code": 2394 + }, + "Individual declarations in merged declaration {0} must be all exported or all local.": { + "category": "Error", + "code": 2395 + }, + "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { + "category": "Error", + "code": 2396 + }, + "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { + "category": "Error", + "code": 2397 + }, + "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { + "category": "Error", + "code": 2398 + }, + "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { + "category": "Error", + "code": 2399 + }, + "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { + "category": "Error", + "code": 2400 + }, + "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { + "category": "Error", + "code": 2401 + }, + "Expression resolves to '_super' that compiler uses to capture base class reference.": { + "category": "Error", + "code": 2402 + }, + "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { + "category": "Error", + "code": 2403 + }, + "The left-hand side of a 'for...in' statement cannot use a type annotation.": { + "category": "Error", + "code": 2404 + }, + "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.": { + "category": "Error", + "code": 2405 + }, + "Invalid left-hand side in 'for...in' statement.": { + "category": "Error", + "code": 2406 + }, + "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2407 + }, + "Setters cannot return a value.": { + "category": "Error", + "code": 2408 + }, + "Return type of constructor signature must be assignable to the instance type of the class": { + "category": "Error", + "code": 2409 + }, + "All symbols within a 'with' block will be resolved to 'any'.": { + "category": "Error", + "code": 2410 + }, + "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { + "category": "Error", + "code": 2411 + }, + "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { + "category": "Error", + "code": 2412 + }, + "Numeric index type '{0}' is not assignable to string index type '{1}'.": { + "category": "Error", + "code": 2413 + }, + "Class name cannot be '{0}'": { + "category": "Error", + "code": 2414 + }, + "Class '{0}' incorrectly extends base class '{1}'.": { + "category": "Error", + "code": 2415 + }, + "Class '{0}' incorrectly extends base class '{1}':": { + "category": "Error", + "code": 2416 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}'.": { + "category": "Error", + "code": 2417 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}':": { + "category": "Error", + "code": 2418 + }, + "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { + "category": "Error", + "code": 2419 + }, + "Class '{0}' incorrectly implements interface '{1}'.": { + "category": "Error", + "code": 2420 + }, + "Class '{0}' incorrectly implements interface '{1}':": { + "category": "Error", + "code": 2421 + }, + "A class may only implement another class or interface.": { + "category": "Error", + "code": 2422 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { + "category": "Error", + "code": 2423 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { + "category": "Error", + "code": 2424 + }, + "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2425 + }, + "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "Error", + "code": 2426 + }, + "Interface name cannot be '{0}'": { + "category": "Error", + "code": 2427 + }, + "All declarations of an interface must have identical type parameters.": { + "category": "Error", + "code": 2428 + }, + "Interface '{0}' incorrectly extends interface '{1}':": { + "category": "Error", + "code": 2429 + }, + "Interface '{0}' incorrectly extends interface '{1}'.": { + "category": "Error", + "code": 2430 + }, + "Enum name cannot be '{0}'": { + "category": "Error", + "code": 2431 + }, + "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.": { + "category": "Error", + "code": 2432 + }, + "A module declaration cannot be in a different file from a class or function with which it is merged": { + "category": "Error", + "code": 2433 + }, + "A module declaration cannot be located prior to a class or function with which it is merged": { + "category": "Error", + "code": 2434 + }, + "Ambient external modules cannot be nested in other modules.": { + "category": "Error", + "code": 2435 + }, + "Ambient external module declaration cannot specify relative module name.": { + "category": "Error", + "code": 2436 + }, + "Module '{0}' is hidden by a local declaration with the same name": { + "category": "Error", + "code": 2437 + }, + "Import name cannot be '{0}'": { + "category": "Error", + "code": 2438 + }, + "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { + "category": "Error", + "code": 2439 + }, + "Import declaration conflicts with local declaration of '{0}'": { + "category": "Error", + "code": 2440 + }, + + "Import declaration '{0}' is using private name '{1}'.": { + "category": "Error", + "code": 4000 + }, + "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4001 + }, + "Type parameter '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4002 + }, + "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4003 + }, + "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4004 + }, + "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4005 + }, + "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4006 + }, + "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4007 + }, + "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4008 + }, + "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4009 + }, + "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4010 + }, + "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4011 + }, + "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4012 + }, + "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4013 + }, + "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4014 + }, + "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4015 + }, + "Type parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4016 + }, + "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4017 + }, + "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4018 + }, + "Implements clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4019 + }, + "Extends clause of exported class '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4020 + }, + "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4021 + }, + "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4022 + }, + "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4023 + }, + "Exported variable '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4024 + }, + "Exported variable '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4025 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4026 + }, + "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4027 + }, + "Public static property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4028 + }, + "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4029 + }, + "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4030 + }, + "Public property '{0}' of exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4031 + }, + "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { "category": "Error", "code": 4032 }, + "Property '{0}' of exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4033 + }, + "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4034 + }, + "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4035 + }, + "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4036 + }, + "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4037 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4038 + }, + "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4039 + }, + "Return type of public static property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4040 + }, + "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4041 + }, + "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4042 + }, + "Return type of public property getter from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4043 + }, + "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4044 + }, + "Return type of constructor signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4045 + }, + "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4046 + }, + "Return type of call signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4047 + }, + "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4048 + }, + "Return type of index signature from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4049 + }, + "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4050 + }, + "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4051 + }, + "Return type of public static method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4052 + }, + "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4053 + }, + "Return type of public method from exported class has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4054 + }, + "Return type of public method from exported class has or is using private name '{0}'.": { + "category": "Error", + "code": 4055 + }, + "Return type of method from exported interface has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4056 + }, + "Return type of method from exported interface has or is using private name '{0}'.": { + "category": "Error", + "code": 4057 + }, + "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.": { + "category": "Error", + "code": 4058 + }, + "Return type of exported function has or is using name '{0}' from private module '{1}'.": { + "category": "Error", + "code": 4059 + }, + "Return type of exported function has or is using private name '{0}'.": { + "category": "Error", + "code": 4060 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4061 + }, + "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4062 + }, + "Parameter '{0}' of constructor from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4063 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4064 + }, + "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4065 + }, + "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4066 + }, + "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4067 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4068 + }, + "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4069 + }, + "Parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4070 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4071 + }, + "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4072 + }, + "Parameter '{0}' of public method from exported class has or is using private name '{1}'.": { + "category": "Error", + "code": 4073 + }, + "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4074 + }, + "Parameter '{0}' of method from exported interface has or is using private name '{1}'.": { + "category": "Error", + "code": 4075 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4076 + }, + "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4077 + }, + "Parameter '{0}' of exported function has or is using private name '{1}'.": { + "category": "Error", + "code": 4078 + }, + + "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 @@ -1094,6 +1339,10 @@ "category": "Error", "code": 5013 }, + "Unknown compiler option '{0}'.": { + "category": "Error", + "code": 5023 + }, "Could not write file '{0}': {1}": { "category": "Error", "code": 5033 @@ -1106,6 +1355,7 @@ "category": "Error", "code": 5039 }, + "Concatenate and emit output to single file.": { "category": "Message", "code": 6001 @@ -1170,7 +1420,6 @@ "category": "Message", "code": 6027 }, - "Version {0}": { "category": "Message", "code": 6029 @@ -1221,32 +1470,41 @@ }, "Argument for '--module' option must be 'commonjs' or 'amd'.": { "category": "Error", - "code": 6045 + "code": 6046 }, "Argument for '--target' option must be 'es3' or 'es5'.": { "category": "Error", - "code": 6046 + "code": 6047 }, "Locale must be of the form or -. For example '{0}' or '{1}'.": { "category": "Error", - "code": 6047 + "code": 6048 }, "Unsupported locale '{0}'.": { "category": "Error", - "code": 6048 + "code": 6049 }, "Unable to open file '{0}'.": { "category": "Error", - "code": 6049 + "code": 6050 }, "Corrupted locale file {0}.": { "category": "Error", - "code": 6050 + "code": 6051 }, "Warn on expressions and declarations with an implied 'any' type.": { "category": "Message", - "code": 7004 + "code": 6052 }, + "File '{0}' not found.": { + "category": "Error", + "code": 6053 + }, + "File '{0}' must have extension '.ts' or '.d.ts'.": { + "category": "Error", + "code": 6054 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 @@ -1294,261 +1552,5 @@ "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { "category": "Error", "code": 7020 - }, - "Variable declaration list cannot be empty.": { - "category": "Error", - "code": -9999999 - }, - "Digit expected.": { - "category": "Error", - "code": -9999999 - }, - "Hexadecimal digit expected.": { - "category": "Error", - "code": -9999999 - }, - "Unexpected end of text.": { - "category": "Error", - "code": -9999999 - }, - "Invalid character.": { - "category": "Error", - "code": -9999999 - }, - "Declaration or statement expected.": { - "category": "Error", - "code": -9999999 - }, - "Statement expected.": { - "category": "Error", - "code": -9999999 - }, - "'case' or 'default' expected.": { - "category": "Error", - "code": -9999999 - }, - "Property or signature expected.": { - "category": "Error", - "code": -9999999 - }, - "Enum member expected.": { - "category": "Error", - "code": -9999999 - }, - "Type reference expected.": { - "category": "Error", - "code": -9999999 - }, - "Variable declaration expected.": { - "category": "Error", - "code": -9999999 - }, - "Argument expression expected.": { - "category": "Error", - "code": -9999999 - }, - "Property assignment expected.": { - "category": "Error", - "code": -9999999 - }, - "Expression or comma expected.": { - "category": "Error", - "code": -9999999 - }, - "Parameter declaration expected.": { - "category": "Error", - "code": -9999999 - }, - "Type parameter declaration expected.": { - "category": "Error", - "code": -9999999 - }, - "Type argument expected.": { - "category": "Error", - "code": -9999999 - }, - "String literal expected.": { - "category": "Error", - "code": -9999999 - }, - "Line break not permitted here.": { - "category": "Error", - "code": -9999999 - }, - "'catch' or 'finally' expected.": { - "category": "Error", - "code": -9999999 - }, - "Block or ';' expected.": { - "category": "Error", - "code": -9999999 - }, - "Modifiers not permitted on index signature members.": { - "category": "Error", - "code": -9999999 - }, - "Declaration expected.": { - "category": "Error", - "code": -9999999 - }, - "File '{0}' is not an external module.": { - "category": "Error", - "code": -9999999 - }, - "Excessive stack depth comparing types '{0}' and '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Type '{0}' is not assignable to type '{1}':": { - "category": "Error", - "code": -9999999 - }, - "Type '{0}' is not assignable to type '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Property '{0}' is missing in type '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Private property '{0}' cannot be reimplemented.": { - "category": "Error", - "code": -9999999 - }, - "Required property '{0}' cannot be reimplemented with optional property in '{1}'.": { - "category": "Error", - "code": 2012 - }, - "Super calls are not permitted outside constructors or in nested functions inside constructors": { - "category": "Error", - "code": -9999999 - }, - "Only public methods of the base class are accessible via the 'super' keyword": { - "category": "Error", - "code": -9999999 - }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { - "category": "Error", - "code": -9999999 - }, - "Constructors for derived classes must contain a 'super' call.": { - "category": "Error", - "code": -9999999 - }, - "Import name cannot be '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Type parameter name cannot be '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Class name cannot be '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Interface name cannot be '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Enum name cannot be '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Types of property '{0}' are incompatible:": { - "category": "Error", - "code": -9999999 - }, - "Types of parameters '{0}' and '{1}' are incompatible:": { - "category": "Error", - "code": -9999999 - }, - "Property '{0}' is inaccessible.": { - "category": "Error", - "code": -9999999 - }, - "Function implementation is missing or not immediately following the declaration.": { - "category": "Error", - "code": -9999999 - }, - "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { - "category": "Error", - "code": -9999999 - }, - "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { - "category": "Error", - "code": -9999999 - }, - "Numeric index type '{0}' is not assignable to string index type '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Class '{0}' incorrectly extends base class '{1}':": { - "category": "Error", - "code": -9999999 - }, - "Class '{0}' incorrectly extends base class '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Class static side '{0}' incorrectly extends base class static side '{1}':": { - "category": "Error", - "code": -9999999 - }, - "Class static side '{0}' incorrectly extends base class static side '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { - "category": "Error", - "code": -9999999 - }, - "Class '{0}' incorrectly implements interface '{1}':": { - "category": "Error", - "code": -9999999 - }, - "Class '{0}' incorrectly implements interface '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Interface '{0}' incorrectly extends interface '{1}':": { - "category": "Error", - "code": -9999999 - }, - "Interface '{0}' incorrectly extends interface '{1}'.": { - "category": "Error", - "code": -9999999 - }, - "Ambient external modules cannot be nested in other modules.": { - "category": "Error", - "code": -9999999 - }, - "Import declarations in an internal module cannot reference an external module.": { - "category": "Error", - "code": -9999999 - }, - "A module declaration cannot be in a different file from a class or function with which it is merged": { - "category": "Error", - "code": -9999999 - }, - "A module declaration cannot be located prior to a class or function with which it is merged": { - "category": "Error", - "code": -9999999 - }, - "Cannot compile external modules unless the '--module' flag is provided.": { - "category": "Error", - "code": -9999999 - }, - "Import declaration conflicts with local declaration of '{0}'": { - "category": "Error", - "code": -9999999 - }, - "Module '{0}' is hidden by a local declaration with the same name": { - "category": "Error", - "code": -9999999 - }, - "Filename '{0}' differs from already included filename '{1}' only in casing": { - "category": "Error", - "code": -9999999 } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ec3cee67e1d..398e570ae09 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1977,13 +1977,12 @@ module ts { var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); indexedAccess.object = expr; - // It's not uncommon for a user to write: "new Type[]". Check for that common pattern - // and report a better error message. + // It's not uncommon for a user to write: "new Type[]". + // Check for that common pattern and report a better error message. if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { indexedAccess.index = createMissingNode(); grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } - // Otherwise parse the indexed access normally. else { indexedAccess.index = parseExpression(); parseExpected(SyntaxKind.CloseBracketToken); diff --git a/tests/baselines/reference/ExportAssignment7.errors.txt b/tests/baselines/reference/ExportAssignment7.errors.txt index ff9ff0b050f..ff05fb7eda0 100644 --- a/tests/baselines/reference/ExportAssignment7.errors.txt +++ b/tests/baselines/reference/ExportAssignment7.errors.txt @@ -6,6 +6,6 @@ export = B; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! Cannot find name 'B'. ~~~~~~~~~~~ -!!! Cannot find name 'B'. \ No newline at end of file +!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/ExportAssignment8.errors.txt b/tests/baselines/reference/ExportAssignment8.errors.txt index 96110dc37b8..2f1d1f5b960 100644 --- a/tests/baselines/reference/ExportAssignment8.errors.txt +++ b/tests/baselines/reference/ExportAssignment8.errors.txt @@ -3,9 +3,9 @@ ~~~~~~~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. - ~~~~~~~~~~~ !!! Cannot find name 'B'. + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. export class C { } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index b768abb8575..9a1e3cdb618 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -3,9 +3,9 @@ // Arrow function used in with statement with (window) { ~~~~~~ -!!! All symbols within a 'with' block will be resolved to 'any'. - ~~~~~~ !!! Cannot find name 'window'. + ~~~~~~ +!!! All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } @@ -54,9 +54,9 @@ // Arrow function used in with statement with (window) { ~~~~~~ -!!! All symbols within a 'with' block will be resolved to 'any'. - ~~~~~~ !!! Cannot find name 'window'. + ~~~~~~ +!!! All symbols within a 'with' block will be resolved to 'any'. var p = () => this; } diff --git a/tests/baselines/reference/callOverloads1.errors.txt b/tests/baselines/reference/callOverloads1.errors.txt index 7826219c513..a561ffb0c83 100644 --- a/tests/baselines/reference/callOverloads1.errors.txt +++ b/tests/baselines/reference/callOverloads1.errors.txt @@ -9,9 +9,9 @@ function Foo(); // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. - ~~~ !!! Duplicate identifier 'Foo'. + ~~~ +!!! Function implementation is missing or not immediately following the declaration. function F1(s:string); function F1(a:any) { return a;} diff --git a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt index 32e58ff78c4..444ee245377 100644 --- a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt +++ b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt @@ -7,17 +7,17 @@ interface Derived extends Base { 1: { y: number } // error ~~~~~~~~~~~~~~~~ -!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. - ~~~~~~~~~~~~~~~~ !!! Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. + ~~~~~~~~~~~~~~~~ +!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. } interface Derived2 extends Base { '1': { y: number } // error ~~~~~~~~~~~~~~~~~~ -!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. - ~~~~~~~~~~~~~~~~~~ !!! Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. + ~~~~~~~~~~~~~~~~~~ +!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. } interface Derived3 extends Base { diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index b3745deb0bd..fdf27296612 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -8,9 +8,9 @@ ~ !!! Type parameter list cannot be empty. ~ -!!! Type parameter declaration expected. - ~ !!! '(' expected. + ~ +!!! Type parameter declaration expected. }; ~ !!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt index c6d3b03e9fb..a42b1c0b8b1 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt @@ -69,9 +69,9 @@ module M { module F { ~ -!!! A module declaration cannot be located prior to a class or function with which it is merged - ~ !!! Individual declarations in merged declaration F must be all exported or all local. + ~ +!!! A module declaration cannot be located prior to a class or function with which it is merged var t; } export function F() { } // Only one error for duplicate identifier (don't consider visibility) diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt index 1320a21f46b..ee9aadfdf93 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt @@ -3,9 +3,9 @@ export class MemberName { static create(arg1: any, arg2?: any, arg3?: any): MemberName { ~~~~~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~~~~~~~~~~ !!! Generic type 'MemberName' requires 3 type argument(s). + ~~~~~~~~~~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } } } diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt index bd746054763..d02ddfbb148 100644 --- a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt @@ -25,16 +25,16 @@ interface F extends A, B, E { } // error because 0 is not a subtype of {a; b;} ~ -!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. - ~ !!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. + ~ +!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. interface G extends A, B, C, E { } // should only report one error ~ -!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. - ~ !!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. ~ !!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. + ~ +!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. interface H extends A, F { } // Should report no error at all because error is internal to F \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index d3de7666ea4..7bd8509ee2f 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -18,9 +18,9 @@ !!! Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. return 1; ~~~~~~ -!!! Property or signature expected. - ~~~~~~ !!! A 'return' statement can only be used within a function body. + ~~~~~~ +!!! Property or signature expected. }; ~ !!! Declaration or statement expected. diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt index 69fc3e37231..d0b707c9ff1 100644 --- a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt @@ -3,34 +3,34 @@ foo(); static foo(); // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. - ~~~ !!! Function overload must not be static. + ~~~ +!!! Function implementation is missing or not immediately following the declaration. } class D { static foo(); foo(); // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. - ~~~ !!! Function overload must be static. + ~~~ +!!! Function implementation is missing or not immediately following the declaration. } class E { foo(x: T); static foo(x: number); // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. - ~~~ !!! Function overload must not be static. + ~~~ +!!! Function implementation is missing or not immediately following the declaration. } class F { static foo(x: number); foo(x: T); // error ~~~ -!!! Function implementation is missing or not immediately following the declaration. - ~~~ !!! Function overload must be static. + ~~~ +!!! Function implementation is missing or not immediately following the declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment7.errors.txt b/tests/baselines/reference/parserExportAssignment7.errors.txt index 0f9b4254760..3bd5fe1f79f 100644 --- a/tests/baselines/reference/parserExportAssignment7.errors.txt +++ b/tests/baselines/reference/parserExportAssignment7.errors.txt @@ -6,6 +6,6 @@ export = B; ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. +!!! Cannot find name 'B'. ~~~~~~~~~~~ -!!! Cannot find name 'B'. \ No newline at end of file +!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/parserExportAssignment8.errors.txt b/tests/baselines/reference/parserExportAssignment8.errors.txt index cfa28eaa2a3..7e808fec631 100644 --- a/tests/baselines/reference/parserExportAssignment8.errors.txt +++ b/tests/baselines/reference/parserExportAssignment8.errors.txt @@ -3,9 +3,9 @@ ~~~~~~~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~ -!!! An export assignment cannot be used in a module with other exported elements. - ~~~~~~~~~~~ !!! Cannot find name 'B'. + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. export class C { } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement3.errors.txt b/tests/baselines/reference/parserForStatement3.errors.txt index 8af66924fc0..91fb6ec21a2 100644 --- a/tests/baselines/reference/parserForStatement3.errors.txt +++ b/tests/baselines/reference/parserForStatement3.errors.txt @@ -1,9 +1,9 @@ ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement3.ts (7 errors) ==== for(d in _.jh[a]=_.jh[a]||[],b); ~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. - ~ !!! Cannot find name 'd'. + ~ +!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. ~ !!! Cannot find name '_'. ~ diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt b/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt index 574c03823df..07d04e34ffb 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.errors.txt @@ -30,9 +30,9 @@ function f2(): F { ~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~~~~ !!! Cannot find name 'F'. + ~~~~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt b/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt index f3b47f04368..cf3f3550d1e 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.errors.txt @@ -30,9 +30,9 @@ function f2(): F, Y>> { ~~~~~~~~~~~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~~~~~~~~~~~~~~~~ !!! Cannot find name 'F'. + ~~~~~~~~~~~~~~~~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode14.errors.txt b/tests/baselines/reference/parserStrictMode14.errors.txt index 87439c1a29d..1a5337c4443 100644 --- a/tests/baselines/reference/parserStrictMode14.errors.txt +++ b/tests/baselines/reference/parserStrictMode14.errors.txt @@ -4,7 +4,7 @@ ~~~~ !!! 'with' statements are not allowed in strict mode. ~ -!!! All symbols within a 'with' block will be resolved to 'any'. - ~ !!! Cannot find name 'a'. + ~ +!!! All symbols within a 'with' block will be resolved to 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserWithStatement1.d.errors.txt b/tests/baselines/reference/parserWithStatement1.d.errors.txt index b56589d2e00..856bbeb1237 100644 --- a/tests/baselines/reference/parserWithStatement1.d.errors.txt +++ b/tests/baselines/reference/parserWithStatement1.d.errors.txt @@ -3,7 +3,7 @@ ~~~~ !!! Statements are not allowed in ambient contexts. ~~~ -!!! All symbols within a 'with' block will be resolved to 'any'. - ~~~ !!! Cannot find name 'foo'. + ~~~ +!!! All symbols within a 'with' block will be resolved to 'any'. } \ No newline at end of file diff --git a/tests/baselines/reference/propertiesAndIndexers.errors.txt b/tests/baselines/reference/propertiesAndIndexers.errors.txt index 069aee42ce7..9bfb591b408 100644 --- a/tests/baselines/reference/propertiesAndIndexers.errors.txt +++ b/tests/baselines/reference/propertiesAndIndexers.errors.txt @@ -51,18 +51,18 @@ interface D extends B, C { ~ -!!! Numeric index type 'string' is not assignable to string index type 'number'. - ~ !!! Property '4' of type 'boolean' is not assignable to string index type 'number'. ~ !!! Property '5' of type 'string' is not assignable to string index type 'number'. ~ !!! Property '6' of type '() => string' is not assignable to string index type 'number'. + ~ +!!! Numeric index type 'string' is not assignable to string index type 'number'. 2: Z; ~~~~~ -!!! Property '2' of type 'Z' is not assignable to numeric index type 'string'. - ~~~~~ !!! Property '2' of type 'Z' is not assignable to string index type 'number'. + ~~~~~ +!!! Property '2' of type 'Z' is not assignable to numeric index type 'string'. Infinity: number; ~~~~~~~~~~~~~~~~~ !!! Property 'Infinity' of type 'number' is not assignable to numeric index type 'string'. diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt index da073522ae8..4e65560084c 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt @@ -35,14 +35,14 @@ ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~ !!! Cannot find name 'V'. + ~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function bar(): X { // error ~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~ !!! Cannot find name 'X'. + ~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function baz(a: X, b: Y): T { x = y; ~ @@ -58,14 +58,14 @@ ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~ !!! Cannot find name 'W'. + ~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function bar(): Y { // error ~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~ !!! Cannot find name 'Y'. + ~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function baz(a: X, b: Y): T { x = y; ~ diff --git a/tests/baselines/reference/unknownSymbols1.errors.txt b/tests/baselines/reference/unknownSymbols1.errors.txt index beb39743441..d5be76aa566 100644 --- a/tests/baselines/reference/unknownSymbols1.errors.txt +++ b/tests/baselines/reference/unknownSymbols1.errors.txt @@ -10,9 +10,9 @@ ~~~~ !!! Cannot find name 'asdf'. ~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - ~~~~ !!! Cannot find name 'asdf'. + ~~~~ +!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. function foo2() { return asdf; ~~~~ From f7cd2ae70d335f1c60604d8583d1624772187484 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 18 Aug 2014 15:42:55 -0700 Subject: [PATCH 20/21] Update LKG --- bin/lib.core.d.ts | 27 +- bin/lib.d.ts | 27 +- bin/tsc.js | 1351 ++++++++++++++++++++------------ bin/typescriptServices.js | 1559 ++++++++++++++++++++++--------------- 4 files changed, 1807 insertions(+), 1157 deletions(-) diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index b3bd2ae8e55..1d3ed6dca4c 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -956,11 +956,24 @@ declare var JSON: JSON; ///////////////////////////// interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; /** * Returns a string representation of an array. */ toString(): string; toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. @@ -976,15 +989,6 @@ interface Array { * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. */ join(separator?: string): string; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; /** * Reverses the elements in an Array. */ @@ -1101,11 +1105,6 @@ interface Array { */ reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - [n: number]: T; } declare var Array: { diff --git a/bin/lib.d.ts b/bin/lib.d.ts index 6aea1ab65f6..a3081f2c8d7 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -956,11 +956,24 @@ declare var JSON: JSON; ///////////////////////////// interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; /** * Returns a string representation of an array. */ toString(): string; toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. @@ -976,15 +989,6 @@ interface Array { * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. */ join(separator?: string): string; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; /** * Reverses the elements in an Array. */ @@ -1101,11 +1105,6 @@ interface Array { */ reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - [n: number]: T; } declare var Array: { diff --git a/bin/tsc.js b/bin/tsc.js index 36d85d40758..41ca819077c 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -16,20 +16,11 @@ and limitations under the License. var ts; (function (ts) { ts.Diagnostics = { - Unknown_compiler_option_0: { code: 6001, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - File_0_not_found: { code: 6002, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Unrecognized_escape_sequence: { code: 1000, category: 1 /* Error */, key: "Unrecognized escape sequence." }, - Unexpected_character_0: { code: 1001, category: 1 /* Error */, key: "Unexpected character {0}." }, - Missing_close_quote_character: { code: 1002, category: 1 /* Error */, key: "Missing close quote character." }, - Identifier_expected: { code: -9999999, category: 1 /* Error */, key: "Identifier expected." }, - _0_keyword_expected: { code: 1004, category: 1 /* Error */, key: "'{0}' keyword expected." }, - _0_expected: { code: -9999999, category: 1 /* Error */, key: "'{0}' expected." }, - Identifier_expected_0_is_a_keyword: { code: 1006, category: 1 /* Error */, key: "Identifier expected; '{0}' is a keyword." }, - Automatic_semicolon_insertion_not_allowed: { code: 1007, category: 1 /* Error */, key: "Automatic semicolon insertion not allowed." }, + Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, + _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - public_or_private_modifier_must_precede_static: { code: 1011, category: 1 /* Error */, key: "'public' or 'private' modifier must precede 'static'." }, Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, @@ -42,16 +33,16 @@ var ts; An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - extends_clause_already_seen: { code: 1024, category: 1 /* Error */, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1025, category: 1 /* Error */, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1027, category: 1 /* Error */, key: "'implements' clause already seen." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - Interface_declaration_cannot_have_implements_clause: { code: 1032, category: 1 /* Error */, key: "Interface declaration cannot have 'implements' clause." }, - super_invocation_cannot_have_type_arguments: { code: 1034, category: 1 /* Error */, key: "'super' invocation cannot have type arguments." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, @@ -67,23 +58,11 @@ var ts; A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Modifiers_cannot_appear_here: { code: 1055, category: 1 /* Error */, key: "Modifiers cannot appear here." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: -9999999, category: 1 /* Error */, key: "Enum member must have initializer." }, + Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - module_class_interface_enum_import_or_statement: { code: 1067, category: 3 /* NoPrefix */, key: "module, class, interface, enum, import or statement" }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - statement: { code: 1069, category: 3 /* NoPrefix */, key: "statement" }, - case_or_default_clause: { code: 1070, category: 3 /* NoPrefix */, key: "case or default clause" }, - identifier: { code: 1071, category: 3 /* NoPrefix */, key: "identifier" }, - call_construct_index_property_or_function_signature: { code: 1072, category: 3 /* NoPrefix */, key: "call, construct, index, property or function signature" }, - expression: { code: 1073, category: 3 /* NoPrefix */, key: "expression" }, - type_name: { code: 1074, category: 3 /* NoPrefix */, key: "type name" }, - property_or_accessor: { code: 1075, category: 3 /* NoPrefix */, key: "property or accessor" }, - parameter: { code: 1076, category: 3 /* NoPrefix */, key: "parameter" }, - type: { code: 1077, category: 3 /* NoPrefix */, key: "type" }, - type_parameter: { code: 1078, category: 3 /* NoPrefix */, key: "type parameter" }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, @@ -102,13 +81,12 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: -9999999, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: -9999999, category: 1 /* Error */, key: "Type expected." }, + Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, @@ -120,136 +98,259 @@ var ts; An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - Duplicate_identifier_0: { code: 2000, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 2020, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2021, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2022, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 2023, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2208, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2209, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 2210, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 2211, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 2212, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 2213, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2214, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2215, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2216, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2217, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2218, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 2219, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 2220, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 2221, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2222, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2223, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - A_class_may_only_implement_another_class_or_interface: { code: 2074, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - get_and_set_accessor_must_have_the_same_type: { code: 2096, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - Static_members_cannot_reference_class_type_parameters: { code: 2099, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2115, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2116, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2126, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2131, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - Setters_cannot_return_a_value: { code: 2122, category: 1 /* Error */, key: "Setters cannot return a value." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2135, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - Overload_signatures_must_all_be_public_or_private: { code: 2150, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2161, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2189, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2192, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2200, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2206, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Duplicate_string_index_signature: { code: 2232, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2233, category: 1 /* Error */, key: "Duplicate number index signature." }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Function_implementation_name_must_be_0: { code: 2239, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2240, category: 1 /* Error */, key: "Constructor implementation is missing." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - Function_overload_must_be_static: { code: 2247, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2248, category: 1 /* Error */, key: "Function overload must not be static." }, - Circular_definition_of_import_alias_0: { code: 3000, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 3001, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 3002, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - Cannot_find_external_module_0: { code: 3003, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 3006, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Generic_type_0_requires_1_type_argument_s: { code: 3008, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 3009, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Cannot_find_global_type_0: { code: 3010, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - this_cannot_be_referenced_in_a_module_body: { code: 3013, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - this_cannot_be_referenced_in_current_location: { code: -9999999, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - Property_0_does_not_exist_on_type_1: { code: 3017, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 3027, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 3029, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Duplicate_function_implementation: { code: 3034, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Index_signature_is_missing_in_type_0: { code: 4003, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 4004, category: 1 /* Error */, key: "Index signatures are incompatible:" }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 4024, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: 3 /* NoPrefix */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: 2325, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, + Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_inaccessible: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_or_private: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 3 /* NoPrefix */, key: "Unsupported file encoding." }, + Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, @@ -260,13 +361,10 @@ var ts; Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Skip_resolution_and_preprocessing: { code: 6010, category: 2 /* Message */, key: "Skip resolution and preprocessing." }, Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: { code: 6021, category: 2 /* Message */, key: "Allow use of deprecated '{0}' keyword when referencing an external module." }, - Specify_locale_for_errors_and_messages_For_example_0_or_1: { code: 6022, category: 2 /* Message */, key: "Specify locale for errors and messages. For example '{0}' or '{1}'" }, Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, options: { code: 6024, category: 2 /* Message */, key: "options" }, file: { code: 6025, category: 2 /* Message */, key: "file" }, @@ -274,29 +372,25 @@ var ts; Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - Use_the_0_flag_to_see_options: { code: 6031, category: 2 /* Message */, key: "Use the '{0}' flag to see options." }, File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - STRING: { code: 6033, category: 2 /* Message */, key: "STRING" }, KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - NUMBER: { code: 6039, category: 2 /* Message */, key: "NUMBER" }, - Specify_the_codepage_to_use_when_opening_source_files: { code: 6040, category: 2 /* Message */, key: "Specify the codepage to use when opening source files." }, - Additional_locations_Colon: { code: 6041, category: 2 /* Message */, key: "Additional locations:" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6045, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6046, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6047, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6048, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6049, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6050, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - No_input_files_specified: { code: 6051, category: 1 /* Error */, key: "No input files specified." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 7004, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -304,84 +398,11 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: 1 /* Error */, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Array_literal_implicitly_has_an_0_type: { code: 7015, category: 1 /* Error */, key: "Array literal implicitly has an '{0}' type." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Variable_declaration_list_cannot_be_empty: { code: -9999999, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: -9999999, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: -9999999, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: -9999999, category: 1 /* Error */, key: "Unexpected end of text." }, - Unterminated_string_constant: { code: -9999999, category: 1 /* Error */, key: "Unterminated string constant." }, - Invalid_character: { code: -9999999, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: -9999999, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: -9999999, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: -9999999, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: -9999999, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: -9999999, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: -9999999, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: -9999999, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: -9999999, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: -9999999, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: -9999999, category: 1 /* Error */, key: "String literal expected." }, - not_preceded_by_parameter_list: { code: -9999999, category: 1 /* Error */, key: "'=>' not preceded by parameter list." }, - Invalid_assignment_target: { code: -9999999, category: 1 /* Error */, key: "Invalid assignment target." }, - super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: 1 /* Error */, key: "'super' must be followed by argument list or member access." }, - Line_break_not_permitted_here: { code: -9999999, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: -9999999, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: -9999999, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Class_member_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Class member declaration expected." }, - Declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration expected." }, - Invalid_reference_comment: { code: -9999999, category: 1 /* Error */, key: "Invalid reference comment." }, - File_0_is_not_an_external_module: { code: -9999999, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: -9999999, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - Import_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Type_parameter_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - Class_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Interface_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - Enum_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Unknown_identifier_0: { code: -9999999, category: 1 /* Error */, key: "Unknown identifier '{0}'." }, - Property_0_is_inaccessible: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: -9999999, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, - Class_0_incorrectly_implements_interface_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: -9999999, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: -9999999, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" } + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." } }; })(ts || (ts = {})); var ts; @@ -866,7 +887,7 @@ var ts; } if (isLineBreak(ch)) { result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_constant); + error(ts.Diagnostics.Unterminated_string_literal); break; } pos++; @@ -1476,6 +1497,7 @@ var ts; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolAccessibility) { @@ -1589,7 +1611,6 @@ var ts; DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; (function (ModuleKind) { @@ -2293,9 +2314,6 @@ var sys = (function () { write: function (s) { WScript.StdOut.Write(s); }, - writeErr: function (s) { - WScript.StdErr.Write(s); - }, readFile: readFile, writeFile: writeFile, resolvePath: function (path) { @@ -2318,9 +2336,6 @@ var sys = (function () { getCurrentDirectory: function () { return new ActiveXObject("WScript.Shell").CurrentDirectory; }, - getMemoryUsage: function () { - return 0; - }, exit: function (exitCode) { try { WScript.Quit(exitCode); @@ -2370,10 +2385,7 @@ var sys = (function () { newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, write: function (s) { - process.stdout.write(s); - }, - writeErr: function (s) { - process.stderr.write(s); + _fs.writeSync(1, s); }, readFile: readFile, writeFile: writeFile, @@ -2413,7 +2425,9 @@ var sys = (function () { return process.cwd(); }, getMemoryUsage: function () { - global.gc(); + if (global.gc) { + global.gc(); + } return process.memoryUsage().heapUsed; }, exit: function (exitCode) { @@ -3651,11 +3665,14 @@ var ts; return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { - var arrowExpression = tryParseArrowFunctionExpression(); + var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); if (arrowExpression) { return arrowExpression; } var expr = parseConditionalExpression(noIn); + if (expr.kind === 55 /* Identifier */ && token === 23 /* EqualsGreaterThanToken */) { + return parseSimpleArrowFunctionExpression(expr); + } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); @@ -3692,23 +3709,7 @@ var ts; } return false; } - function tryParseArrowFunctionExpression() { - return isSimpleArrowFunctionExpression() ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); - } - function isSimpleArrowFunctionExpression() { - if (token === 23 /* EqualsGreaterThanToken */) { - return true; - } - if (token === 55 /* Identifier */) { - return lookAhead(function () { - return nextToken() === 23 /* EqualsGreaterThanToken */; - }); - } - return false; - } - function parseSimpleArrowFunctionExpression() { - ts.Debug.assert(token === 55 /* Identifier */ || token === 23 /* EqualsGreaterThanToken */); - var identifier = parseIdentifier(); + function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(23 /* EqualsGreaterThanToken */); var parameter = createNode(114 /* Parameter */, identifier.pos); @@ -3722,11 +3723,11 @@ var ts; return parseArrowExpressionTail(identifier.pos, signature, false); } function tryParseParenthesizedArrowFunctionExpression() { - var pos = getNodePos(); var triState = isParenthesizedArrowFunctionExpression(); if (triState === 0 /* False */) { return undefined; } + var pos = getNodePos(); if (triState === 1 /* True */) { var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); if (parseExpected(23 /* EqualsGreaterThanToken */) || token === 5 /* OpenBraceToken */) { @@ -3782,6 +3783,9 @@ var ts; } }); } + if (token === 23 /* EqualsGreaterThanToken */) { + return 1 /* True */; + } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { @@ -3912,7 +3916,7 @@ var ts; var primaryExpression = parsePrimaryExpression(); var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; if (illegalUsageOfSuperKeyword) { - error(ts.Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); @@ -5216,7 +5220,7 @@ var ts; if (!matchResult) { var start = range.pos; var length = range.end - start; - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_comment); + errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); } else { referencedFiles.push({ @@ -5289,7 +5293,7 @@ var ts; getCompilerHost: function () { return host; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeChecker: function () { return ts.createTypeChecker(program); }, + getTypeChecker: function (fullTypeCheckMode) { return ts.createTypeChecker(program, fullTypeCheckMode); }, getCommonSourceDirectory: function () { return commonSourceDirectory; } }; return program; @@ -5882,6 +5886,7 @@ var ts; writeLine: writeLine, increaseIndent: function () { return indent++; }, decreaseIndent: function () { return indent--; }, + getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * 4 + 1 : output.length - linePos + 1; }, @@ -7386,16 +7391,40 @@ var ts; var decreaseIndent = writer.decreaseIndent; var enclosingDeclaration; var reportedDeclarationError = false; + var aliasDeclarationEmitInfo = []; var getSymbolVisibilityDiagnosticMessage; + function writeAsychronousImportDeclarations(importDeclarations) { + var oldWriter = writer; + ts.forEach(importDeclarations, function (aliasToWrite) { + var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); + writer = createTextWriter(writeSymbol); + for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { + writer.increaseIndent(); + } + writeImportDeclaration(aliasToWrite); + aliasEmitInfo.asynchronousOutput = writer.getText(); + }); + writer = oldWriter; + } function writeSymbol(symbol, enclosingDeclaration, meaning) { var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (!getSymbolVisibilityDiagnosticMessage || symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { resolver.writeSymbol(symbol, enclosingDeclaration, meaning, writer); + if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } } else { reportedDeclarationError = true; var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + if (errorInfo) { + if (errorInfo.typeName) { + diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + } + else { + diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + } + } } } function emitLines(nodes) { @@ -7449,23 +7478,46 @@ var ts; } } function emitImportDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - if (node.flags & 1 /* Export */) { - write("export "); - } - write("import "); - emitSourceTextOfNode(node.name); - write(" = "); - if (node.entityName) { - emitSourceTextOfNode(node.entityName); - write(";"); + var nodeEmitInfo = { + declaration: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + hasWritten: resolver.isDeclarationVisible(node) + }; + aliasDeclarationEmitInfo.push(nodeEmitInfo); + if (nodeEmitInfo.hasWritten) { + writeImportDeclaration(node); + } + } + function writeImportDeclaration(node) { + if (node.flags & 1 /* Export */) { + writer.write("export "); + } + writer.write("import "); + writer.write(getSourceTextOfLocalNode(node.name)); + writer.write(" = "); + if (node.entityName) { + checkEntityNameAccessible(); + writer.write(getSourceTextOfLocalNode(node.entityName)); + writer.write(";"); + } + else { + writer.write("require("); + writer.write(getSourceTextOfLocalNode(node.externalModuleName)); + writer.write(");"); + } + writer.writeLine(); + function checkEntityNameAccessible() { + var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisibile(node.entityName); + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + if (symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } } else { - write("require("); - emitSourceTextOfNode(node.externalModuleName); - write(");"); + reportedDeclarationError = true; + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Import_declaration_0_is_using_private_name_1, getSourceTextOfLocalNode(node.name), symbolAccesibilityResult.errorSymbolName)); } - writeLine(); } } function emitModuleDeclaration(node) { @@ -7558,8 +7610,7 @@ var ts; if (node.constraint && (node.parent.kind !== 116 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 0 /* None */, writer); - getSymbolVisibilityDiagnosticMessage = undefined; + resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } if (typeParameters) { @@ -7575,32 +7626,23 @@ var ts; } function emitTypeOfTypeReference(node) { getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */, writer); - getSymbolVisibilityDiagnosticMessage = undefined; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.parent.kind === 169 /* ClassDeclaration */) { - if (symbolAccesibilityResult.accessibility == 1 /* NotAccessible */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } + if (symbolAccesibilityResult.errorModuleName) { + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } else { + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } } else { - if (symbolAccesibilityResult.accessibility == 1 /* NotAccessible */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } + if (symbolAccesibilityResult.errorModuleName) { + diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; } else { + diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } } return { @@ -7676,9 +7718,32 @@ var ts; } if (!(node.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + if (node.kind === 166 /* VariableDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } + else if (node.kind === 115 /* Property */) { + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } } function emitVariableStatement(node) { var hasDeclarationWithEmit = ts.forEach(node.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); @@ -7697,11 +7762,41 @@ var ts; emitSourceTextOfNode(node.name); if (!(node.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } write(";"); writeLine(); } + function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + if (node.kind === 119 /* SetAccessor */) { + if (node.parent.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.parameters[0], + typeName: node.name + }; + } + else { + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.name, + typeName: undefined + }; + } + } } function emitFunctionDeclaration(node) { if ((node.kind !== 167 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { @@ -7743,10 +7838,45 @@ var ts; } if (node.kind !== 117 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; + resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } write(";"); writeLine(); + function getReturnTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + switch (node.kind) { + case 121 /* ConstructSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 120 /* CallSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 122 /* IndexSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 116 /* Method */: + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } + else if (node.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + case 167 /* FunctionDeclaration */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + default: + ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.name || node + }; + } } function emitParameterDeclaration(node) { if (node.flags & 8 /* Rest */) { @@ -7758,7 +7888,43 @@ var ts; } if (!(node.parent.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + } + function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + switch (node.parent.kind) { + case 117 /* Constructor */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + break; + case 121 /* ConstructSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 120 /* CallSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 116 /* Method */: + if (node.parent.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + case 167 /* FunctionDeclaration */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + default: + ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; } } function emitNode(node) { @@ -7836,7 +8002,18 @@ var ts; }); } if (!reportedDeclarationError) { - writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", referencePathsOutput + writer.getText(), compilerOptions.emitBOM); + var declarationOutput = referencePathsOutput; + var synchronousDeclarationOutput = writer.getText(); + var appliedSyncOutputPos = 0; + ts.forEach(aliasDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += aliasEmitInfo.asynchronousOutput; + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); @@ -7855,6 +8032,8 @@ var ts; if (compilerOptions.out) { emitFile(compilerOptions.out); } + diagnostics.sort(ts.compareDiagnostics); + diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); return { errors: diagnostics, sourceMaps: sourceMapDataList @@ -7867,13 +8046,40 @@ var ts; var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; - function createTypeChecker(program) { + function createTypeChecker(program, fullTypeCheck) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var emptyArray = []; var emptySymbols = {}; + var checker = { + getProgram: function () { return program; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, + getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, + getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, + getTypeCount: function () { return typeCount; }, + checkProgram: checkProgram, + emitFiles: invokeEmitter, + getSymbolOfNode: getSymbolOfNode, + getParentOfSymbol: getParentOfSymbol, + getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, + getPropertiesOfType: getPropertiesOfType, + getPropertyOfType: getPropertyOfType, + getSignaturesOfType: getSignaturesOfType, + getIndexTypeOfType: getIndexTypeOfType, + getReturnTypeOfSignature: getReturnTypeOfSignature, + resolveEntityName: resolveEntityName, + getSymbolsInScope: getSymbolsInScope, + getSymbolInfo: getSymbolInfo, + getTypeOfExpression: getTypeOfExpression, + typeToString: typeToString, + symbolToString: symbolToString, + getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType + }; var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); @@ -7902,7 +8108,6 @@ var ts; var globalBooleanType; var globalRegExpType; var stringLiteralTypes = {}; - var fullTypeCheck = false; var emitExtends = false; var mergedSymbols = []; var symbolLinks = []; @@ -7910,33 +8115,6 @@ var ts; var potentialThisCollisions = []; var diagnostics = []; var diagnosticsModified = false; - var checker = { - getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getSymbolOfNode: getSymbolOfNode, - getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - resolveEntityName: resolveEntityName, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfExpression: getTypeOfExpression, - typeToString: typeToString, - symbolToString: symbolToString, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType - }; function addDiagnostic(diagnostic) { diagnostics.push(diagnostic); diagnosticsModified = true; @@ -8433,30 +8611,41 @@ var ts; } return callback(globals); } - function getAccessibleSymbol(symbol, enclosingDeclaration, meaning) { - function getAccessibleSymbolFromSymbolTable(symbols) { + function getQualifiedLeftMeaning(rightMeaning) { + return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + } + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning) { + function getAccessibleSymbolChainFromSymbolTable(symbols) { + function canQualifySymbol(symbolFromSymbolTable, meaning) { + if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { + return true; + } + var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning)); + return !!accessibleParent; + } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { - return true; - } - var accessibleParent = getAccessibleSymbol(symbolFromSymbolTable.parent, enclosingDeclaration, ts.SymbolFlags.Namespace); - return !!accessibleParent; + return !ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); }) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return symbol; + return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 4194304 /* Import */) { + var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return symbolFromSymbolTable; + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } } }); } if (symbol) { - return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolFromSymbolTable); + return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); } } function needsQualification(symbol, enclosingDeclaration, meaning) { @@ -8483,26 +8672,80 @@ var ts; var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { - var accessibleSymbol = getAccessibleSymbol(symbol, enclosingDeclaration, meaningToLook); - if (accessibleSymbol) { - if (ts.forEach(accessibleSymbol.declarations, function (declaration) { return !isDeclarationVisible(declaration); })) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook); + if (accessibleSymbolChain) { + var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); + if (!hasAccessibleDeclarations) { return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined }; } - return { accessibility: 0 /* Accessible */ }; + return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; } - meaningToLook = ts.SymbolFlags.Namespace; + meaningToLook = getQualifiedLeftMeaning(meaning); symbol = symbol.parent; } + var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); + if (symbolExternalModule) { + var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); + if (symbolExternalModule !== enclosingExternalModule) { + return { + accessibility: 2 /* CannotBeNamed */, + errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), + errorModuleName: symbolToString(symbolExternalModule) + }; + } + } return { - accessibility: 2 /* CannotBeNamed */, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } return { accessibility: 0 /* Accessible */ }; + function getExternalModuleContainer(declaration) { + for (; declaration; declaration = declaration.parent) { + if (hasExternalModuleSymbol(declaration)) { + return getSymbolOfNode(declaration); + } + } + } + } + function hasExternalModuleSymbol(declaration) { + return (declaration.kind === 172 /* ModuleDeclaration */ && declaration.name.kind === 3 /* StringLiteral */) || (declaration.kind === 177 /* SourceFile */ && ts.isExternalModule(declaration)); + } + function hasVisibleDeclarations(symbol) { + var aliasesToMakeVisible; + if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + return undefined; + } + return { aliasesToMakeVisible: aliasesToMakeVisible }; + function getIsDeclarationVisible(declaration) { + if (!isDeclarationVisible(declaration)) { + if (declaration.kind === 174 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + getNodeLinks(declaration).isVisible = true; + if (aliasesToMakeVisible) { + if (!ts.contains(aliasesToMakeVisible, declaration)) { + aliasesToMakeVisible.push(declaration); + } + } + else { + aliasesToMakeVisible = [declaration]; + } + return true; + } + return false; + } + return true; + } + } + function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { + var firstIdentifier = getFirstIdentifier(entityName); + var firstIdentifierName = ts.identifierToString(firstIdentifier); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; } function symbolToString(symbol, enclosingDeclaration, meaning) { function getSymbolName(symbol) { @@ -8518,13 +8761,23 @@ var ts; var symbolName; while (symbol) { var isFirstName = !symbolName; - var meaningToLook = isFirstName ? meaning : ts.SymbolFlags.Namespace; - var accessibleSymbol = getAccessibleSymbol(symbol, enclosingDeclaration, meaningToLook); - symbolName = getSymbolName(accessibleSymbol || symbol) + (isFirstName ? "" : ("." + symbolName)); - if (accessibleSymbol && !needsQualification(accessibleSymbol, enclosingDeclaration, meaningToLook)) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning); + var currentSymbolName; + if (accessibleSymbolChain) { + currentSymbolName = ts.map(accessibleSymbolChain, function (accessibleSymbol) { return getSymbolName(accessibleSymbol); }).join("."); + } + else { + if (!isFirstName && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { + break; + } + currentSymbolName = getSymbolName(symbol); + } + symbolName = currentSymbolName + (isFirstName ? "" : ("." + symbolName)); + if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { break; } - symbol = accessibleSymbol ? accessibleSymbol.parent : symbol.parent; + symbol = accessibleSymbolChain ? accessibleSymbolChain[0].parent : symbol.parent; + meaning = getQualifiedLeftMeaning(meaning); } return symbolName; } @@ -8603,9 +8856,12 @@ var ts; if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { writeTypeofSymbol(type); } - else if (type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */) && typeStack && ts.contains(typeStack, type)) { + else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } + else if (typeStack && ts.contains(typeStack, type)) { + writer.write("any"); + } else { if (!typeStack) { typeStack = []; @@ -8614,6 +8870,15 @@ var ts; writeLiteralType(type, allowFunctionOrConstructorTypeLiteral); typeStack.pop(); } + function shouldWriteTypeOfFunctionSymbol() { + if (type.symbol) { + var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 64 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 177 /* SourceFile */ || declaration.parent.kind === 173 /* ModuleBlock */; })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); + } + } + } } function writeTypeofSymbol(type) { writer.write("typeof "); @@ -8749,13 +9014,22 @@ var ts; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); + var resolvedExportSymbol; var symbolOfNode = getSymbolOfNode(node); - if (exportAssignmentSymbol === symbolOfNode) { + if (isSymbolUsedInExportAssignment(symbolOfNode)) { + return true; + } + if (symbolOfNode.flags & 4194304 /* Import */) { + return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); + } + } + function isSymbolUsedInExportAssignment(symbol) { + if (exportAssignmentSymbol === symbol) { return true; } if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { - var resolvedExportSymbol = resolveImport(exportAssignmentSymbol); - if (resolvedExportSymbol === symbolOfNode) { + resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); + if (resolvedExportSymbol === symbol) { return true; } return ts.forEach(resolvedExportSymbol.declarations, function (declaration) { @@ -8772,20 +9046,17 @@ var ts; function determineIfDeclarationIsVisible() { switch (node.kind) { case 166 /* VariableDeclaration */: - if (!(node.flags & 1 /* Export */)) { - return isGlobalSourceFile(node.parent.parent) || isUsedInExportAssignment(node); - } - return isDeclarationVisible(node.parent.parent); case 172 /* ModuleDeclaration */: case 169 /* ClassDeclaration */: case 170 /* InterfaceDeclaration */: case 167 /* FunctionDeclaration */: case 171 /* EnumDeclaration */: case 174 /* ImportDeclaration */: - if (!(node.flags & 1 /* Export */)) { - return isGlobalSourceFile(node.parent) || isUsedInExportAssignment(node); + var parent = node.kind === 166 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 174 /* ImportDeclaration */ && parent.kind !== 177 /* SourceFile */ && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(node.parent); + return isDeclarationVisible(parent); case 115 /* Property */: case 116 /* Method */: if (node.flags & 32 /* Private */) { @@ -8807,7 +9078,7 @@ var ts; if (node) { var links = getNodeLinks(node); if (links.isVisible === undefined) { - links.isVisible = determineIfDeclarationIsVisible(); + links.isVisible = !!determineIfDeclarationIsVisible(); } return links.isVisible; } @@ -8867,7 +9138,7 @@ var ts; checkImplicitAny(type); return type; function checkImplicitAny(type) { - if (!program.getCompilerOptions().noImplicitAny) { + if (!fullTypeCheck || !program.getCompilerOptions().noImplicitAny) { return; } if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { @@ -11210,7 +11481,7 @@ var ts; var typeArgNode = typeArguments[i]; var typeArgument = getTypeFromTypeNode(typeArgNode); var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { + if (constraint && fullTypeCheck) { checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } result.push(typeArgument); @@ -11366,7 +11637,7 @@ var ts; function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); - if (targetType !== unknownType) { + if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); @@ -11394,7 +11665,7 @@ var ts; if (func.body.kind !== 168 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); - if (program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); } return widenedType; @@ -11407,7 +11678,7 @@ var ts; return unknownType; } var widenedType = getWidenedType(commonType); - if (program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); @@ -11468,6 +11739,9 @@ var ts; return (body.statements.length === 1) && (body.statements[0].kind === 160 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { + if (!fullTypeCheck) { + return; + } if (returnType === voidType || returnType === anyType) { return; } @@ -11699,7 +11973,7 @@ var ts; return rightType; } function checkAssignmentOperator(valueType) { - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); @@ -11790,24 +12064,28 @@ var ts; return unknownType; } function checkTypeParameter(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); checkSourceElement(node.constraint); - checkTypeParameterHasIllegalReferencesInConstraint(node); + if (fullTypeCheck) { + checkTypeParameterHasIllegalReferencesInConstraint(node); + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); + } } function checkParameter(parameterDeclaration) { checkVariableDeclaration(parameterDeclaration); - checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - if (parameterDeclaration.flags & 8 /* Rest */) { - if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { - error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + if (fullTypeCheck) { + checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - } - else { - if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + if (parameterDeclaration.flags & 8 /* Rest */) { + if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { + error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + else { + if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + } } } function checkReferencesInInitializer(n) { @@ -11841,17 +12119,19 @@ var ts; if (node.type) { checkSourceElement(node.type); } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithArgumentsInGeneratedCode(node); - if (program.getCompilerOptions().noImplicitAny && !node.type) { - switch (node.kind) { - case 121 /* ConstructSignature */: - error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 120 /* CallSignature */: - error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; + if (fullTypeCheck) { + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithArgumentsInGeneratedCode(node); + if (program.getCompilerOptions().noImplicitAny && !node.type) { + switch (node.kind) { + case 121 /* ConstructSignature */: + error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 120 /* CallSignature */: + error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } } } checkSpecializedSignatureDeclaration(node); @@ -11909,6 +12189,9 @@ var ts; if (!node.body) { return; } + if (!fullTypeCheck) { + return; + } function isSuperCallExpression(n) { return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; } @@ -11956,23 +12239,25 @@ var ts; } } function checkAccessorDeclaration(node) { - if (node.kind === 118 /* GetAccessor */) { - if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); + if (fullTypeCheck) { + if (node.kind === 118 /* GetAccessor */) { + if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { + error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); + } } - } - var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; - var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); - if (otherAccessor) { - var visibilityFlags = 32 /* Private */ | 16 /* Public */; - if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { - error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); - } - var thisType = getAnnotatedAccessorType(node); - var otherType = getAnnotatedAccessorType(otherAccessor); - if (thisType && otherType) { - if (!isTypeIdenticalTo(thisType, otherType)) { - error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); + if (otherAccessor) { + var visibilityFlags = 32 /* Private */ | 16 /* Public */; + if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); + } + var thisType = getAnnotatedAccessorType(node); + var otherType = getAnnotatedAccessorType(otherAccessor); + if (thisType && otherType) { + if (!isTypeIdenticalTo(thisType, otherType)) { + error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + } } } } @@ -11986,7 +12271,7 @@ var ts; for (var i = 0; i < len; i++) { checkSourceElement(node.typeArguments[i]); var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); - if (constraint) { + if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } @@ -11998,9 +12283,11 @@ var ts; } function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); - var type = getTypeFromTypeLiteralNode(node); - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + var type = getTypeFromTypeLiteralNode(node); + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } } function checkArrayType(node) { getTypeFromArrayTypeNode(node); @@ -12009,6 +12296,9 @@ var ts; return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); } function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { + if (!fullTypeCheck) { + return; + } var signature = getSignatureFromDeclaration(signatureDeclarationNode); if (!signature.hasStringLiterals) { return; @@ -12048,6 +12338,9 @@ var ts; return flags & flagsToCheck; } function checkFunctionOrConstructorSymbol(symbol) { + if (!fullTypeCheck) { + return; + } function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; if (someButNotAllOverloadFlags !== 0) { @@ -12170,6 +12463,9 @@ var ts; } } function checkExportsOnMergedDeclarations(node) { + if (!fullTypeCheck) { + return; + } var symbol; var symbol = node.localSymbol; if (!symbol) { @@ -12238,7 +12534,7 @@ var ts; if (node.type && !isAccessor(node.kind)) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { @@ -12356,26 +12652,28 @@ var ts; function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); - var type; - var useTypeFromValueDeclaration = node === symbol.valueDeclaration; - if (useTypeFromValueDeclaration) { - type = typeOfValueDeclaration; - } - else { - type = getTypeOfVariableDeclaration(node); - } - if (node.initializer) { - if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + if (fullTypeCheck) { + var symbol = getSymbolOfNode(node); + var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); + var type; + var useTypeFromValueDeclaration = node === symbol.valueDeclaration; + if (useTypeFromValueDeclaration) { + type = typeOfValueDeclaration; } - } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - if (!useTypeFromValueDeclaration) { - if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + else { + type = getTypeOfVariableDeclaration(node); + } + if (node.initializer) { + if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + } + } + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithCapturedThisVariable(node, node.name); + if (!useTypeFromValueDeclaration) { + if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + } } } } @@ -12472,7 +12770,7 @@ var ts; function checkSwitchStatement(node) { var expressionType = checkExpression(node.expression); ts.forEach(node.clauses, function (clause) { - if (clause.expression) { + if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); @@ -12556,9 +12854,11 @@ var ts; for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); - for (var j = 0; j < i; j++) { - if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + if (fullTypeCheck) { + for (var j = 0; j < i; j++) { + if (typeParameterDeclarations[j].symbol === node.symbol) { + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + } } } } @@ -12577,34 +12877,40 @@ var ts; checkTypeReference(node.baseType); } if (type.baseTypes.length) { - var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); - var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { - error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); + if (fullTypeCheck) { + var baseType = type.baseTypes[0]; + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var staticBaseType = getTypeOfSymbol(baseType.symbol); + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); + } + checkKindsOfPropertyMemberOverrides(type, baseType); } checkExpression(node.baseType.typeName); - checkKindsOfPropertyMemberOverrides(type, baseType); } if (node.implementedTypes) { ts.forEach(node.implementedTypes, function (typeRefNode) { checkTypeReference(typeRefNode); - var t = getTypeFromTypeReferenceNode(typeRefNode); - if (t !== unknownType) { - var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; - if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); - } - else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + if (fullTypeCheck) { + var t = getTypeFromTypeReferenceNode(typeRefNode); + if (t !== unknownType) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + } + else { + error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + } } } }); } - checkIndexConstraints(type); ts.forEach(node.members, checkSourceElement); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } } function getTargetSymbol(s) { return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; @@ -12681,28 +12987,32 @@ var ts; return true; } function checkInterfaceDeclaration(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkTypeParameters(node.typeParameters); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); - if (symbol.declarations.length > 1) { - if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + if (fullTypeCheck) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + if (symbol.declarations.length > 1) { + if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { + error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + } } - } - if (node === firstInterfaceDecl) { - var type = getDeclaredTypeOfSymbol(symbol); - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); - }); - checkIndexConstraints(type); + if (node === firstInterfaceDecl) { + var type = getDeclaredTypeOfSymbol(symbol); + if (checkInheritedPropertiesAreIdentical(type, node.name)) { + ts.forEach(type.baseTypes, function (baseType) { + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + }); + checkIndexConstraints(type); + } } } ts.forEach(node.baseTypes, checkTypeReference); ts.forEach(node.members, checkSourceElement); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + checkTypeForDuplicateIndexSignatures(node); + } } function getConstantValue(node) { var isNegative = false; @@ -12720,6 +13030,9 @@ var ts; return undefined; } function checkEnumDeclaration(node) { + if (!fullTypeCheck) { + return; + } checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkExportsOnMergedDeclarations(node); @@ -12776,26 +13089,28 @@ var ts; return undefined; } function checkModuleDeclaration(node) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { - var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (classOrFunc) { - if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } - else if (node.pos < classOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (fullTypeCheck) { + checkCollisionWithCapturedThisVariable(node, node.name); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (classOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { + error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } + else if (node.pos < classOrFunc.pos) { + error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } } } - } - if (node.name.kind === 3 /* StringLiteral */) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); - } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + if (node.name.kind === 3 /* StringLiteral */) { + if (!isGlobalSourceFile(node.parent)) { + error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + } + if (isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + } } } checkSourceElement(node.body); @@ -12941,7 +13256,6 @@ var ts; function checkSourceFile(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { - fullTypeCheck = true; emitExtends = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); @@ -12958,13 +13272,13 @@ var ts; if (emitExtends) links.flags |= 8 /* EmitExtends */; links.flags |= 1 /* TypeChecked */; - fullTypeCheck = false; } } function checkProgram() { ts.forEach(program.getSourceFiles(), checkSourceFile); } function getSortedDiagnostics() { + ts.Debug.assert(fullTypeCheck, "diagnostics are available only in the full typecheck mode"); if (diagnosticsModified) { diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); @@ -13384,7 +13698,8 @@ var ts; writeTypeAtLocation: writeTypeAtLocation, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeSymbol: writeSymbolToTextWriter, - isSymbolAccessible: isSymbolAccessible + isSymbolAccessible: isSymbolAccessible, + isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile }; checkProgram(); return ts.emitFiles(resolver); @@ -13657,7 +13972,7 @@ var ts; return true; } function trySetLanguageAndTerritory(language, territory, errors) { - var compilerFilePath = sys.getExecutingFilePath(); + var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath()); var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath); var filePath = ts.combinePaths(containingDirectoryPath, language); if (territory) { @@ -13882,7 +14197,7 @@ var ts; var reportStart = bindStart; } else { - var checker = program.getTypeChecker(); + var checker = program.getTypeChecker(true); var checkStart = new Date().getTime(); var semanticErrors = checker.getDiagnostics(); var emitStart = new Date().getTime(); @@ -13892,12 +14207,16 @@ var ts; } reportDiagnostics(errors); if (commandLine.options.diagnostics) { + var memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1; reportCountStatistic("Files", program.getSourceFiles().length); reportCountStatistic("Lines", countLines(program)); reportCountStatistic("Nodes", checker ? checker.getNodeCount() : 0); reportCountStatistic("Identifiers", checker ? checker.getIdentifierCount() : 0); reportCountStatistic("Symbols", checker ? checker.getSymbolCount() : 0); reportCountStatistic("Types", checker ? checker.getTypeCount() : 0); + if (memoryUsed >= 0) { + reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K"); + } reportTimeStatistic("Parse time", bindStart - parseStart); reportTimeStatistic("Bind time", checkStart - bindStart); reportTimeStatistic("Check time", emitStart - checkStart); diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 8babfd4486d..cb98750e2a3 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -16,20 +16,11 @@ and limitations under the License. var ts; (function (ts) { ts.Diagnostics = { - Unknown_compiler_option_0: { code: 6001, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - File_0_not_found: { code: 6002, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Unrecognized_escape_sequence: { code: 1000, category: 1 /* Error */, key: "Unrecognized escape sequence." }, - Unexpected_character_0: { code: 1001, category: 1 /* Error */, key: "Unexpected character {0}." }, - Missing_close_quote_character: { code: 1002, category: 1 /* Error */, key: "Missing close quote character." }, - Identifier_expected: { code: -9999999, category: 1 /* Error */, key: "Identifier expected." }, - _0_keyword_expected: { code: 1004, category: 1 /* Error */, key: "'{0}' keyword expected." }, - _0_expected: { code: -9999999, category: 1 /* Error */, key: "'{0}' expected." }, - Identifier_expected_0_is_a_keyword: { code: 1006, category: 1 /* Error */, key: "Identifier expected; '{0}' is a keyword." }, - Automatic_semicolon_insertion_not_allowed: { code: 1007, category: 1 /* Error */, key: "Automatic semicolon insertion not allowed." }, + Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, + _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - public_or_private_modifier_must_precede_static: { code: 1011, category: 1 /* Error */, key: "'public' or 'private' modifier must precede 'static'." }, Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, @@ -42,16 +33,16 @@ var ts; An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - extends_clause_already_seen: { code: 1024, category: 1 /* Error */, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1025, category: 1 /* Error */, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1027, category: 1 /* Error */, key: "'implements' clause already seen." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - Interface_declaration_cannot_have_implements_clause: { code: 1032, category: 1 /* Error */, key: "Interface declaration cannot have 'implements' clause." }, - super_invocation_cannot_have_type_arguments: { code: 1034, category: 1 /* Error */, key: "'super' invocation cannot have type arguments." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, @@ -67,23 +58,11 @@ var ts; A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Modifiers_cannot_appear_here: { code: 1055, category: 1 /* Error */, key: "Modifiers cannot appear here." }, Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: -9999999, category: 1 /* Error */, key: "Enum member must have initializer." }, + Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - module_class_interface_enum_import_or_statement: { code: 1067, category: 3 /* NoPrefix */, key: "module, class, interface, enum, import or statement" }, Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - statement: { code: 1069, category: 3 /* NoPrefix */, key: "statement" }, - case_or_default_clause: { code: 1070, category: 3 /* NoPrefix */, key: "case or default clause" }, - identifier: { code: 1071, category: 3 /* NoPrefix */, key: "identifier" }, - call_construct_index_property_or_function_signature: { code: 1072, category: 3 /* NoPrefix */, key: "call, construct, index, property or function signature" }, - expression: { code: 1073, category: 3 /* NoPrefix */, key: "expression" }, - type_name: { code: 1074, category: 3 /* NoPrefix */, key: "type name" }, - property_or_accessor: { code: 1075, category: 3 /* NoPrefix */, key: "property or accessor" }, - parameter: { code: 1076, category: 3 /* NoPrefix */, key: "parameter" }, - type: { code: 1077, category: 3 /* NoPrefix */, key: "type" }, - type_parameter: { code: 1078, category: 3 /* NoPrefix */, key: "type parameter" }, A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, @@ -102,13 +81,12 @@ var ts; Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: -9999999, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: -9999999, category: 1 /* Error */, key: "Type expected." }, + Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, @@ -120,136 +98,259 @@ var ts; An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - Duplicate_identifier_0: { code: 2000, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 2019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 2020, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2021, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 2022, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 2023, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2208, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 2209, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 2210, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 2211, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 2212, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 2213, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2214, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2215, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2216, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2217, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2218, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 2219, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 2220, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 2221, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 2222, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 2223, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - A_class_may_only_implement_another_class_or_interface: { code: 2074, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - get_and_set_accessor_must_have_the_same_type: { code: 2096, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - Static_members_cannot_reference_class_type_parameters: { code: 2099, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2115, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2116, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2126, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2131, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - Setters_cannot_return_a_value: { code: 2122, category: 1 /* Error */, key: "Setters cannot return a value." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2135, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - Overload_signatures_must_all_be_public_or_private: { code: 2150, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2161, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2189, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2192, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2200, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2206, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Duplicate_string_index_signature: { code: 2232, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2233, category: 1 /* Error */, key: "Duplicate number index signature." }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Function_implementation_name_must_be_0: { code: 2239, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2240, category: 1 /* Error */, key: "Constructor implementation is missing." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - Function_overload_must_be_static: { code: 2247, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2248, category: 1 /* Error */, key: "Function overload must not be static." }, - Circular_definition_of_import_alias_0: { code: 3000, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 3001, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 3002, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - Cannot_find_external_module_0: { code: 3003, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 3006, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Generic_type_0_requires_1_type_argument_s: { code: 3008, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 3009, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Cannot_find_global_type_0: { code: 3010, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - this_cannot_be_referenced_in_a_module_body: { code: 3013, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - this_cannot_be_referenced_in_current_location: { code: -9999999, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - Property_0_does_not_exist_on_type_1: { code: 3017, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 3027, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 3029, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Duplicate_function_implementation: { code: 3034, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Index_signature_is_missing_in_type_0: { code: 4003, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 4004, category: 1 /* Error */, key: "Index signatures are incompatible:" }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 4024, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: 3 /* NoPrefix */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: 2325, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, + Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2327, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_inaccessible: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_or_private: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 3 /* NoPrefix */, key: "Unsupported file encoding." }, + Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, @@ -260,13 +361,10 @@ var ts; Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Skip_resolution_and_preprocessing: { code: 6010, category: 2 /* Message */, key: "Skip resolution and preprocessing." }, Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: { code: 6021, category: 2 /* Message */, key: "Allow use of deprecated '{0}' keyword when referencing an external module." }, - Specify_locale_for_errors_and_messages_For_example_0_or_1: { code: 6022, category: 2 /* Message */, key: "Specify locale for errors and messages. For example '{0}' or '{1}'" }, Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, options: { code: 6024, category: 2 /* Message */, key: "options" }, file: { code: 6025, category: 2 /* Message */, key: "file" }, @@ -274,29 +372,25 @@ var ts; Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - Use_the_0_flag_to_see_options: { code: 6031, category: 2 /* Message */, key: "Use the '{0}' flag to see options." }, File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - STRING: { code: 6033, category: 2 /* Message */, key: "STRING" }, KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - NUMBER: { code: 6039, category: 2 /* Message */, key: "NUMBER" }, - Specify_the_codepage_to_use_when_opening_source_files: { code: 6040, category: 2 /* Message */, key: "Specify the codepage to use when opening source files." }, - Additional_locations_Colon: { code: 6041, category: 2 /* Message */, key: "Additional locations:" }, Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6045, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6046, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6047, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6048, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6049, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6050, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - No_input_files_specified: { code: 6051, category: 1 /* Error */, key: "No input files specified." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 7004, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -304,84 +398,11 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: 1 /* Error */, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Array_literal_implicitly_has_an_0_type: { code: 7015, category: 1 /* Error */, key: "Array literal implicitly has an '{0}' type." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Variable_declaration_list_cannot_be_empty: { code: -9999999, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: -9999999, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: -9999999, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: -9999999, category: 1 /* Error */, key: "Unexpected end of text." }, - Unterminated_string_constant: { code: -9999999, category: 1 /* Error */, key: "Unterminated string constant." }, - Invalid_character: { code: -9999999, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: -9999999, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: -9999999, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: -9999999, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: -9999999, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: -9999999, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: -9999999, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: -9999999, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: -9999999, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: -9999999, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: -9999999, category: 1 /* Error */, key: "String literal expected." }, - not_preceded_by_parameter_list: { code: -9999999, category: 1 /* Error */, key: "'=>' not preceded by parameter list." }, - Invalid_assignment_target: { code: -9999999, category: 1 /* Error */, key: "Invalid assignment target." }, - super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: 1 /* Error */, key: "'super' must be followed by argument list or member access." }, - Line_break_not_permitted_here: { code: -9999999, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: -9999999, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: -9999999, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Class_member_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Class member declaration expected." }, - Declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration expected." }, - Invalid_reference_comment: { code: -9999999, category: 1 /* Error */, key: "Invalid reference comment." }, - File_0_is_not_an_external_module: { code: -9999999, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Private_property_0_cannot_be_reimplemented: { code: -9999999, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, - Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - Import_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Type_parameter_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - Class_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Interface_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - Enum_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Unknown_identifier_0: { code: -9999999, category: 1 /* Error */, key: "Unknown identifier '{0}'." }, - Property_0_is_inaccessible: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: -9999999, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, - Class_0_incorrectly_implements_interface_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: -9999999, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: -9999999, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: -9999999, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" } + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." } }; })(ts || (ts = {})); var ts; @@ -866,7 +887,7 @@ var ts; } if (isLineBreak(ch)) { result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_constant); + error(ts.Diagnostics.Unterminated_string_literal); break; } pos++; @@ -1476,6 +1497,7 @@ var ts; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolAccessibility) { @@ -1589,7 +1611,6 @@ var ts; DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; (function (ModuleKind) { @@ -2293,9 +2314,6 @@ var sys = (function () { write: function (s) { WScript.StdOut.Write(s); }, - writeErr: function (s) { - WScript.StdErr.Write(s); - }, readFile: readFile, writeFile: writeFile, resolvePath: function (path) { @@ -2318,9 +2336,6 @@ var sys = (function () { getCurrentDirectory: function () { return new ActiveXObject("WScript.Shell").CurrentDirectory; }, - getMemoryUsage: function () { - return 0; - }, exit: function (exitCode) { try { WScript.Quit(exitCode); @@ -2370,10 +2385,7 @@ var sys = (function () { newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, write: function (s) { - process.stdout.write(s); - }, - writeErr: function (s) { - process.stderr.write(s); + _fs.writeSync(1, s); }, readFile: readFile, writeFile: writeFile, @@ -2413,7 +2425,9 @@ var sys = (function () { return process.cwd(); }, getMemoryUsage: function () { - global.gc(); + if (global.gc) { + global.gc(); + } return process.memoryUsage().heapUsed; }, exit: function (exitCode) { @@ -3651,11 +3665,14 @@ var ts; return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { - var arrowExpression = tryParseArrowFunctionExpression(); + var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); if (arrowExpression) { return arrowExpression; } var expr = parseConditionalExpression(noIn); + if (expr.kind === 55 /* Identifier */ && token === 23 /* EqualsGreaterThanToken */) { + return parseSimpleArrowFunctionExpression(expr); + } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); @@ -3692,23 +3709,7 @@ var ts; } return false; } - function tryParseArrowFunctionExpression() { - return isSimpleArrowFunctionExpression() ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); - } - function isSimpleArrowFunctionExpression() { - if (token === 23 /* EqualsGreaterThanToken */) { - return true; - } - if (token === 55 /* Identifier */) { - return lookAhead(function () { - return nextToken() === 23 /* EqualsGreaterThanToken */; - }); - } - return false; - } - function parseSimpleArrowFunctionExpression() { - ts.Debug.assert(token === 55 /* Identifier */ || token === 23 /* EqualsGreaterThanToken */); - var identifier = parseIdentifier(); + function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(23 /* EqualsGreaterThanToken */); var parameter = createNode(114 /* Parameter */, identifier.pos); @@ -3722,11 +3723,11 @@ var ts; return parseArrowExpressionTail(identifier.pos, signature, false); } function tryParseParenthesizedArrowFunctionExpression() { - var pos = getNodePos(); var triState = isParenthesizedArrowFunctionExpression(); if (triState === 0 /* False */) { return undefined; } + var pos = getNodePos(); if (triState === 1 /* True */) { var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); if (parseExpected(23 /* EqualsGreaterThanToken */) || token === 5 /* OpenBraceToken */) { @@ -3782,6 +3783,9 @@ var ts; } }); } + if (token === 23 /* EqualsGreaterThanToken */) { + return 1 /* True */; + } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { @@ -3912,7 +3916,7 @@ var ts; var primaryExpression = parsePrimaryExpression(); var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; if (illegalUsageOfSuperKeyword) { - error(ts.Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); @@ -5216,7 +5220,7 @@ var ts; if (!matchResult) { var start = range.pos; var length = range.end - start; - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_comment); + errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); } else { referencedFiles.push({ @@ -5289,7 +5293,7 @@ var ts; getCompilerHost: function () { return host; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getTypeChecker: function () { return ts.createTypeChecker(program); }, + getTypeChecker: function (fullTypeCheckMode) { return ts.createTypeChecker(program, fullTypeCheckMode); }, getCommonSourceDirectory: function () { return commonSourceDirectory; } }; return program; @@ -5882,6 +5886,7 @@ var ts; writeLine: writeLine, increaseIndent: function () { return indent++; }, decreaseIndent: function () { return indent--; }, + getIndent: function () { return indent; }, getTextPos: function () { return output.length; }, getLine: function () { return lineCount + 1; }, getColumn: function () { return lineStart ? indent * 4 + 1 : output.length - linePos + 1; }, @@ -7386,16 +7391,40 @@ var ts; var decreaseIndent = writer.decreaseIndent; var enclosingDeclaration; var reportedDeclarationError = false; + var aliasDeclarationEmitInfo = []; var getSymbolVisibilityDiagnosticMessage; + function writeAsychronousImportDeclarations(importDeclarations) { + var oldWriter = writer; + ts.forEach(importDeclarations, function (aliasToWrite) { + var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); + writer = createTextWriter(writeSymbol); + for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { + writer.increaseIndent(); + } + writeImportDeclaration(aliasToWrite); + aliasEmitInfo.asynchronousOutput = writer.getText(); + }); + writer = oldWriter; + } function writeSymbol(symbol, enclosingDeclaration, meaning) { var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (!getSymbolVisibilityDiagnosticMessage || symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { resolver.writeSymbol(symbol, enclosingDeclaration, meaning, writer); + if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } } else { reportedDeclarationError = true; var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + if (errorInfo) { + if (errorInfo.typeName) { + diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + } + else { + diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); + } + } } } function emitLines(nodes) { @@ -7449,23 +7478,46 @@ var ts; } } function emitImportDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - if (node.flags & 1 /* Export */) { - write("export "); - } - write("import "); - emitSourceTextOfNode(node.name); - write(" = "); - if (node.entityName) { - emitSourceTextOfNode(node.entityName); - write(";"); + var nodeEmitInfo = { + declaration: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + hasWritten: resolver.isDeclarationVisible(node) + }; + aliasDeclarationEmitInfo.push(nodeEmitInfo); + if (nodeEmitInfo.hasWritten) { + writeImportDeclaration(node); + } + } + function writeImportDeclaration(node) { + if (node.flags & 1 /* Export */) { + writer.write("export "); + } + writer.write("import "); + writer.write(getSourceTextOfLocalNode(node.name)); + writer.write(" = "); + if (node.entityName) { + checkEntityNameAccessible(); + writer.write(getSourceTextOfLocalNode(node.entityName)); + writer.write(";"); + } + else { + writer.write("require("); + writer.write(getSourceTextOfLocalNode(node.externalModuleName)); + writer.write(");"); + } + writer.writeLine(); + function checkEntityNameAccessible() { + var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisibile(node.entityName); + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + if (symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } } else { - write("require("); - emitSourceTextOfNode(node.externalModuleName); - write(");"); + reportedDeclarationError = true; + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Import_declaration_0_is_using_private_name_1, getSourceTextOfLocalNode(node.name), symbolAccesibilityResult.errorSymbolName)); } - writeLine(); } } function emitModuleDeclaration(node) { @@ -7558,8 +7610,7 @@ var ts; if (node.constraint && (node.parent.kind !== 116 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 0 /* None */, writer); - getSymbolVisibilityDiagnosticMessage = undefined; + resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } if (typeParameters) { @@ -7575,32 +7626,23 @@ var ts; } function emitTypeOfTypeReference(node) { getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */, writer); - getSymbolVisibilityDiagnosticMessage = undefined; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.parent.kind === 169 /* ClassDeclaration */) { - if (symbolAccesibilityResult.accessibility == 1 /* NotAccessible */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } + if (symbolAccesibilityResult.errorModuleName) { + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } else { + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } } else { - if (symbolAccesibilityResult.accessibility == 1 /* NotAccessible */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } + if (symbolAccesibilityResult.errorModuleName) { + diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; } else { + diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } } return { @@ -7676,9 +7718,32 @@ var ts; } if (!(node.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + if (node.kind === 166 /* VariableDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } + else if (node.kind === 115 /* Property */) { + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + return diagnosticMessage !== undefined ? { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } } function emitVariableStatement(node) { var hasDeclarationWithEmit = ts.forEach(node.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); @@ -7697,11 +7762,41 @@ var ts; emitSourceTextOfNode(node.name); if (!(node.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } write(";"); writeLine(); } + function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + if (node.kind === 119 /* SetAccessor */) { + if (node.parent.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.parameters[0], + typeName: node.name + }; + } + else { + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.name, + typeName: undefined + }; + } + } } function emitFunctionDeclaration(node) { if ((node.kind !== 167 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { @@ -7743,10 +7838,45 @@ var ts; } if (node.kind !== 117 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; + resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } write(";"); writeLine(); + function getReturnTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + switch (node.kind) { + case 121 /* ConstructSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 120 /* CallSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 122 /* IndexSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 116 /* Method */: + if (node.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } + else if (node.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + case 167 /* FunctionDeclaration */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + default: + ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node.name || node + }; + } } function emitParameterDeclaration(node) { if (node.flags & 8 /* Rest */) { @@ -7758,7 +7888,43 @@ var ts; } if (!(node.parent.flags & 32 /* Private */)) { write(": "); - resolver.writeTypeAtLocation(node, enclosingDeclaration, 0 /* None */, writer); + getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; + resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + } + function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage; + switch (node.parent.kind) { + case 117 /* Constructor */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + break; + case 121 /* ConstructSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 120 /* CallSignature */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 116 /* Method */: + if (node.parent.flags & 64 /* Static */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === 169 /* ClassDeclaration */) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + case 167 /* FunctionDeclaration */: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + default: + ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + } + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; } } function emitNode(node) { @@ -7836,7 +8002,18 @@ var ts; }); } if (!reportedDeclarationError) { - writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", referencePathsOutput + writer.getText(), compilerOptions.emitBOM); + var declarationOutput = referencePathsOutput; + var synchronousDeclarationOutput = writer.getText(); + var appliedSyncOutputPos = 0; + ts.forEach(aliasDeclarationEmitInfo, function (aliasEmitInfo) { + if (aliasEmitInfo.asynchronousOutput) { + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += aliasEmitInfo.asynchronousOutput; + appliedSyncOutputPos = aliasEmitInfo.outputPos; + } + }); + declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); + writeFile(ts.getModuleNameFromFilename(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); @@ -7855,6 +8032,8 @@ var ts; if (compilerOptions.out) { emitFile(compilerOptions.out); } + diagnostics.sort(ts.compareDiagnostics); + diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); return { errors: diagnostics, sourceMaps: sourceMapDataList @@ -7867,13 +8046,40 @@ var ts; var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; - function createTypeChecker(program) { + function createTypeChecker(program, fullTypeCheck) { var Symbol = ts.objectAllocator.getSymbolConstructor(); var Type = ts.objectAllocator.getTypeConstructor(); var Signature = ts.objectAllocator.getSignatureConstructor(); var typeCount = 0; var emptyArray = []; var emptySymbols = {}; + var checker = { + getProgram: function () { return program; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, + getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, + getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, + getTypeCount: function () { return typeCount; }, + checkProgram: checkProgram, + emitFiles: invokeEmitter, + getSymbolOfNode: getSymbolOfNode, + getParentOfSymbol: getParentOfSymbol, + getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, + getPropertiesOfType: getPropertiesOfType, + getPropertyOfType: getPropertyOfType, + getSignaturesOfType: getSignaturesOfType, + getIndexTypeOfType: getIndexTypeOfType, + getReturnTypeOfSignature: getReturnTypeOfSignature, + resolveEntityName: resolveEntityName, + getSymbolsInScope: getSymbolsInScope, + getSymbolInfo: getSymbolInfo, + getTypeOfExpression: getTypeOfExpression, + typeToString: typeToString, + symbolToString: symbolToString, + getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType + }; var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); @@ -7902,7 +8108,6 @@ var ts; var globalBooleanType; var globalRegExpType; var stringLiteralTypes = {}; - var fullTypeCheck = false; var emitExtends = false; var mergedSymbols = []; var symbolLinks = []; @@ -7910,33 +8115,6 @@ var ts; var potentialThisCollisions = []; var diagnostics = []; var diagnosticsModified = false; - var checker = { - getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getSymbolOfNode: getSymbolOfNode, - getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - resolveEntityName: resolveEntityName, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfExpression: getTypeOfExpression, - typeToString: typeToString, - symbolToString: symbolToString, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType - }; function addDiagnostic(diagnostic) { diagnostics.push(diagnostic); diagnosticsModified = true; @@ -8433,30 +8611,41 @@ var ts; } return callback(globals); } - function getAccessibleSymbol(symbol, enclosingDeclaration, meaning) { - function getAccessibleSymbolFromSymbolTable(symbols) { + function getQualifiedLeftMeaning(rightMeaning) { + return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + } + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning) { + function getAccessibleSymbolChainFromSymbolTable(symbols) { + function canQualifySymbol(symbolFromSymbolTable, meaning) { + if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { + return true; + } + var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning)); + return !!accessibleParent; + } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { - return true; - } - var accessibleParent = getAccessibleSymbol(symbolFromSymbolTable.parent, enclosingDeclaration, ts.SymbolFlags.Namespace); - return !!accessibleParent; + return !ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); }) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return symbol; + return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 4194304 /* Import */) { + var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return symbolFromSymbolTable; + return [symbolFromSymbolTable]; + } + var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } } }); } if (symbol) { - return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolFromSymbolTable); + return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); } } function needsQualification(symbol, enclosingDeclaration, meaning) { @@ -8483,26 +8672,80 @@ var ts; var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { - var accessibleSymbol = getAccessibleSymbol(symbol, enclosingDeclaration, meaningToLook); - if (accessibleSymbol) { - if (ts.forEach(accessibleSymbol.declarations, function (declaration) { return !isDeclarationVisible(declaration); })) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook); + if (accessibleSymbolChain) { + var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); + if (!hasAccessibleDeclarations) { return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined }; } - return { accessibility: 0 /* Accessible */ }; + return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; } - meaningToLook = ts.SymbolFlags.Namespace; + meaningToLook = getQualifiedLeftMeaning(meaning); symbol = symbol.parent; } + var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); + if (symbolExternalModule) { + var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); + if (symbolExternalModule !== enclosingExternalModule) { + return { + accessibility: 2 /* CannotBeNamed */, + errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), + errorModuleName: symbolToString(symbolExternalModule) + }; + } + } return { - accessibility: 2 /* CannotBeNamed */, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } return { accessibility: 0 /* Accessible */ }; + function getExternalModuleContainer(declaration) { + for (; declaration; declaration = declaration.parent) { + if (hasExternalModuleSymbol(declaration)) { + return getSymbolOfNode(declaration); + } + } + } + } + function hasExternalModuleSymbol(declaration) { + return (declaration.kind === 172 /* ModuleDeclaration */ && declaration.name.kind === 3 /* StringLiteral */) || (declaration.kind === 177 /* SourceFile */ && ts.isExternalModule(declaration)); + } + function hasVisibleDeclarations(symbol) { + var aliasesToMakeVisible; + if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + return undefined; + } + return { aliasesToMakeVisible: aliasesToMakeVisible }; + function getIsDeclarationVisible(declaration) { + if (!isDeclarationVisible(declaration)) { + if (declaration.kind === 174 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + getNodeLinks(declaration).isVisible = true; + if (aliasesToMakeVisible) { + if (!ts.contains(aliasesToMakeVisible, declaration)) { + aliasesToMakeVisible.push(declaration); + } + } + else { + aliasesToMakeVisible = [declaration]; + } + return true; + } + return false; + } + return true; + } + } + function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { + var firstIdentifier = getFirstIdentifier(entityName); + var firstIdentifierName = ts.identifierToString(firstIdentifier); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; } function symbolToString(symbol, enclosingDeclaration, meaning) { function getSymbolName(symbol) { @@ -8518,13 +8761,23 @@ var ts; var symbolName; while (symbol) { var isFirstName = !symbolName; - var meaningToLook = isFirstName ? meaning : ts.SymbolFlags.Namespace; - var accessibleSymbol = getAccessibleSymbol(symbol, enclosingDeclaration, meaningToLook); - symbolName = getSymbolName(accessibleSymbol || symbol) + (isFirstName ? "" : ("." + symbolName)); - if (accessibleSymbol && !needsQualification(accessibleSymbol, enclosingDeclaration, meaningToLook)) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning); + var currentSymbolName; + if (accessibleSymbolChain) { + currentSymbolName = ts.map(accessibleSymbolChain, function (accessibleSymbol) { return getSymbolName(accessibleSymbol); }).join("."); + } + else { + if (!isFirstName && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { + break; + } + currentSymbolName = getSymbolName(symbol); + } + symbolName = currentSymbolName + (isFirstName ? "" : ("." + symbolName)); + if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { break; } - symbol = accessibleSymbol ? accessibleSymbol.parent : symbol.parent; + symbol = accessibleSymbolChain ? accessibleSymbolChain[0].parent : symbol.parent; + meaning = getQualifiedLeftMeaning(meaning); } return symbolName; } @@ -8603,9 +8856,12 @@ var ts; if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { writeTypeofSymbol(type); } - else if (type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */) && typeStack && ts.contains(typeStack, type)) { + else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } + else if (typeStack && ts.contains(typeStack, type)) { + writer.write("any"); + } else { if (!typeStack) { typeStack = []; @@ -8614,6 +8870,15 @@ var ts; writeLiteralType(type, allowFunctionOrConstructorTypeLiteral); typeStack.pop(); } + function shouldWriteTypeOfFunctionSymbol() { + if (type.symbol) { + var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 64 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 177 /* SourceFile */ || declaration.parent.kind === 173 /* ModuleBlock */; })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); + } + } + } } function writeTypeofSymbol(type) { writer.write("typeof "); @@ -8749,13 +9014,22 @@ var ts; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); + var resolvedExportSymbol; var symbolOfNode = getSymbolOfNode(node); - if (exportAssignmentSymbol === symbolOfNode) { + if (isSymbolUsedInExportAssignment(symbolOfNode)) { + return true; + } + if (symbolOfNode.flags & 4194304 /* Import */) { + return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); + } + } + function isSymbolUsedInExportAssignment(symbol) { + if (exportAssignmentSymbol === symbol) { return true; } if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { - var resolvedExportSymbol = resolveImport(exportAssignmentSymbol); - if (resolvedExportSymbol === symbolOfNode) { + resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); + if (resolvedExportSymbol === symbol) { return true; } return ts.forEach(resolvedExportSymbol.declarations, function (declaration) { @@ -8772,20 +9046,17 @@ var ts; function determineIfDeclarationIsVisible() { switch (node.kind) { case 166 /* VariableDeclaration */: - if (!(node.flags & 1 /* Export */)) { - return isGlobalSourceFile(node.parent.parent) || isUsedInExportAssignment(node); - } - return isDeclarationVisible(node.parent.parent); case 172 /* ModuleDeclaration */: case 169 /* ClassDeclaration */: case 170 /* InterfaceDeclaration */: case 167 /* FunctionDeclaration */: case 171 /* EnumDeclaration */: case 174 /* ImportDeclaration */: - if (!(node.flags & 1 /* Export */)) { - return isGlobalSourceFile(node.parent) || isUsedInExportAssignment(node); + var parent = node.kind === 166 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 174 /* ImportDeclaration */ && parent.kind !== 177 /* SourceFile */ && ts.isInAmbientContext(parent))) { + return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(node.parent); + return isDeclarationVisible(parent); case 115 /* Property */: case 116 /* Method */: if (node.flags & 32 /* Private */) { @@ -8807,7 +9078,7 @@ var ts; if (node) { var links = getNodeLinks(node); if (links.isVisible === undefined) { - links.isVisible = determineIfDeclarationIsVisible(); + links.isVisible = !!determineIfDeclarationIsVisible(); } return links.isVisible; } @@ -8867,7 +9138,7 @@ var ts; checkImplicitAny(type); return type; function checkImplicitAny(type) { - if (!program.getCompilerOptions().noImplicitAny) { + if (!fullTypeCheck || !program.getCompilerOptions().noImplicitAny) { return; } if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { @@ -11210,7 +11481,7 @@ var ts; var typeArgNode = typeArguments[i]; var typeArgument = getTypeFromTypeNode(typeArgNode); var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { + if (constraint && fullTypeCheck) { checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } result.push(typeArgument); @@ -11366,7 +11637,7 @@ var ts; function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); - if (targetType !== unknownType) { + if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); @@ -11394,7 +11665,7 @@ var ts; if (func.body.kind !== 168 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); - if (program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); } return widenedType; @@ -11407,7 +11678,7 @@ var ts; return unknownType; } var widenedType = getWidenedType(commonType); - if (program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); @@ -11468,6 +11739,9 @@ var ts; return (body.statements.length === 1) && (body.statements[0].kind === 160 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { + if (!fullTypeCheck) { + return; + } if (returnType === voidType || returnType === anyType) { return; } @@ -11699,7 +11973,7 @@ var ts; return rightType; } function checkAssignmentOperator(valueType) { - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); @@ -11790,24 +12064,28 @@ var ts; return unknownType; } function checkTypeParameter(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); checkSourceElement(node.constraint); - checkTypeParameterHasIllegalReferencesInConstraint(node); + if (fullTypeCheck) { + checkTypeParameterHasIllegalReferencesInConstraint(node); + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); + } } function checkParameter(parameterDeclaration) { checkVariableDeclaration(parameterDeclaration); - checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - if (parameterDeclaration.flags & 8 /* Rest */) { - if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { - error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + if (fullTypeCheck) { + checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - } - else { - if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + if (parameterDeclaration.flags & 8 /* Rest */) { + if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { + error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + else { + if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + } } } function checkReferencesInInitializer(n) { @@ -11841,17 +12119,19 @@ var ts; if (node.type) { checkSourceElement(node.type); } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithArgumentsInGeneratedCode(node); - if (program.getCompilerOptions().noImplicitAny && !node.type) { - switch (node.kind) { - case 121 /* ConstructSignature */: - error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 120 /* CallSignature */: - error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; + if (fullTypeCheck) { + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithArgumentsInGeneratedCode(node); + if (program.getCompilerOptions().noImplicitAny && !node.type) { + switch (node.kind) { + case 121 /* ConstructSignature */: + error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 120 /* CallSignature */: + error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } } } checkSpecializedSignatureDeclaration(node); @@ -11909,6 +12189,9 @@ var ts; if (!node.body) { return; } + if (!fullTypeCheck) { + return; + } function isSuperCallExpression(n) { return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; } @@ -11956,23 +12239,25 @@ var ts; } } function checkAccessorDeclaration(node) { - if (node.kind === 118 /* GetAccessor */) { - if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); + if (fullTypeCheck) { + if (node.kind === 118 /* GetAccessor */) { + if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { + error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); + } } - } - var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; - var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); - if (otherAccessor) { - var visibilityFlags = 32 /* Private */ | 16 /* Public */; - if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { - error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); - } - var thisType = getAnnotatedAccessorType(node); - var otherType = getAnnotatedAccessorType(otherAccessor); - if (thisType && otherType) { - if (!isTypeIdenticalTo(thisType, otherType)) { - error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); + if (otherAccessor) { + var visibilityFlags = 32 /* Private */ | 16 /* Public */; + if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); + } + var thisType = getAnnotatedAccessorType(node); + var otherType = getAnnotatedAccessorType(otherAccessor); + if (thisType && otherType) { + if (!isTypeIdenticalTo(thisType, otherType)) { + error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + } } } } @@ -11986,7 +12271,7 @@ var ts; for (var i = 0; i < len; i++) { checkSourceElement(node.typeArguments[i]); var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); - if (constraint) { + if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } @@ -11998,9 +12283,11 @@ var ts; } function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); - var type = getTypeFromTypeLiteralNode(node); - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + var type = getTypeFromTypeLiteralNode(node); + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } } function checkArrayType(node) { getTypeFromArrayTypeNode(node); @@ -12009,6 +12296,9 @@ var ts; return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); } function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { + if (!fullTypeCheck) { + return; + } var signature = getSignatureFromDeclaration(signatureDeclarationNode); if (!signature.hasStringLiterals) { return; @@ -12048,6 +12338,9 @@ var ts; return flags & flagsToCheck; } function checkFunctionOrConstructorSymbol(symbol) { + if (!fullTypeCheck) { + return; + } function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; if (someButNotAllOverloadFlags !== 0) { @@ -12170,6 +12463,9 @@ var ts; } } function checkExportsOnMergedDeclarations(node) { + if (!fullTypeCheck) { + return; + } var symbol; var symbol = node.localSymbol; if (!symbol) { @@ -12238,7 +12534,7 @@ var ts; if (node.type && !isAccessor(node.kind)) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (fullTypeCheck && program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { @@ -12356,26 +12652,28 @@ var ts; function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); - var type; - var useTypeFromValueDeclaration = node === symbol.valueDeclaration; - if (useTypeFromValueDeclaration) { - type = typeOfValueDeclaration; - } - else { - type = getTypeOfVariableDeclaration(node); - } - if (node.initializer) { - if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + if (fullTypeCheck) { + var symbol = getSymbolOfNode(node); + var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); + var type; + var useTypeFromValueDeclaration = node === symbol.valueDeclaration; + if (useTypeFromValueDeclaration) { + type = typeOfValueDeclaration; } - } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - if (!useTypeFromValueDeclaration) { - if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + else { + type = getTypeOfVariableDeclaration(node); + } + if (node.initializer) { + if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + } + } + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithCapturedThisVariable(node, node.name); + if (!useTypeFromValueDeclaration) { + if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + } } } } @@ -12472,7 +12770,7 @@ var ts; function checkSwitchStatement(node) { var expressionType = checkExpression(node.expression); ts.forEach(node.clauses, function (clause) { - if (clause.expression) { + if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); @@ -12556,9 +12854,11 @@ var ts; for (var i = 0; i < typeParameterDeclarations.length; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); - for (var j = 0; j < i; j++) { - if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + if (fullTypeCheck) { + for (var j = 0; j < i; j++) { + if (typeParameterDeclarations[j].symbol === node.symbol) { + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + } } } } @@ -12577,34 +12877,40 @@ var ts; checkTypeReference(node.baseType); } if (type.baseTypes.length) { - var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); - var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { - error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); + if (fullTypeCheck) { + var baseType = type.baseTypes[0]; + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var staticBaseType = getTypeOfSymbol(baseType.symbol); + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); + } + checkKindsOfPropertyMemberOverrides(type, baseType); } checkExpression(node.baseType.typeName); - checkKindsOfPropertyMemberOverrides(type, baseType); } if (node.implementedTypes) { ts.forEach(node.implementedTypes, function (typeRefNode) { checkTypeReference(typeRefNode); - var t = getTypeFromTypeReferenceNode(typeRefNode); - if (t !== unknownType) { - var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; - if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); - } - else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + if (fullTypeCheck) { + var t = getTypeFromTypeReferenceNode(typeRefNode); + if (t !== unknownType) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + } + else { + error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + } } } }); } - checkIndexConstraints(type); ts.forEach(node.members, checkSourceElement); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } } function getTargetSymbol(s) { return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; @@ -12681,28 +12987,32 @@ var ts; return true; } function checkInterfaceDeclaration(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkTypeParameters(node.typeParameters); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); - if (symbol.declarations.length > 1) { - if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + if (fullTypeCheck) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + if (symbol.declarations.length > 1) { + if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { + error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + } } - } - if (node === firstInterfaceDecl) { - var type = getDeclaredTypeOfSymbol(symbol); - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); - }); - checkIndexConstraints(type); + if (node === firstInterfaceDecl) { + var type = getDeclaredTypeOfSymbol(symbol); + if (checkInheritedPropertiesAreIdentical(type, node.name)) { + ts.forEach(type.baseTypes, function (baseType) { + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + }); + checkIndexConstraints(type); + } } } ts.forEach(node.baseTypes, checkTypeReference); ts.forEach(node.members, checkSourceElement); - checkTypeForDuplicateIndexSignatures(node); + if (fullTypeCheck) { + checkTypeForDuplicateIndexSignatures(node); + } } function getConstantValue(node) { var isNegative = false; @@ -12720,6 +13030,9 @@ var ts; return undefined; } function checkEnumDeclaration(node) { + if (!fullTypeCheck) { + return; + } checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); checkExportsOnMergedDeclarations(node); @@ -12776,26 +13089,28 @@ var ts; return undefined; } function checkModuleDeclaration(node) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { - var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (classOrFunc) { - if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } - else if (node.pos < classOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + if (fullTypeCheck) { + checkCollisionWithCapturedThisVariable(node, node.name); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (classOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { + error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } + else if (node.pos < classOrFunc.pos) { + error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } } } - } - if (node.name.kind === 3 /* StringLiteral */) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); - } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + if (node.name.kind === 3 /* StringLiteral */) { + if (!isGlobalSourceFile(node.parent)) { + error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + } + if (isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + } } } checkSourceElement(node.body); @@ -12941,7 +13256,6 @@ var ts; function checkSourceFile(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { - fullTypeCheck = true; emitExtends = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); @@ -12958,13 +13272,13 @@ var ts; if (emitExtends) links.flags |= 8 /* EmitExtends */; links.flags |= 1 /* TypeChecked */; - fullTypeCheck = false; } } function checkProgram() { ts.forEach(program.getSourceFiles(), checkSourceFile); } function getSortedDiagnostics() { + ts.Debug.assert(fullTypeCheck, "diagnostics are available only in the full typecheck mode"); if (diagnosticsModified) { diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); @@ -13384,7 +13698,8 @@ var ts; writeTypeAtLocation: writeTypeAtLocation, writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, writeSymbol: writeSymbolToTextWriter, - isSymbolAccessible: isSymbolAccessible + isSymbolAccessible: isSymbolAccessible, + isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile }; checkProgram(); return ts.emitFiles(resolver); @@ -25151,85 +25466,60 @@ var TypeScript; })(TypeScript.IncrementalParser || (TypeScript.IncrementalParser = {})); var IncrementalParser = TypeScript.IncrementalParser; })(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Services) { - var OutliningElementsCollector = (function (_super) { - __extends(OutliningElementsCollector, _super); - function OutliningElementsCollector() { - _super.call(this, OutliningElementsCollector.MaximumDepth); - this.inObjectLiteralExpression = false; - this.elements = []; +var ts; +(function (ts) { + (function (OutliningElementsCollector) { + function collectElements(sourceFile) { + var elements = []; + function addOutlineRange(hintSpanNode, startElement, endElement) { + if (hintSpanNode && startElement && endElement) { + var span = { + textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), + hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), + bannerText: "...", + autoCollapse: false + }; + elements.push(span); + } } - OutliningElementsCollector.prototype.visitClassDeclaration = function (node) { - this.addOutlineRange(node, node.openBraceToken, node.closeBraceToken); - _super.prototype.visitClassDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitInterfaceDeclaration = function (node) { - this.addOutlineRange(node, node.body.openBraceToken, node.body.closeBraceToken); - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitModuleDeclaration = function (node) { - this.addOutlineRange(node, node.openBraceToken, node.closeBraceToken); - _super.prototype.visitModuleDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitEnumDeclaration = function (node) { - this.addOutlineRange(node, node.openBraceToken, node.closeBraceToken); - _super.prototype.visitEnumDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitFunctionDeclaration = function (node) { - this.addOutlineRange(node, node.block, node.block); - _super.prototype.visitFunctionDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitFunctionExpression = function (node) { - this.addOutlineRange(node, node.block, node.block); - _super.prototype.visitFunctionExpression.call(this, node); - }; - OutliningElementsCollector.prototype.visitConstructorDeclaration = function (node) { - this.addOutlineRange(node, node.block, node.block); - _super.prototype.visitConstructorDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitMemberFunctionDeclaration = function (node) { - this.addOutlineRange(node, node.block, node.block); - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - OutliningElementsCollector.prototype.visitGetAccessor = function (node) { - if (!this.inObjectLiteralExpression) { - this.addOutlineRange(node, node.block, node.block); + var depth = 0; + var maxDepth = 20; + function walk(n) { + if (depth > maxDepth) { + return; } - _super.prototype.visitGetAccessor.call(this, node); - }; - OutliningElementsCollector.prototype.visitSetAccessor = function (node) { - if (!this.inObjectLiteralExpression) { - this.addOutlineRange(node, node.block, node.block); + switch (n.kind) { + case 143 /* Block */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + case 162 /* TryBlock */: + case 162 /* TryBlock */: + case 163 /* CatchBlock */: + case 164 /* FinallyBlock */: + var openBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 5 /* OpenBraceToken */ && c; }); + var closeBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 6 /* CloseBraceToken */ && c; }); + addOutlineRange(n.parent, openBrace, closeBrace); + break; + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 128 /* ObjectLiteral */: + var openBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 5 /* OpenBraceToken */ && c; }); + var closeBrace = ts.forEach(n.getChildren(), function (c) { return c.kind === 6 /* CloseBraceToken */ && c; }); + addOutlineRange(n, openBrace, closeBrace); + break; } - _super.prototype.visitSetAccessor.call(this, node); - }; - OutliningElementsCollector.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - OutliningElementsCollector.prototype.addOutlineRange = function (node, startElement, endElement) { - if (startElement && endElement && !TypeScript.isShared(startElement) && !TypeScript.isShared(endElement)) { - var start = TypeScript.start(startElement); - var end = TypeScript.end(endElement); - this.elements.push(TypeScript.TextSpan.fromBounds(start, end)); - } - }; - OutliningElementsCollector.collectElements = function (node) { - var collector = new OutliningElementsCollector(); - TypeScript.visitNodeOrToken(collector, node); - return collector.elements; - }; - OutliningElementsCollector.MaximumDepth = 10; - return OutliningElementsCollector; - })(TypeScript.DepthLimitedWalker); - Services.OutliningElementsCollector = OutliningElementsCollector; - })(TypeScript.Services || (TypeScript.Services = {})); - var Services = TypeScript.Services; -})(TypeScript || (TypeScript = {})); + depth++; + ts.forEachChild(n, walk); + depth--; + } + walk(sourceFile); + return elements; + } + OutliningElementsCollector.collectElements = collectElements; + })(ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); + var OutliningElementsCollector = ts.OutliningElementsCollector; +})(ts || (ts = {})); var TypeScript; (function (TypeScript) { (function (Services) { @@ -30330,9 +30620,9 @@ var ts; } var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); var newSyntaxTree = !textChangeRange || !oldSyntaxTree ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - return SourceFileObject.createSourceFileObject(this.languageVersion, this.filename, scriptSnapshot, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); }; - SourceFileObject.createSourceFileObject = function (languageVersion, filename, scriptSnapshot, version, isOpen, syntaxTree) { + SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen, syntaxTree) { var newSourceFile = ts.createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; newSourceFile.syntaxTree = syntaxTree; @@ -30534,30 +30824,58 @@ var ts; this.host = host; this.currentfilename = ""; this.currentFileVersion = -1; + this.currentSourceFile = null; this.currentFileSyntaxTree = null; this.currentFileScriptSnapshot = null; this.hostCache = new HostCache(host); } - SyntaxTreeCache.prototype.getCurrentFileSyntaxTree = function (filename) { + SyntaxTreeCache.prototype.initialize = function (filename) { + ts.Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); this.hostCache = new HostCache(this.host); var version = this.hostCache.getVersion(filename); var syntaxTree = null; + var sourceFile; if (this.currentFileSyntaxTree === null || this.currentfilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); + sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true); + fixupParentReferences(sourceFile); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentFileSyntaxTree, this.currentFileVersion); + var editRange = this.hostCache.getScriptTextChangeRangeSinceVersion(filename, this.currentFileVersion); + sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true) : this.currentSourceFile.update(scriptSnapshot, version, true, editRange); + fixupParentReferences(sourceFile); } if (syntaxTree !== null) { + ts.Debug.assert(sourceFile); this.currentFileScriptSnapshot = scriptSnapshot; this.currentFileVersion = version; this.currentfilename = filename; this.currentFileSyntaxTree = syntaxTree; + this.currentSourceFile = sourceFile; } + function fixupParentReferences(sourceFile) { + var parent = sourceFile; + function walk(n) { + n.parent = parent; + var saveParent = parent; + parent = n; + ts.forEachChild(n, walk); + parent = saveParent; + } + ts.forEachChild(sourceFile, walk); + } + }; + SyntaxTreeCache.prototype.getCurrentFileSyntaxTree = function (filename) { + this.initialize(filename); return this.currentFileSyntaxTree; }; + SyntaxTreeCache.prototype.getCurrentSourceFile = function (filename) { + this.initialize(filename); + return this.currentSourceFile; + }; SyntaxTreeCache.prototype.getCurrentScriptSnapshot = function (filename) { this.getCurrentFileSyntaxTree(filename); return this.currentFileScriptSnapshot; @@ -30607,6 +30925,9 @@ var ts; }; return SyntaxTreeCache; })(); + function createSourceFileFromScriptSnapshot(filename, scriptSnapshot, settings, version, isOpen) { + return SourceFileObject.createSourceFileObject(filename, scriptSnapshot, settings.target, version, isOpen); + } function createDocumentRegistry() { var buckets = {}; function getKeyFromCompilationSettings(settings) { @@ -30644,7 +30965,7 @@ var ts; var bucket = getBucketForCompilationSettings(compilationSettings, true); var entry = ts.lookUp(bucket, filename); if (!entry) { - var sourceFile = ts.createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), compilationSettings.target, version, isOpen); + var sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, compilationSettings, version, isOpen); bucket[filename] = entry = { sourceFile: sourceFile, refCount: 0, @@ -30696,7 +31017,8 @@ var ts; var formattingRulesProvider; var hostCache; var program; - var typeChecker; + var typeInfoResolver; + var fullTypeCheckChecker_doNotAccessDirectly; var useCaseSensitivefilenames = false; var sourceFilesByName = {}; var documentRegistry = documentRegistry; @@ -30708,6 +31030,9 @@ var ts; function getSourceFile(filename) { return ts.lookUp(sourceFilesByName, filename); } + function getFullTypeCheckChecker() { + return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(true)); + } function createCompilerHost() { return { getSourceFile: function (filename, languageVersion) { @@ -30792,11 +31117,13 @@ var ts; sourceFilesByName[filename] = sourceFile; } program = ts.createProgram(hostfilenames, compilationSettings, createCompilerHost()); - typeChecker = program.getTypeChecker(); + typeInfoResolver = program.getTypeChecker(false); + fullTypeCheckChecker_doNotAccessDirectly = undefined; } function cleanupSemanticCache() { if (program) { - typeChecker = program.getTypeChecker(); + typeInfoResolver = program.getTypeChecker(false); + fullTypeCheckChecker_doNotAccessDirectly = undefined; } } function dispose() { @@ -30814,7 +31141,7 @@ var ts; function getSemanticDiagnostics(filename) { synchronizeHostData(); filename = TypeScript.switchToForwardSlashes(filename); - return typeChecker.getDiagnostics(getSourceFile(filename).getSourceFile()); + return getFullTypeCheckChecker().getDiagnostics(getSourceFile(filename)); } function getCompilerOptionsDiagnostics() { synchronizeHostData(); @@ -30976,10 +31303,10 @@ var ts; entries: [], symbols: {}, location: mappedNode, - typeChecker: typeChecker + typeChecker: typeInfoResolver }; if (isRightOfDot) { - var type = typeChecker.getTypeOfExpression(mappedNode); + var type = typeInfoResolver.getTypeOfExpression(mappedNode); if (!type) { return undefined; } @@ -31003,7 +31330,7 @@ var ts; else { isMemberCompletion = false; var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace; - var symbols = typeChecker.getSymbolsInScope(mappedNode, symbolMeanings); + var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } } @@ -31031,7 +31358,7 @@ var ts; kind: completionEntry.kind, kindModifiers: completionEntry.kindModifiers, type: session.typeChecker.typeToString(type, session.location), - fullSymbolName: typeChecker.symbolToString(symbol, session.location), + fullSymbolName: typeInfoResolver.symbolToString(symbol, session.location), docComment: "" }; } @@ -31155,13 +31482,13 @@ var ts; var node = getNodeAtPosition(sourceFile.getSourceFile(), position); if (!node) return undefined; - var symbol = typeChecker.getSymbolInfo(node); - var type = symbol && typeChecker.getTypeOfSymbol(symbol); + var symbol = typeInfoResolver.getSymbolInfo(node); + var type = symbol && typeInfoResolver.getTypeOfSymbol(symbol); if (type) { return { - memberName: new TypeScript.MemberNameString(typeChecker.typeToString(type)), + memberName: new TypeScript.MemberNameString(typeInfoResolver.typeToString(type)), docComment: "", - fullSymbolName: typeChecker.symbolToString(symbol, getContainerNode(node)), + fullSymbolName: typeInfoResolver.symbolToString(symbol, getContainerNode(node)), kind: getSymbolKind(symbol), minChar: node.pos, limChar: node.end @@ -31282,16 +31609,16 @@ var ts; } return undefined; } - var symbol = typeChecker.getSymbolInfo(node); + var symbol = typeInfoResolver.getSymbolInfo(node); if (!symbol || !(symbol.getDeclarations())) { return undefined; } var result = []; var declarations = symbol.getDeclarations(); - var symbolName = typeChecker.symbolToString(symbol, node); + var symbolName = typeInfoResolver.symbolToString(symbol, node); var symbolKind = getSymbolKind(symbol); var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; + var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; var containerKind = containerSymbol ? getSymbolKind(symbol) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { @@ -31304,6 +31631,11 @@ var ts; filename = TypeScript.switchToForwardSlashes(filename); return syntaxTreeCache.getCurrentFileSyntaxTree(filename); } + function getCurrentSourceFile(filename) { + filename = TypeScript.switchToForwardSlashes(filename); + var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); + return currentSourceFile; + } function getNameOrDottedNameSpan(filename, startPos, endPos) { function getTypeInfoEligiblePath(filename, position, isConstructorValidPosition) { var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); @@ -31367,8 +31699,8 @@ var ts; } function getOutliningRegions(filename) { filename = TypeScript.switchToForwardSlashes(filename); - var syntaxTree = getSyntaxTree(filename); - return TypeScript.Services.OutliningElementsCollector.collectElements(syntaxTree.sourceUnit()); + var sourceFile = getCurrentSourceFile(filename); + return ts.OutliningElementsCollector.collectElements(sourceFile); } function getBraceMatchingAtPosition(filename, position) { filename = TypeScript.switchToForwardSlashes(filename); @@ -31599,7 +31931,7 @@ var TypeScript; var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; return isNoDefaultLibRegex.exec(comment); } - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; + TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; function getFileReferenceFromReferencePath(fileName, text, position, comment, diagnostics) { var lineMap = text.lineMap(); var simpleReferenceRegEx = /^\/\/\/\s* Date: Mon, 18 Aug 2014 15:52:23 -0700 Subject: [PATCH 21/21] Update LKG. --- bin/tsc.js | 10 +- bin/typescriptServices.js | 240 +++++++++++++++++++++++++------------- 2 files changed, 161 insertions(+), 89 deletions(-) diff --git a/bin/tsc.js b/bin/tsc.js index 41ca819077c..cf63006421f 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -1035,9 +1035,8 @@ var ts; } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; - var safeLength = len - 1; var commentClosed = false; - while (pos < safeLength) { + while (pos < len) { var ch = text.charCodeAt(pos); if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1050,7 +1049,6 @@ var ts; pos++; } if (!commentClosed) { - pos++; error(ts.Diagnostics.Asterisk_Slash_expected); } if (onComment) { @@ -1478,6 +1476,8 @@ var ts; SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -8685,7 +8685,7 @@ var ts; return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; } meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = symbol.parent; + symbol = getParentOfSymbol(symbol); } var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); if (symbolExternalModule) { @@ -8776,7 +8776,7 @@ var ts; if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { break; } - symbol = accessibleSymbolChain ? accessibleSymbolChain[0].parent : symbol.parent; + symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); meaning = getQualifiedLeftMeaning(meaning); } return symbolName; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index cb98750e2a3..6c47079d3ca 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -1035,9 +1035,8 @@ var ts; } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; - var safeLength = len - 1; var commentClosed = false; - while (pos < safeLength) { + while (pos < len) { var ch = text.charCodeAt(pos); if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1050,7 +1049,6 @@ var ts; pos++; } if (!commentClosed) { - pos++; error(ts.Diagnostics.Asterisk_Slash_expected); } if (onComment) { @@ -1478,6 +1476,8 @@ var ts; SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -8685,7 +8685,7 @@ var ts; return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; } meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = symbol.parent; + symbol = getParentOfSymbol(symbol); } var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); if (symbolExternalModule) { @@ -8776,7 +8776,7 @@ var ts; if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { break; } - symbol = accessibleSymbolChain ? accessibleSymbolChain[0].parent : symbol.parent; + symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); meaning = getQualifiedLeftMeaning(meaning); } return symbolName; @@ -30648,6 +30648,7 @@ var ts; EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState[EndOfLineState["EndingWithDotToken"] = 4] = "EndingWithDotToken"; })(ts.EndOfLineState || (ts.EndOfLineState = {})); var EndOfLineState = ts.EndOfLineState; (function (TokenClass) { @@ -31112,7 +31113,7 @@ var ts; sourceFile = documentRegistry.updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange); } else { - sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen, []); + sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen); } sourceFilesByName[filename] = sourceFile; } @@ -31788,113 +31789,184 @@ var ts; ts.createLanguageService = createLanguageService; function createClassifier(host) { var scanner; - var lastDiagnosticKey = null; var noRegexTable; - var reportDiagnostic = function (position, fullWidth, key, args) { - lastDiagnosticKey = key; - }; if (!noRegexTable) { noRegexTable = []; - noRegexTable[11 /* IdentifierName */] = true; - noRegexTable[14 /* StringLiteral */] = true; - noRegexTable[13 /* NumericLiteral */] = true; - noRegexTable[12 /* RegularExpressionLiteral */] = true; - noRegexTable[35 /* ThisKeyword */] = true; - noRegexTable[93 /* PlusPlusToken */] = true; - noRegexTable[94 /* MinusMinusToken */] = true; - noRegexTable[73 /* CloseParenToken */] = true; - noRegexTable[75 /* CloseBracketToken */] = true; - noRegexTable[71 /* CloseBraceToken */] = true; - noRegexTable[37 /* TrueKeyword */] = true; - noRegexTable[24 /* FalseKeyword */] = true; + noRegexTable[55 /* Identifier */] = true; + noRegexTable[3 /* StringLiteral */] = true; + noRegexTable[2 /* NumericLiteral */] = true; + noRegexTable[4 /* RegularExpressionLiteral */] = true; + noRegexTable[83 /* ThisKeyword */] = true; + noRegexTable[29 /* PlusPlusToken */] = true; + noRegexTable[30 /* MinusMinusToken */] = true; + noRegexTable[8 /* CloseParenToken */] = true; + noRegexTable[10 /* CloseBracketToken */] = true; + noRegexTable[6 /* CloseBraceToken */] = true; + noRegexTable[85 /* TrueKeyword */] = true; + noRegexTable[70 /* FalseKeyword */] = true; } function getClassificationsForLine(text, lexState) { var offset = 0; - if (lexState !== 0 /* Start */) { - if (lexState === 3 /* InDoubleQuoteStringLiteral */) { + var lastTokenOrCommentEnd = 0; + var lastToken = 0 /* Unknown */; + var inUnterminatedMultiLineComment = false; + switch (lexState) { + case 3 /* InDoubleQuoteStringLiteral */: text = '"\\\n' + text; - } - else if (lexState === 2 /* InSingleQuoteStringLiteral */) { + offset = 3; + break; + case 2 /* InSingleQuoteStringLiteral */: text = "'\\\n" + text; - } - else if (lexState === 1 /* InMultiLineCommentTrivia */) { + offset = 3; + break; + case 1 /* InMultiLineCommentTrivia */: text = "/*\n" + text; - } - offset = 3; + offset = 3; + break; + case 4 /* EndingWithDotToken */: + lastToken = 11 /* DotToken */; + break; } var result = { finalLexState: 0 /* Start */, entries: [] }; - var simpleText = TypeScript.SimpleText.fromString(text); - scanner = TypeScript.Scanner.createScanner(1 /* ES5 */, simpleText, reportDiagnostic); - var lastTokenKind = 0 /* None */; - var token = null; + scanner = ts.createScanner(1 /* ES5 */, text, onError, processComment); + var token = 0 /* Unknown */; do { - lastDiagnosticKey = null; - token = scanner.scan(!noRegexTable[lastTokenKind]); - lastTokenKind = token.kind(); - processToken(text, simpleText, offset, token, result); - } while (token.kind() !== 10 /* EndOfFileToken */); - lastDiagnosticKey = null; - return result; - } - function processToken(text, simpleText, offset, token, result) { - processTriviaList(text, offset, token.leadingTrivia(simpleText), result); - addResult(text, offset, result, TypeScript.width(token), token.kind()); - processTriviaList(text, offset, token.trailingTrivia(simpleText), result); - if (TypeScript.fullEnd(token) >= text.length) { - if (lastDiagnosticKey === TypeScript.DiagnosticCode.AsteriskSlash_expected) { - result.finalLexState = 1 /* InMultiLineCommentTrivia */; - return; + token = scanner.scan(); + if ((token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) && !noRegexTable[lastToken]) { + if (scanner.reScanSlashToken() === 4 /* RegularExpressionLiteral */) { + token = 4 /* RegularExpressionLiteral */; + } } - if (token.kind() === 14 /* StringLiteral */) { - var tokenText = token.text(); - if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === 92 /* backslash */) { - var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; - return; + else if (lastToken === 11 /* DotToken */) { + token = 55 /* Identifier */; + } + lastToken = token; + processToken(); + } while (token !== 1 /* EndOfFileToken */); + return result; + function onError(message) { + inUnterminatedMultiLineComment = message.key === ts.Diagnostics.Asterisk_Slash_expected.key; + } + function processComment(start, end) { + addLeadingWhiteSpace(start, end); + addResult(end - start, 3 /* Comment */); + } + function processToken() { + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); + addLeadingWhiteSpace(start, end); + addResult(end - start, classFromKind(token)); + if (end >= text.length) { + if (inUnterminatedMultiLineComment) { + result.finalLexState = 1 /* InMultiLineCommentTrivia */; + } + else if (token === 3 /* StringLiteral */) { + var tokenText = scanner.getTokenText(); + if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === 92 /* backslash */) { + var quoteChar = tokenText.charCodeAt(0); + result.finalLexState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; + } + } + else if (token === 11 /* DotToken */) { + result.finalLexState = 4 /* EndingWithDotToken */; } } } - } - function processTriviaList(text, offset, triviaList, result) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - addResult(text, offset, result, trivia.fullWidth(), trivia.kind()); - } - } - function addResult(text, offset, result, length, kind) { - if (length > 0) { - if (result.entries.length === 0) { - length -= offset; + function addLeadingWhiteSpace(start, end) { + if (start > lastTokenOrCommentEnd) { + addResult(start - lastTokenOrCommentEnd, 4 /* Whitespace */); + } + lastTokenOrCommentEnd = end; + } + function addResult(length, classification) { + if (length > 0) { + if (result.entries.length === 0) { + length -= offset; + } + result.entries.push({ length: length, classification: classification }); } - result.entries.push({ length: length, classification: classFromKind(kind) }); } } - function classFromKind(kind) { - if (TypeScript.SyntaxFacts.isAnyKeyword(kind)) { + function isBinaryExpressionOperatorToken(token) { + switch (token) { + case 26 /* AsteriskToken */: + case 27 /* SlashToken */: + case 28 /* PercentToken */: + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 31 /* LessThanLessThanToken */: + case 32 /* GreaterThanGreaterThanToken */: + case 33 /* GreaterThanGreaterThanGreaterThanToken */: + case 15 /* LessThanToken */: + case 16 /* GreaterThanToken */: + case 17 /* LessThanEqualsToken */: + case 18 /* GreaterThanEqualsToken */: + case 77 /* InstanceOfKeyword */: + case 76 /* InKeyword */: + case 19 /* EqualsEqualsToken */: + case 20 /* ExclamationEqualsToken */: + case 21 /* EqualsEqualsEqualsToken */: + case 22 /* ExclamationEqualsEqualsToken */: + case 34 /* AmpersandToken */: + case 36 /* CaretToken */: + case 35 /* BarToken */: + case 39 /* AmpersandAmpersandToken */: + case 40 /* BarBarToken */: + case 53 /* BarEqualsToken */: + case 52 /* AmpersandEqualsToken */: + case 54 /* CaretEqualsToken */: + case 49 /* LessThanLessThanEqualsToken */: + case 50 /* GreaterThanGreaterThanEqualsToken */: + case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 44 /* PlusEqualsToken */: + case 45 /* MinusEqualsToken */: + case 46 /* AsteriskEqualsToken */: + case 47 /* SlashEqualsToken */: + case 48 /* PercentEqualsToken */: + case 43 /* EqualsToken */: + case 14 /* CommaToken */: + return true; + default: + return false; + } + } + function isPrefixUnaryExpressionOperatorToken(token) { + switch (token) { + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + case 37 /* ExclamationToken */: + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + return true; + default: + return false; + } + } + function isKeyword(token) { + return token >= ts.SyntaxKind.FirstKeyword && token <= ts.SyntaxKind.LastKeyword; + } + function classFromKind(token) { + if (isKeyword(token)) { return 1 /* Keyword */; } - else if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(kind) || TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(kind)) { + else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 2 /* Operator */; } - else if (TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { + else if (token >= ts.SyntaxKind.FirstPunctuation && token <= ts.SyntaxKind.LastPunctuation) { return 0 /* Punctuation */; } - switch (kind) { - case 4 /* WhitespaceTrivia */: - return 4 /* Whitespace */; - case 6 /* MultiLineCommentTrivia */: - case 7 /* SingleLineCommentTrivia */: - return 3 /* Comment */; - case 13 /* NumericLiteral */: + switch (token) { + case 2 /* NumericLiteral */: return 6 /* NumberLiteral */; - case 14 /* StringLiteral */: + case 3 /* StringLiteral */: return 7 /* StringLiteral */; - case 12 /* RegularExpressionLiteral */: + case 4 /* RegularExpressionLiteral */: return 8 /* RegExpLiteral */; - case 11 /* IdentifierName */: + case 55 /* Identifier */: default: return 5 /* Identifier */; } @@ -32572,8 +32644,8 @@ var ts; TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { try { var hostAdapter = new LanguageServiceShimHostAdapter(host); - var pullLanguageService = ts.createLanguageService(hostAdapter, this.documentRegistry); - return new LanguageServiceShimObject(this, host, pullLanguageService); + var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); + return new LanguageServiceShimObject(this, host, languageService); } catch (err) { logInternalError(host, err);