@artel/artc 0.6.25279 → 0.6.25281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Cli.js +3 -3
- package/build/api/Api.js +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +30 -19
- package/build/{chunk-65GDIOT3.js → chunk-7OXU5662.js} +2 -2
- package/build/{chunk-C4HHHOM5.js → chunk-NVHCHE3R.js} +3 -2
- package/build/{chunk-HPU7DXMO.js → chunk-TIWNEKIS.js} +399 -347
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +3 -3
- package/build/types/analysis/Analyzer.d.ts +10 -15
- package/build/types/analysis/{PackageMemberNameConflictsValidator.d.ts → PackageMemberConflictsValidator.d.ts} +7 -3
- package/build/types/analysis/ResolvedTextTranslationPackage.d.ts +9 -0
- package/build/types/analysis/SourceFileMembers.d.ts +9 -2
- package/build/types/analysis/SourcePackageDependencyGraph.d.ts +4 -0
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +1 -1
- package/build/types/analysis/semantic-context/SourceFileSemanticContext.d.ts +1 -1
- package/build/types/diagnostic/DiagnosticCode.d.ts +11 -11
- package/build/types/entities/Entity.d.ts +1 -1
- package/build/types/entities/EntityLocalizationContext.d.ts +2 -1
- package/build/types/entities/PackageMembers.d.ts +10 -3
- package/build/types/entities/interfaces/TextTranslationEntity.d.ts +2 -1
- package/build/types/entities/source/SourceTextTranslationEntity.d.ts +2 -1
- package/build/types/entities/source/SourceTypeExtensionEntity.d.ts +4 -0
- package/build/types/project/PackageContent.d.ts +1 -1
- package/build/types/project/SourcePackage.d.ts +3 -1
- package/build/types/project/configuration/ConfigurationConverter.d.ts +1 -1
- package/build/types/project/configuration/types/PackageConfigurationEn.d.ts +4 -4
- package/build/types/project/configuration/types/PackageConfigurationRu.d.ts +4 -4
- package/build/types/services/EvaluatableExpressionService.d.ts +1 -1
- package/package.json +1 -1
- package/build/types/analysis/AnalyzedTextTranslationPackage.d.ts +0 -20
|
@@ -764,8 +764,8 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
|
764
764
|
};
|
|
765
765
|
|
|
766
766
|
// source/common/Constants.ts
|
|
767
|
-
var ArtelVersion = true ? "0.6.
|
|
768
|
-
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel"];
|
|
767
|
+
var ArtelVersion = true ? "0.6.25281" : "";
|
|
768
|
+
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel", ".\u0430\u0440\u0442\u043C", ".\u0430\u0440\u0442\u0435\u043B\u044C\u043C", ".artm", ".artelm"];
|
|
769
769
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
|
770
770
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
|
771
771
|
var ConfigurationDirectoryNamesByLocale = /* @__PURE__ */ new Map([
|
|
@@ -8432,9 +8432,9 @@ function traverseTree(root, visitTokens, taskController, nodeVisitor) {
|
|
|
8432
8432
|
stack.push(root);
|
|
8433
8433
|
while (stack.length > 0) {
|
|
8434
8434
|
const node = stack.pop();
|
|
8435
|
-
const
|
|
8436
|
-
if (
|
|
8437
|
-
yield
|
|
8435
|
+
const asyncVisitor = nodeVisitor(node, controller);
|
|
8436
|
+
if (asyncVisitor !== void 0) {
|
|
8437
|
+
yield asyncVisitor;
|
|
8438
8438
|
}
|
|
8439
8439
|
if (controller.shouldStopTraverse()) {
|
|
8440
8440
|
break;
|
|
@@ -8902,17 +8902,17 @@ var DiagnosticCode = /* @__PURE__ */ ((DiagnosticCode2) => {
|
|
|
8902
8902
|
DiagnosticCode2[DiagnosticCode2["RequiredTypeParametersCannotFollowTypeParametersWithDefaults"] = 382] = "RequiredTypeParametersCannotFollowTypeParametersWithDefaults";
|
|
8903
8903
|
DiagnosticCode2[DiagnosticCode2["RequiredParametersCannotFollowOptionalParameters"] = 383] = "RequiredParametersCannotFollowOptionalParameters";
|
|
8904
8904
|
DiagnosticCode2[DiagnosticCode2["ExpressionCannotBeReferenced"] = 384] = "ExpressionCannotBeReferenced";
|
|
8905
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8906
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8907
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8908
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8909
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8910
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8911
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8912
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8913
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8914
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8915
|
-
DiagnosticCode2[DiagnosticCode2["
|
|
8905
|
+
DiagnosticCode2[DiagnosticCode2["TextIsMissingAmongPrimaryTextTranslationDefinitions"] = 385] = "TextIsMissingAmongPrimaryTextTranslationDefinitions";
|
|
8906
|
+
DiagnosticCode2[DiagnosticCode2["DeclarationHasAlreadyBeenTranslated"] = 386] = "DeclarationHasAlreadyBeenTranslated";
|
|
8907
|
+
DiagnosticCode2[DiagnosticCode2["TheNumberOfTranslatedParametersMustBeEqualToTheNumberOfSourceParameters"] = 387] = "TheNumberOfTranslatedParametersMustBeEqualToTheNumberOfSourceParameters";
|
|
8908
|
+
DiagnosticCode2[DiagnosticCode2["TheNumberOfTranslatedTypeParametersMustBeEqualToTheNumberOfSourceTypeParameters"] = 388] = "TheNumberOfTranslatedTypeParametersMustBeEqualToTheNumberOfSourceTypeParameters";
|
|
8909
|
+
DiagnosticCode2[DiagnosticCode2["TheNameOfTheTranslatedOperatorMustMeTheSameAsSourceOperatorName"] = 389] = "TheNameOfTheTranslatedOperatorMustMeTheSameAsSourceOperatorName";
|
|
8910
|
+
DiagnosticCode2[DiagnosticCode2["TranslationOfFunctionTypeMustIncludeParameterList"] = 390] = "TranslationOfFunctionTypeMustIncludeParameterList";
|
|
8911
|
+
DiagnosticCode2[DiagnosticCode2["OnlyOneTextTranslationPackageShouldBeMarkedAsPrimary"] = 391] = "OnlyOneTextTranslationPackageShouldBeMarkedAsPrimary";
|
|
8912
|
+
DiagnosticCode2[DiagnosticCode2["Declarations0And1HaveTheSameSourceNamesButDifferentTranslatedNames23"] = 392] = "Declarations0And1HaveTheSameSourceNamesButDifferentTranslatedNames23";
|
|
8913
|
+
DiagnosticCode2[DiagnosticCode2["TranslatedDeclarations0And1HaveTheSameTranslatedNamesButDifferentSourceNames23"] = 393] = "TranslatedDeclarations0And1HaveTheSameTranslatedNamesButDifferentSourceNames23";
|
|
8914
|
+
DiagnosticCode2[DiagnosticCode2["TranslatedOverridingMember0MustTheSameNameAsBaseMember1"] = 394] = "TranslatedOverridingMember0MustTheSameNameAsBaseMember1";
|
|
8915
|
+
DiagnosticCode2[DiagnosticCode2["TextTranslationAlreadyExistsInTheTextTranslationPackage"] = 395] = "TextTranslationAlreadyExistsInTheTextTranslationPackage";
|
|
8916
8916
|
DiagnosticCode2[DiagnosticCode2["CannotFindTsLibDirectoryBaseSearchPaths0"] = 401] = "CannotFindTsLibDirectoryBaseSearchPaths0";
|
|
8917
8917
|
DiagnosticCode2[DiagnosticCode2["SourceFile0IsNotPartOfThePackageAndWontBeLoaded"] = 402] = "SourceFile0IsNotPartOfThePackageAndWontBeLoaded";
|
|
8918
8918
|
DiagnosticCode2[DiagnosticCode2["ProgramWithoutMainPackageCannotBeCompiled"] = 403] = "ProgramWithoutMainPackageCannotBeCompiled";
|
|
@@ -9189,17 +9189,17 @@ var englishErrorMessages = {
|
|
|
9189
9189
|
[382 /* RequiredTypeParametersCannotFollowTypeParametersWithDefaults */]: "Required type parameters cannot follow type parameters with defaults.",
|
|
9190
9190
|
[383 /* RequiredParametersCannotFollowOptionalParameters */]: "Required parameters cannot follow optional parameters.",
|
|
9191
9191
|
[384 /* ExpressionCannotBeReferenced */]: "Expression cannot be referenced.",
|
|
9192
|
-
[385 /*
|
|
9193
|
-
[386 /*
|
|
9194
|
-
[387 /*
|
|
9195
|
-
[388 /*
|
|
9196
|
-
[389 /*
|
|
9197
|
-
[390 /*
|
|
9198
|
-
[391 /*
|
|
9199
|
-
[392 /*
|
|
9200
|
-
[393 /*
|
|
9201
|
-
[394 /*
|
|
9202
|
-
[395 /*
|
|
9192
|
+
[385 /* TextIsMissingAmongPrimaryTextTranslationDefinitions */]: "Text is missing among primary text translation definitions.",
|
|
9193
|
+
[386 /* DeclarationHasAlreadyBeenTranslated */]: "Declaration has already been translated.",
|
|
9194
|
+
[387 /* TheNumberOfTranslatedParametersMustBeEqualToTheNumberOfSourceParameters */]: "The number of translated parameters must be equal to the number of source parameters.",
|
|
9195
|
+
[388 /* TheNumberOfTranslatedTypeParametersMustBeEqualToTheNumberOfSourceTypeParameters */]: "The number of translated type parameters must be equal to the number of source type parameters.",
|
|
9196
|
+
[389 /* TheNameOfTheTranslatedOperatorMustMeTheSameAsSourceOperatorName */]: "The name of the translated operator must me the same as source operator name.",
|
|
9197
|
+
[390 /* TranslationOfFunctionTypeMustIncludeParameterList */]: "Translation of function type must include parameter list.",
|
|
9198
|
+
[391 /* OnlyOneTextTranslationPackageShouldBeMarkedAsPrimary */]: "Only one text translation package should be marked as primary (for the same translating package).",
|
|
9199
|
+
[392 /* Declarations0And1HaveTheSameSourceNamesButDifferentTranslatedNames23 */]: "Declarations that have the same source names must have the same translated names.\nDeclarations\n{0}\nand\n{1}\nhave the same source names, but different translated names: '{2}' and '{3}'.",
|
|
9200
|
+
[393 /* TranslatedDeclarations0And1HaveTheSameTranslatedNamesButDifferentSourceNames23 */]: "Declarations that have different source names must have different translated names.\nTranslated declarations\n{0}\nand\n{1}\nhave the same translated names, but different source names: '{2}' and '{3}'.",
|
|
9201
|
+
[394 /* TranslatedOverridingMember0MustTheSameNameAsBaseMember1 */]: "Translated derived member '{0}' must have the same name as base member '{1}'.",
|
|
9202
|
+
[395 /* TextTranslationAlreadyExistsInTheTextTranslationPackage */]: "Text translation already exists in the text translation package.",
|
|
9203
9203
|
[401 /* CannotFindTsLibDirectoryBaseSearchPaths0 */]: "Can not find directory with TypeScript library. Base search paths: {0}.",
|
|
9204
9204
|
[402 /* SourceFile0IsNotPartOfThePackageAndWontBeLoaded */]: "Source file '{0}' is not part of the package and won't be loaded.",
|
|
9205
9205
|
[403 /* ProgramWithoutMainPackageCannotBeCompiled */]: "Program without main package cannot be compiled.",
|
|
@@ -9429,17 +9429,17 @@ var russianErrorMessages = {
|
|
|
9429
9429
|
[382 /* RequiredTypeParametersCannotFollowTypeParametersWithDefaults */]: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0442\u0438\u043F\u0430 \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u044C \u0437\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438 \u0442\u0438\u043F\u0430 \u0441\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u043C\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.",
|
|
9430
9430
|
[383 /* RequiredParametersCannotFollowOptionalParameters */]: "\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u044C \u0437\u0430 \u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438.",
|
|
9431
9431
|
[384 /* ExpressionCannotBeReferenced */]: "\u041D\u0435\u043B\u044C\u0437\u044F \u0432\u0437\u044F\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435.",
|
|
9432
|
-
[385 /*
|
|
9433
|
-
[386 /*
|
|
9434
|
-
[387 /*
|
|
9435
|
-
[388 /*
|
|
9436
|
-
[389 /*
|
|
9437
|
-
[390 /*
|
|
9438
|
-
[391 /*
|
|
9439
|
-
[392 /*
|
|
9440
|
-
[393 /*
|
|
9441
|
-
[394 /*
|
|
9442
|
-
[395 /*
|
|
9432
|
+
[385 /* TextIsMissingAmongPrimaryTextTranslationDefinitions */]: "\u0422\u0435\u043A\u0441\u0442 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439 \u043F\u0435\u0440\u0432\u0438\u0447\u043D\u044B\u0445 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u043E\u0432 \u0442\u0435\u043A\u0441\u0442\u043E\u0432.",
|
|
9433
|
+
[386 /* DeclarationHasAlreadyBeenTranslated */]: "\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0431\u044B\u043B\u043E \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043D\u043E.",
|
|
9434
|
+
[387 /* TheNumberOfTranslatedParametersMustBeEqualToTheNumberOfSourceParameters */]: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0440\u0430\u0432\u043D\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
|
9435
|
+
[388 /* TheNumberOfTranslatedTypeParametersMustBeEqualToTheNumberOfSourceTypeParameters */]: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0442\u0438\u043F\u0430 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0440\u0430\u0432\u043D\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0445 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0442\u0438\u043F\u0430.",
|
|
9436
|
+
[389 /* TheNameOfTheTranslatedOperatorMustMeTheSameAsSourceOperatorName */]: "\u0418\u043C\u044F \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u043E\u0433\u043E \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0430 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0442\u0430\u043A\u0438\u043C \u0436\u0435, \u043A\u0430\u043A \u0438\u043C\u044F \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0430.",
|
|
9437
|
+
[390 /* TranslationOfFunctionTypeMustIncludeParameterList */]: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430 \u0434\u043E\u043B\u0436\u0435\u043D \u0432\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0441\u043F\u0438\u0441\u043E\u043A \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
|
9438
|
+
[391 /* OnlyOneTextTranslationPackageShouldBeMarkedAsPrimary */]: "\u041B\u0438\u0448\u044C \u043E\u0434\u0438\u043D \u043F\u0430\u043A\u0435\u0442 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u0435\u0440\u0432\u0438\u0447\u043D\u044B\u043C (\u0434\u043B\u044F \u043E\u0434\u043D\u043E\u0433\u043E \u0438 \u0442\u043E\u0433\u043E \u0436\u0435 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430).",
|
|
9439
|
+
[392 /* Declarations0And1HaveTheSameSourceNamesButDifferentTranslatedNames23 */]: "\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F, \u0438\u043C\u0435\u044E\u0449\u0438\u0435 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430, \u0434\u043E\u043B\u0436\u043D\u044B \u0438\u043C\u0435\u0442\u044C \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430.\n\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F\n{0}\n\u0438\n{1}\n\u0438\u043C\u0435\u044E\u0442 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430, \u043D\u043E \u0440\u0430\u0437\u043D\u044B\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430: '{2}' \u0438 '{3}'.",
|
|
9440
|
+
[393 /* TranslatedDeclarations0And1HaveTheSameTranslatedNamesButDifferentSourceNames23 */]: "\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F, \u0438\u043C\u0435\u044E\u0449\u0438\u0435 \u0440\u0430\u0437\u043D\u044B\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430, \u0434\u043E\u043B\u0436\u043D\u044B \u0438\u043C\u0435\u0442\u044C \u0440\u0430\u0437\u043D\u044B\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430.\n\u041F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0435 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F\n{0}\n\u0438\n{1}\n\u0438\u043C\u0435\u044E\u0442 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430, \u043D\u043E \u0440\u0430\u0437\u043D\u044B\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430: '{2}' \u0438 '{3}'.",
|
|
9441
|
+
[394 /* TranslatedOverridingMember0MustTheSameNameAsBaseMember1 */]: "\u041F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u044B\u0439 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0447\u043B\u0435\u043D \u0442\u0438\u043F\u0430 '{0}' \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u0442\u0430\u043A\u043E\u0435 \u0436\u0435 \u0438\u043C\u044F, \u043A\u0430\u043A \u0431\u0430\u0437\u043E\u0432\u044B\u0439 \u0447\u043B\u0435\u043D \u0442\u0438\u043F\u0430 '{1}'.",
|
|
9442
|
+
[395 /* TextTranslationAlreadyExistsInTheTextTranslationPackage */]: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u0442\u0435\u043A\u0441\u0442\u0430 \u0443\u0436\u0435 \u0437\u0430\u0434\u0430\u043D \u0432 \u043F\u0430\u043A\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u043E\u0432 \u0442\u0435\u043A\u0441\u0442\u0430.",
|
|
9443
9443
|
[401 /* CannotFindTsLibDirectoryBaseSearchPaths0 */]: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043D\u0430\u0439\u0442\u0438 \u043F\u0430\u043F\u043A\u0443 \u0441\u043E \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0439 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u043E\u0439 TypeScript. \u041F\u0443\u0442\u0438, \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u043E\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043B\u044F\u043B\u0441\u044F \u043F\u043E\u0438\u0441\u043A: {0}.",
|
|
9444
9444
|
[402 /* SourceFile0IsNotPartOfThePackageAndWontBeLoaded */]: "\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0444\u0430\u0439\u043B '{0}' \u043D\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0447\u0430\u0441\u0442\u044C\u044E \u043F\u0430\u043A\u0435\u0442\u0430 \u0438 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D.",
|
|
9445
9445
|
[403 /* ProgramWithoutMainPackageCannotBeCompiled */]: "\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0431\u0435\u0437 \u0433\u043B\u0430\u0432\u043D\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0430.",
|
|
@@ -13193,7 +13193,7 @@ function isNamedTypeEntity(entity) {
|
|
|
13193
13193
|
}
|
|
13194
13194
|
}
|
|
13195
13195
|
function isPackageMemberEntity(entity) {
|
|
13196
|
-
if (entity.kind === 0 /* Variable */ && entity.subkind === "package" || entity.kind === 1 /* Function */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 1 /* Structured */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 3 /* Variant */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 0 /* Function */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 4 /* Alias */ || entity.kind === 11 /* TypeExtension */) {
|
|
13196
|
+
if (entity.kind === 0 /* Variable */ && entity.subkind === "package" || entity.kind === 1 /* Function */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 1 /* Structured */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 3 /* Variant */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 0 /* Function */ && entity.subkind === "package" || entity.kind === 2 /* Type */ && entity.typeEntityKind === 4 /* Alias */ || entity.kind === 11 /* TypeExtension */ || entity.kind === 13 /* TextTranslation */) {
|
|
13197
13197
|
return true;
|
|
13198
13198
|
}
|
|
13199
13199
|
Debug.typeIsAssignableTo();
|
|
@@ -15510,17 +15510,27 @@ IntrinsicLocalVariableEntity = __decorateClass([
|
|
|
15510
15510
|
|
|
15511
15511
|
// source/entities/PackageMembers.ts
|
|
15512
15512
|
var PackageEntityMembers = class _PackageEntityMembers {
|
|
15513
|
-
constructor(namedMembers, typeExtensions) {
|
|
15513
|
+
constructor(namedMembers, typeExtensions, textTranslations) {
|
|
15514
15514
|
this.namedMembers = namedMembers;
|
|
15515
15515
|
this.typeExtensions = typeExtensions;
|
|
15516
|
+
this.textTranslations = textTranslations;
|
|
15516
15517
|
this.membersByNameKey_ = new Cached();
|
|
15518
|
+
this.textTranslationsByTextKey_ = new Cached();
|
|
15517
15519
|
}
|
|
15518
15520
|
static {
|
|
15519
15521
|
this.emptyNamedMembers = [];
|
|
15520
15522
|
}
|
|
15523
|
+
static {
|
|
15524
|
+
this.emptyTextTranslations = [];
|
|
15525
|
+
}
|
|
15521
15526
|
get membersByNameKey() {
|
|
15522
15527
|
return this.membersByNameKey_.getOrInsertWith(() => Query.groupByToMap(this.namedMembers, (m) => m.getName().key));
|
|
15523
15528
|
}
|
|
15529
|
+
get textTranslationsByTextKey() {
|
|
15530
|
+
return this.textTranslationsByTextKey_.getOrInsertWith(
|
|
15531
|
+
() => Query.groupByToMap(this.textTranslations, (d) => d.getKey())
|
|
15532
|
+
);
|
|
15533
|
+
}
|
|
15524
15534
|
getNamedMembers() {
|
|
15525
15535
|
return this.namedMembers;
|
|
15526
15536
|
}
|
|
@@ -15533,8 +15543,15 @@ var PackageEntityMembers = class _PackageEntityMembers {
|
|
|
15533
15543
|
getTypeExtensionsByType(type) {
|
|
15534
15544
|
return this.typeExtensions.filter((t) => t.getExtendedTypeEntity() === type);
|
|
15535
15545
|
}
|
|
15536
|
-
|
|
15537
|
-
return this.
|
|
15546
|
+
getTextTranslations() {
|
|
15547
|
+
return this.textTranslations;
|
|
15548
|
+
}
|
|
15549
|
+
getTextTranslationsByTextKey(key) {
|
|
15550
|
+
return this.textTranslationsByTextKey.get(key) ?? _PackageEntityMembers.emptyTextTranslations;
|
|
15551
|
+
}
|
|
15552
|
+
*getNamedMembersAndTypeExtensions() {
|
|
15553
|
+
yield* __yieldStar(this.namedMembers);
|
|
15554
|
+
yield* __yieldStar(this.typeExtensions);
|
|
15538
15555
|
}
|
|
15539
15556
|
};
|
|
15540
15557
|
|
|
@@ -15632,7 +15649,7 @@ var Compilation = class {
|
|
|
15632
15649
|
this.updateParsedSourceFiles();
|
|
15633
15650
|
result = this.parsedSourceFiles.get(node);
|
|
15634
15651
|
}
|
|
15635
|
-
Debug.assertNotNull(result, "
|
|
15652
|
+
Debug.assertNotNull(result, "\u0414\u0435\u0440\u0435\u0432\u043E \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0444\u0430\u0439\u043B\u0430 \u043D\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0447\u0430\u0441\u0442\u044C\u044E \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u0438.");
|
|
15636
15653
|
return result;
|
|
15637
15654
|
}
|
|
15638
15655
|
getPackageByUri(uri) {
|
|
@@ -15793,13 +15810,14 @@ var TranslationPackageConfiguration = class {
|
|
|
15793
15810
|
}
|
|
15794
15811
|
};
|
|
15795
15812
|
var TextTranslationPackageConfiguration = class {
|
|
15796
|
-
constructor(targetPackageName, translationLocale, isPrimaryTranslation = false, locale, dialect = DefaultDialect, version, packageImportLocales = [], automaticallyImportedPackages) {
|
|
15813
|
+
constructor(targetPackageName, translationLocale, isPrimaryTranslation = false, locale, dialect = DefaultDialect, version, targetPlatform = new TargetPlatformConfig.Any(), packageImportLocales = [], automaticallyImportedPackages) {
|
|
15797
15814
|
this.targetPackageName = targetPackageName;
|
|
15798
15815
|
this.translationLocale = translationLocale;
|
|
15799
15816
|
this.isPrimaryTranslation = isPrimaryTranslation;
|
|
15800
15817
|
this.locale = locale;
|
|
15801
15818
|
this.dialect = dialect;
|
|
15802
15819
|
this.version = version;
|
|
15820
|
+
this.targetPlatform = targetPlatform;
|
|
15803
15821
|
this.packageImportLocales = packageImportLocales;
|
|
15804
15822
|
this.automaticallyImportedPackages = automaticallyImportedPackages;
|
|
15805
15823
|
this.name = new PackageName2([...this.targetPackageName.segments, new Name("~"), new Name(this.translationLocale)]);
|
|
@@ -15975,8 +15993,8 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
15975
15993
|
case "PackageGroup":
|
|
15976
15994
|
packageGroupConfiguration = this.convertPackageGroupConfiguration(configuration);
|
|
15977
15995
|
break;
|
|
15978
|
-
case "
|
|
15979
|
-
packageConfiguration = this.
|
|
15996
|
+
case "NameTranslations":
|
|
15997
|
+
packageConfiguration = this.convertNameTranslationsConfiguration(configuration, defaultLocale, defaultDialect);
|
|
15980
15998
|
break;
|
|
15981
15999
|
case "TextTranslations":
|
|
15982
16000
|
packageConfiguration = this.convertTextTranslationsConfiguration(configuration, defaultLocale, defaultDialect);
|
|
@@ -16030,7 +16048,7 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
16030
16048
|
static convertPackageGroupConfiguration(configuration) {
|
|
16031
16049
|
return new PackageGroupConfiguration();
|
|
16032
16050
|
}
|
|
16033
|
-
static
|
|
16051
|
+
static convertNameTranslationsConfiguration(configuration, defaultLocale, defaultDialect) {
|
|
16034
16052
|
const targetPackageName = PackageName2.parse(configuration.originalPackageName);
|
|
16035
16053
|
const translatedName = PackageName2.parse(configuration.translatedPackageName);
|
|
16036
16054
|
const translationLocale = this.convertLanguage(configuration.translationLanguage);
|
|
@@ -16039,11 +16057,12 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
16039
16057
|
return new TranslationPackageConfiguration(targetPackageName, translatedName, translationLocale, locale, dialect);
|
|
16040
16058
|
}
|
|
16041
16059
|
static convertTextTranslationsConfiguration(configuration, defaultLocale, defaultDialect) {
|
|
16042
|
-
const targetPackageName = PackageName2.parse(configuration.
|
|
16060
|
+
const targetPackageName = PackageName2.parse(configuration.targetPackageName);
|
|
16043
16061
|
const translationLocale = configuration.translationLanguage;
|
|
16044
16062
|
const isPrimaryTranslation = configuration.isPrimaryTranslation ?? false;
|
|
16045
16063
|
const locale = configuration.language !== void 0 ? this.convertLanguage(configuration.language) : defaultLocale ?? DefaultLocale;
|
|
16046
16064
|
const dialect = configuration.dialect !== void 0 ? this.convertDialect(configuration.dialect) : defaultDialect ?? DefaultDialect;
|
|
16065
|
+
const targetPlatform = new TargetPlatformConfig.Any();
|
|
16047
16066
|
const packageImportLocales = _ConfigurationConverter.convertPackageImportLanguages(
|
|
16048
16067
|
configuration.packageImportLanguages
|
|
16049
16068
|
);
|
|
@@ -16055,6 +16074,7 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
16055
16074
|
locale,
|
|
16056
16075
|
dialect,
|
|
16057
16076
|
configuration.version ?? "1.0",
|
|
16077
|
+
targetPlatform,
|
|
16058
16078
|
packageImportLocales,
|
|
16059
16079
|
automaticallyImportedPackages
|
|
16060
16080
|
);
|
|
@@ -16233,7 +16253,7 @@ var config_en_schema_default = {
|
|
|
16233
16253
|
$ref: "#/definitions/PackageGroup"
|
|
16234
16254
|
},
|
|
16235
16255
|
{
|
|
16236
|
-
$ref: "#/definitions/
|
|
16256
|
+
$ref: "#/definitions/NameTranslations"
|
|
16237
16257
|
},
|
|
16238
16258
|
{
|
|
16239
16259
|
$ref: "#/definitions/TextTranslations"
|
|
@@ -16649,12 +16669,12 @@ var config_en_schema_default = {
|
|
|
16649
16669
|
],
|
|
16650
16670
|
additionalProperties: false
|
|
16651
16671
|
},
|
|
16652
|
-
|
|
16672
|
+
NameTranslations: {
|
|
16653
16673
|
type: "object",
|
|
16654
16674
|
properties: {
|
|
16655
16675
|
type: {
|
|
16656
16676
|
type: "string",
|
|
16657
|
-
const: "
|
|
16677
|
+
const: "NameTranslations"
|
|
16658
16678
|
},
|
|
16659
16679
|
originalPackageName: {
|
|
16660
16680
|
type: "string"
|
|
@@ -16687,7 +16707,7 @@ var config_en_schema_default = {
|
|
|
16687
16707
|
type: "string",
|
|
16688
16708
|
const: "TextTranslations"
|
|
16689
16709
|
},
|
|
16690
|
-
|
|
16710
|
+
targetPackageName: {
|
|
16691
16711
|
type: "string"
|
|
16692
16712
|
},
|
|
16693
16713
|
translationLanguage: {
|
|
@@ -16720,7 +16740,7 @@ var config_en_schema_default = {
|
|
|
16720
16740
|
},
|
|
16721
16741
|
required: [
|
|
16722
16742
|
"type",
|
|
16723
|
-
"
|
|
16743
|
+
"targetPackageName",
|
|
16724
16744
|
"translationLanguage"
|
|
16725
16745
|
],
|
|
16726
16746
|
additionalProperties: false
|
|
@@ -16748,7 +16768,7 @@ var config_ru_schema_default = {
|
|
|
16748
16768
|
$ref: "#/definitions/\u0413\u0440\u0443\u043F\u043F\u0430\u041F\u0430\u043A\u0435\u0442\u043E\u0432"
|
|
16749
16769
|
},
|
|
16750
16770
|
{
|
|
16751
|
-
$ref: "#/definitions/\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B"
|
|
16771
|
+
$ref: "#/definitions/\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0418\u043C\u0451\u043D"
|
|
16752
16772
|
},
|
|
16753
16773
|
{
|
|
16754
16774
|
$ref: "#/definitions/\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0422\u0435\u043A\u0441\u0442\u043E\u0432"
|
|
@@ -17171,12 +17191,12 @@ var config_ru_schema_default = {
|
|
|
17171
17191
|
],
|
|
17172
17192
|
additionalProperties: false
|
|
17173
17193
|
},
|
|
17174
|
-
\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B: {
|
|
17194
|
+
\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0418\u043C\u0451\u043D: {
|
|
17175
17195
|
type: "object",
|
|
17176
17196
|
properties: {
|
|
17177
17197
|
\u0442\u0438\u043F: {
|
|
17178
17198
|
type: "string",
|
|
17179
|
-
const: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B"
|
|
17199
|
+
const: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0418\u043C\u0451\u043D"
|
|
17180
17200
|
},
|
|
17181
17201
|
\u0438\u043C\u044F\u041F\u0430\u043A\u0435\u0442\u0430\u0418\u0441\u0445\u043E\u0434\u043D\u043E\u0435: {
|
|
17182
17202
|
type: "string"
|
|
@@ -17209,7 +17229,7 @@ var config_ru_schema_default = {
|
|
|
17209
17229
|
type: "string",
|
|
17210
17230
|
const: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0422\u0435\u043A\u0441\u0442\u043E\u0432"
|
|
17211
17231
|
},
|
|
17212
|
-
\u0438\u043C\u044F\u041F\
|
|
17232
|
+
\u0438\u043C\u044F\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C\u043E\u0433\u043E\u041F\u0430\u043A\u0435\u0442\u0430: {
|
|
17213
17233
|
type: "string"
|
|
17214
17234
|
},
|
|
17215
17235
|
\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430: {
|
|
@@ -17242,7 +17262,7 @@ var config_ru_schema_default = {
|
|
|
17242
17262
|
},
|
|
17243
17263
|
required: [
|
|
17244
17264
|
"\u0442\u0438\u043F",
|
|
17245
|
-
"\u0438\u043C\u044F\u041F\
|
|
17265
|
+
"\u0438\u043C\u044F\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C\u043E\u0433\u043E\u041F\u0430\u043A\u0435\u0442\u0430",
|
|
17246
17266
|
"\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430"
|
|
17247
17267
|
],
|
|
17248
17268
|
additionalProperties: false
|
|
@@ -17306,8 +17326,8 @@ var RussianConfigurationTranslator = class {
|
|
|
17306
17326
|
return this.translatePackage(value);
|
|
17307
17327
|
case "\u0413\u0440\u0443\u043F\u043F\u0430\u041F\u0430\u043A\u0435\u0442\u043E\u0432":
|
|
17308
17328
|
return this.translatePackageGroup(value);
|
|
17309
|
-
case "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B":
|
|
17310
|
-
return this.
|
|
17329
|
+
case "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0418\u043C\u0451\u043D":
|
|
17330
|
+
return this.translateNameTranslations(value);
|
|
17311
17331
|
case "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B\u0422\u0435\u043A\u0441\u0442\u043E\u0432":
|
|
17312
17332
|
return this.translateTextTranslations(value);
|
|
17313
17333
|
default:
|
|
@@ -17332,9 +17352,9 @@ var RussianConfigurationTranslator = class {
|
|
|
17332
17352
|
static translatePackageGroup(value) {
|
|
17333
17353
|
return { type: "PackageGroup" };
|
|
17334
17354
|
}
|
|
17335
|
-
static
|
|
17355
|
+
static translateNameTranslations(value) {
|
|
17336
17356
|
return {
|
|
17337
|
-
type: "
|
|
17357
|
+
type: "NameTranslations",
|
|
17338
17358
|
originalPackageName: value.\u0438\u043C\u044F\u041F\u0430\u043A\u0435\u0442\u0430\u0418\u0441\u0445\u043E\u0434\u043D\u043E\u0435,
|
|
17339
17359
|
translatedPackageName: value.\u0438\u043C\u044F\u041F\u0430\u043A\u0435\u0442\u0430\u041F\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043D\u043D\u043E\u0435,
|
|
17340
17360
|
translationLanguage: this.translateLanguage(value.\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430),
|
|
@@ -17345,7 +17365,7 @@ var RussianConfigurationTranslator = class {
|
|
|
17345
17365
|
static translateTextTranslations(value) {
|
|
17346
17366
|
return {
|
|
17347
17367
|
type: "TextTranslations",
|
|
17348
|
-
|
|
17368
|
+
targetPackageName: value.\u0438\u043C\u044F\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u043C\u043E\u0433\u043E\u041F\u0430\u043A\u0435\u0442\u0430,
|
|
17349
17369
|
translationLanguage: value.\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430,
|
|
17350
17370
|
isPrimaryTranslation: this.translateYesNo(value.\u044D\u0442\u043E\u041F\u0435\u0440\u0432\u0438\u0447\u043D\u044B\u0439\u041F\u0435\u0440\u0435\u0432\u043E\u0434),
|
|
17351
17371
|
version: value.\u0432\u0435\u0440\u0441\u0438\u044F,
|
|
@@ -22793,8 +22813,8 @@ var PackageContentsCompilationLoader = class {
|
|
|
22793
22813
|
case "Package":
|
|
22794
22814
|
configuration = ConfigurationConverter.convertPackageConfiguration(rawConfiguration);
|
|
22795
22815
|
break;
|
|
22796
|
-
case "
|
|
22797
|
-
configuration = ConfigurationConverter.
|
|
22816
|
+
case "NameTranslations":
|
|
22817
|
+
configuration = ConfigurationConverter.convertNameTranslationsConfiguration(rawConfiguration);
|
|
22798
22818
|
break;
|
|
22799
22819
|
case "TextTranslations":
|
|
22800
22820
|
configuration = ConfigurationConverter.convertTextTranslationsConfiguration(rawConfiguration);
|
|
@@ -22905,7 +22925,7 @@ function createPackageContent(pkg2, fileSystemTree) {
|
|
|
22905
22925
|
return void 0;
|
|
22906
22926
|
}
|
|
22907
22927
|
const configuration = configurationArray.at(0);
|
|
22908
|
-
if (!(configuration?.type === "Package" || configuration?.type === "
|
|
22928
|
+
if (!(configuration?.type === "Package" || configuration?.type === "NameTranslations")) {
|
|
22909
22929
|
return void 0;
|
|
22910
22930
|
}
|
|
22911
22931
|
const fileContents = pkg2.sourceFiles.map((f, i) => {
|
|
@@ -26404,7 +26424,7 @@ var TsPackageMembersCreator = class {
|
|
|
26404
26424
|
members = Query.from(this.namedDeclarationsByName.values()).flatMap((d) => d.map((d2) => this.getSourceEntity(d2))).chain(membersFromSymbols).unique().toArray();
|
|
26405
26425
|
}
|
|
26406
26426
|
return new TsPackageMembersCreationResult(
|
|
26407
|
-
new PackageEntityMembers(members, []),
|
|
26427
|
+
new PackageEntityMembers(members, [], []),
|
|
26408
26428
|
this.typeEntityBySymbol,
|
|
26409
26429
|
this.packageMemberEntityByNode
|
|
26410
26430
|
);
|
|
@@ -27609,7 +27629,7 @@ var TsPackageEntityForSymbolsWithUnknownOrigin = class {
|
|
|
27609
27629
|
return DefaultDialect;
|
|
27610
27630
|
}
|
|
27611
27631
|
getMembers() {
|
|
27612
|
-
return new PackageEntityMembers([], []);
|
|
27632
|
+
return new PackageEntityMembers([], [], []);
|
|
27613
27633
|
}
|
|
27614
27634
|
getInterfacePackageInfo() {
|
|
27615
27635
|
const implementation = new JavaScriptImplementationConfig.Globals("@artel/package-for-symbols-with-unknown-origin");
|
|
@@ -27951,63 +27971,15 @@ var JsLibraryRepresentingArtelPackageInfo = class {
|
|
|
27951
27971
|
}
|
|
27952
27972
|
};
|
|
27953
27973
|
|
|
27954
|
-
// source/analysis/
|
|
27955
|
-
var
|
|
27956
|
-
constructor(
|
|
27957
|
-
this.
|
|
27958
|
-
this.
|
|
27974
|
+
// source/analysis/ResolvedTextTranslationPackage.ts
|
|
27975
|
+
var ResolvedTextTranslationPackage = class {
|
|
27976
|
+
constructor(sourcePackage, entity, targetPackage) {
|
|
27977
|
+
this.sourcePackage = sourcePackage;
|
|
27978
|
+
this.entity = entity;
|
|
27959
27979
|
this.targetPackage = targetPackage;
|
|
27960
|
-
this.entitiesByTextKey = new Cached();
|
|
27961
27980
|
}
|
|
27962
27981
|
isPrimary() {
|
|
27963
|
-
return this.
|
|
27964
|
-
}
|
|
27965
|
-
getTargetPackage() {
|
|
27966
|
-
return this.targetPackage;
|
|
27967
|
-
}
|
|
27968
|
-
getDefinition() {
|
|
27969
|
-
return this.package_;
|
|
27970
|
-
}
|
|
27971
|
-
getTargetPackageName() {
|
|
27972
|
-
return this.package_.configuration.targetPackageName;
|
|
27973
|
-
}
|
|
27974
|
-
getTranslationLocale() {
|
|
27975
|
-
return this.package_.configuration.translationLocale;
|
|
27976
|
-
}
|
|
27977
|
-
getEntitiesByTextKey(textKey) {
|
|
27978
|
-
return this.entitiesByTextKey.getOrInsertWith(() => this.createEntitiesByTextKey()).get(textKey);
|
|
27979
|
-
}
|
|
27980
|
-
createEntitiesByTextKey() {
|
|
27981
|
-
const result = /* @__PURE__ */ new Map();
|
|
27982
|
-
for (const declaration of this.textTranslationDeclarations()) {
|
|
27983
|
-
const entity = this.analyzer.entity.ofTextTranslationDeclaration(declaration.sourceText);
|
|
27984
|
-
const key = entity.getKey();
|
|
27985
|
-
let entities = result.get(key);
|
|
27986
|
-
if (entities === void 0) {
|
|
27987
|
-
entities = [];
|
|
27988
|
-
result.set(key, entities);
|
|
27989
|
-
}
|
|
27990
|
-
entities.push(entity);
|
|
27991
|
-
}
|
|
27992
|
-
return result;
|
|
27993
|
-
}
|
|
27994
|
-
*textTranslationDeclarations() {
|
|
27995
|
-
for (const translations of this.translationsDeclarations()) {
|
|
27996
|
-
for (const declaration of translations.translationList.elements) {
|
|
27997
|
-
if (declaration.kind === 140 /* TextTranslationDeclaration */ || declaration.kind === 141 /* TextTranslationFunctionDeclaration */) {
|
|
27998
|
-
yield declaration;
|
|
27999
|
-
}
|
|
28000
|
-
}
|
|
28001
|
-
}
|
|
28002
|
-
}
|
|
28003
|
-
*translationsDeclarations() {
|
|
28004
|
-
for (const sourceFile of this.package_.sourceFiles) {
|
|
28005
|
-
for (const declaration of flattenPackageMemberDeclarationList(sourceFile.getSyntaxNode().declarationList)) {
|
|
28006
|
-
if (declaration.kind === 123 /* TranslationsDeclaration */) {
|
|
28007
|
-
yield declaration;
|
|
28008
|
-
}
|
|
28009
|
-
}
|
|
28010
|
-
}
|
|
27982
|
+
return this.sourcePackage.isPrimary;
|
|
28011
27983
|
}
|
|
28012
27984
|
};
|
|
28013
27985
|
|
|
@@ -30070,7 +30042,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
30070
30042
|
this.checkOriginalMembersHaveSameName(translatedMemberGroup, diagnostics);
|
|
30071
30043
|
}
|
|
30072
30044
|
}
|
|
30073
|
-
for (const member of this.package_.getMembers().
|
|
30045
|
+
for (const member of this.package_.getMembers().getNamedMembersAndTypeExtensions()) {
|
|
30074
30046
|
if (member.getTranslation()?.definition.kind === "source") {
|
|
30075
30047
|
switch (member.kind) {
|
|
30076
30048
|
case 1 /* Function */:
|
|
@@ -30155,7 +30127,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
30155
30127
|
if (nodeForDiagnostic !== void 0) {
|
|
30156
30128
|
const argumentFactory = this.analyzer.semanticContext.ofSourceFile(nodeForDiagnostic.sourceFile).getDiagnosticArgumentFactory();
|
|
30157
30129
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
30158
|
-
|
|
30130
|
+
392 /* Declarations0And1HaveTheSameSourceNamesButDifferentTranslatedNames23 */,
|
|
30159
30131
|
nodeForDiagnostic,
|
|
30160
30132
|
[
|
|
30161
30133
|
argumentFactory.createDisplayableEntity(firstSourceTranslatedMember.getOriginalEntity()),
|
|
@@ -30185,7 +30157,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
30185
30157
|
Debug.assertNotNull(correspondingTranslatedMember);
|
|
30186
30158
|
const argumentFactory = this.analyzer.semanticContext.ofSourceFile(nodeForDiagnostic.sourceFile).getDiagnosticArgumentFactory();
|
|
30187
30159
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
30188
|
-
|
|
30160
|
+
393 /* TranslatedDeclarations0And1HaveTheSameTranslatedNamesButDifferentSourceNames23 */,
|
|
30189
30161
|
nodeForDiagnostic,
|
|
30190
30162
|
[
|
|
30191
30163
|
argumentFactory.createDisplayableEntity(firstSourceTranslatedMember),
|
|
@@ -30269,7 +30241,7 @@ var TranslatedEntityNameConflictsValidator = class {
|
|
|
30269
30241
|
if (nodeForDiagnostic !== void 0) {
|
|
30270
30242
|
const argumentFactory = this.analyzer.semanticContext.ofSourceFile(nodeForDiagnostic.sourceFile).getDiagnosticArgumentFactory();
|
|
30271
30243
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
30272
|
-
|
|
30244
|
+
394 /* TranslatedOverridingMember0MustTheSameNameAsBaseMember1 */,
|
|
30273
30245
|
nodeForDiagnostic,
|
|
30274
30246
|
[
|
|
30275
30247
|
argumentFactory.createDisplayableEntity(derivedMemberEntity),
|
|
@@ -30458,6 +30430,8 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
30458
30430
|
return true;
|
|
30459
30431
|
case 11 /* TypeExtension */:
|
|
30460
30432
|
return false;
|
|
30433
|
+
case 13 /* TextTranslation */:
|
|
30434
|
+
return false;
|
|
30461
30435
|
default:
|
|
30462
30436
|
Debug.never(entity);
|
|
30463
30437
|
}
|
|
@@ -30612,7 +30586,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
30612
30586
|
}
|
|
30613
30587
|
}
|
|
30614
30588
|
const translatedTypeExtensions = originalMembers.getTypeExtensions().map((e) => new TranslatedTypeExtensionEntity(e, new Translation(this, new IntrinsicTranslationDefinition()), this));
|
|
30615
|
-
return new PackageEntityMembers(translatedNamedMembers, translatedTypeExtensions);
|
|
30589
|
+
return new PackageEntityMembers(translatedNamedMembers, translatedTypeExtensions, []);
|
|
30616
30590
|
}
|
|
30617
30591
|
createTranslatedTypeOrExtensionMembers(translatedTypeEntity) {
|
|
30618
30592
|
Debug.assert(translatedTypeEntity.getContainingPackage() === this.translatedTargetPackage);
|
|
@@ -30848,7 +30822,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
30848
30822
|
}
|
|
30849
30823
|
if (nodeForDiagnostic !== void 0) {
|
|
30850
30824
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
30851
|
-
|
|
30825
|
+
386 /* DeclarationHasAlreadyBeenTranslated */,
|
|
30852
30826
|
nodeForDiagnostic
|
|
30853
30827
|
));
|
|
30854
30828
|
}
|
|
@@ -30870,7 +30844,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
30870
30844
|
Debug.never(translationDeclaration);
|
|
30871
30845
|
}
|
|
30872
30846
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
30873
|
-
|
|
30847
|
+
386 /* DeclarationHasAlreadyBeenTranslated */,
|
|
30874
30848
|
nodeForDiagnostic
|
|
30875
30849
|
));
|
|
30876
30850
|
}
|
|
@@ -31047,7 +31021,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
31047
31021
|
));
|
|
31048
31022
|
} else if (targets.every((t) => t.kind === 2 /* Type */ && t.typeEntityKind === 0 /* Function */)) {
|
|
31049
31023
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
31050
|
-
|
|
31024
|
+
390 /* TranslationOfFunctionTypeMustIncludeParameterList */,
|
|
31051
31025
|
node.sourceName
|
|
31052
31026
|
));
|
|
31053
31027
|
areSuitable = false;
|
|
@@ -31170,7 +31144,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
31170
31144
|
);
|
|
31171
31145
|
if (node.translatedName.operatorKind !== operatorKind) {
|
|
31172
31146
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
31173
|
-
|
|
31147
|
+
389 /* TheNameOfTheTranslatedOperatorMustMeTheSameAsSourceOperatorName */,
|
|
31174
31148
|
node.translatedName
|
|
31175
31149
|
));
|
|
31176
31150
|
}
|
|
@@ -31253,7 +31227,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
31253
31227
|
checkTranslatedTypeParameterCount(typeParameterList, sourceTypeParameters, nodeForDiagnostic, diagnostics) {
|
|
31254
31228
|
if ((typeParameterList?.typeParameters.count() ?? 0) !== sourceTypeParameters.length) {
|
|
31255
31229
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
31256
|
-
|
|
31230
|
+
388 /* TheNumberOfTranslatedTypeParametersMustBeEqualToTheNumberOfSourceTypeParameters */,
|
|
31257
31231
|
nodeForDiagnostic
|
|
31258
31232
|
));
|
|
31259
31233
|
}
|
|
@@ -31261,7 +31235,7 @@ var AnalyzedTranslationPackage = class _AnalyzedTranslationPackage {
|
|
|
31261
31235
|
checkTranslatedParameterCount(parameterList, sourceParameters, nodeForDiagnostic, diagnostics) {
|
|
31262
31236
|
if (parameterList?.parameters.count() !== sourceParameters.length) {
|
|
31263
31237
|
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
31264
|
-
|
|
31238
|
+
387 /* TheNumberOfTranslatedParametersMustBeEqualToTheNumberOfSourceParameters */,
|
|
31265
31239
|
nodeForDiagnostic
|
|
31266
31240
|
));
|
|
31267
31241
|
}
|
|
@@ -31490,7 +31464,7 @@ var ReferencedPackagesCollector = class {
|
|
|
31490
31464
|
}
|
|
31491
31465
|
visitPackageEntity(entity) {
|
|
31492
31466
|
const members = entity.getMembers();
|
|
31493
|
-
for (const member of members.
|
|
31467
|
+
for (const member of members.getNamedMembersAndTypeExtensions()) {
|
|
31494
31468
|
switch (member.kind) {
|
|
31495
31469
|
case 0 /* Variable */:
|
|
31496
31470
|
this.visitType(member.getType());
|
|
@@ -34670,93 +34644,108 @@ var DeclarationsUsageCounter = class {
|
|
|
34670
34644
|
this.sourceFile,
|
|
34671
34645
|
false,
|
|
34672
34646
|
taskController,
|
|
34673
|
-
(node) => {
|
|
34674
|
-
|
|
34675
|
-
|
|
34676
|
-
|
|
34677
|
-
|
|
34678
|
-
|
|
34679
|
-
|
|
34680
|
-
|
|
34681
|
-
|
|
34682
|
-
|
|
34683
|
-
|
|
34684
|
-
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34695
|
-
|
|
34696
|
-
|
|
34697
|
-
|
|
34698
|
-
|
|
34699
|
-
|
|
34700
|
-
|
|
34701
|
-
|
|
34702
|
-
|
|
34703
|
-
|
|
34704
|
-
|
|
34705
|
-
|
|
34706
|
-
|
|
34707
|
-
|
|
34647
|
+
(node, _controller) => {
|
|
34648
|
+
switch (node.kind) {
|
|
34649
|
+
case 89 /* IdentifierExpression */: {
|
|
34650
|
+
const meaning = this.analyzer.resolveIdentifierExpression(node).meaning;
|
|
34651
|
+
let entity;
|
|
34652
|
+
let accessKind;
|
|
34653
|
+
switch (meaning.kind) {
|
|
34654
|
+
case "variable-access":
|
|
34655
|
+
entity = meaning.variable.getEntity();
|
|
34656
|
+
accessKind = meaning.accessKind;
|
|
34657
|
+
break;
|
|
34658
|
+
case "function-access":
|
|
34659
|
+
entity = meaning.singleFunction?.getEntity();
|
|
34660
|
+
break;
|
|
34661
|
+
case "operator-access":
|
|
34662
|
+
entity = meaning.singleOperator?.getEntity();
|
|
34663
|
+
break;
|
|
34664
|
+
case "package-name-segment-access":
|
|
34665
|
+
break;
|
|
34666
|
+
case "package-alias-access":
|
|
34667
|
+
entity = meaning.packageAlias;
|
|
34668
|
+
break;
|
|
34669
|
+
case "type-access":
|
|
34670
|
+
entity = meaning.singleSuitableType?.getEntity();
|
|
34671
|
+
break;
|
|
34672
|
+
case "constructor-access":
|
|
34673
|
+
entity = meaning.callExpressionMeaning.typeEntity;
|
|
34674
|
+
break;
|
|
34675
|
+
case "mixed-ambiguous-access":
|
|
34676
|
+
case "unresolved":
|
|
34677
|
+
break;
|
|
34678
|
+
default:
|
|
34679
|
+
Debug.never(meaning);
|
|
34680
|
+
}
|
|
34681
|
+
if (entity !== void 0) {
|
|
34682
|
+
this.recordUsage(entity, accessKind);
|
|
34683
|
+
}
|
|
34684
|
+
break;
|
|
34708
34685
|
}
|
|
34709
|
-
|
|
34710
|
-
|
|
34711
|
-
|
|
34712
|
-
|
|
34713
|
-
|
|
34714
|
-
|
|
34715
|
-
|
|
34716
|
-
|
|
34717
|
-
|
|
34718
|
-
|
|
34719
|
-
|
|
34720
|
-
|
|
34721
|
-
|
|
34722
|
-
|
|
34723
|
-
|
|
34724
|
-
|
|
34725
|
-
|
|
34726
|
-
|
|
34727
|
-
|
|
34728
|
-
|
|
34729
|
-
|
|
34730
|
-
|
|
34731
|
-
|
|
34732
|
-
|
|
34733
|
-
|
|
34734
|
-
|
|
34735
|
-
|
|
34736
|
-
|
|
34737
|
-
|
|
34738
|
-
|
|
34739
|
-
|
|
34740
|
-
|
|
34741
|
-
|
|
34742
|
-
|
|
34743
|
-
|
|
34744
|
-
|
|
34745
|
-
|
|
34746
|
-
|
|
34747
|
-
|
|
34748
|
-
|
|
34749
|
-
|
|
34750
|
-
|
|
34686
|
+
case 76 /* MemberAccessExpression */: {
|
|
34687
|
+
const meaning = this.analyzer.resolveMemberAccessExpression(node).meaning;
|
|
34688
|
+
let entity;
|
|
34689
|
+
let accessKind;
|
|
34690
|
+
switch (meaning.kind) {
|
|
34691
|
+
case "package-variable-access":
|
|
34692
|
+
entity = meaning.variable;
|
|
34693
|
+
accessKind = meaning.accessKind;
|
|
34694
|
+
break;
|
|
34695
|
+
case "package-function-access":
|
|
34696
|
+
entity = meaning.singleFunction?.getEntity();
|
|
34697
|
+
break;
|
|
34698
|
+
case "package-type-access":
|
|
34699
|
+
entity = meaning.singleSuitableType?.getEntity();
|
|
34700
|
+
break;
|
|
34701
|
+
case "constructor-access":
|
|
34702
|
+
entity = meaning.callExpressionMeaning.typeEntity;
|
|
34703
|
+
break;
|
|
34704
|
+
case "package-name-segment-access":
|
|
34705
|
+
break;
|
|
34706
|
+
case "static-field-access":
|
|
34707
|
+
entity = meaning.field.getEntity();
|
|
34708
|
+
accessKind = meaning.accessKind;
|
|
34709
|
+
break;
|
|
34710
|
+
case "static-method-access":
|
|
34711
|
+
entity = meaning.singleFunction?.getEntity();
|
|
34712
|
+
break;
|
|
34713
|
+
case "instance-field-access":
|
|
34714
|
+
entity = meaning.field.getEntity();
|
|
34715
|
+
accessKind = meaning.accessKind;
|
|
34716
|
+
break;
|
|
34717
|
+
case "instance-method-access":
|
|
34718
|
+
entity = meaning.singleFunction?.getEntity();
|
|
34719
|
+
break;
|
|
34720
|
+
case "operator-access":
|
|
34721
|
+
entity = meaning.singleOperator?.getEntity();
|
|
34722
|
+
break;
|
|
34723
|
+
case "unresolved":
|
|
34724
|
+
case "mixed-ambiguous-access":
|
|
34725
|
+
break;
|
|
34726
|
+
default:
|
|
34727
|
+
Debug.never(meaning);
|
|
34728
|
+
}
|
|
34729
|
+
if (entity !== void 0) {
|
|
34730
|
+
this.recordUsage(entity, accessKind);
|
|
34731
|
+
}
|
|
34732
|
+
break;
|
|
34751
34733
|
}
|
|
34752
|
-
|
|
34753
|
-
this.
|
|
34734
|
+
case 10 /* NamedTypeSpecifier */: {
|
|
34735
|
+
const resolved = this.analyzer.resolveNamedTypeSpecifier(node);
|
|
34736
|
+
const entity = resolved.type?.getEntity();
|
|
34737
|
+
if (entity !== void 0) {
|
|
34738
|
+
this.recordUsage(entity, void 0);
|
|
34739
|
+
}
|
|
34740
|
+
break;
|
|
34754
34741
|
}
|
|
34755
|
-
|
|
34756
|
-
|
|
34757
|
-
|
|
34758
|
-
|
|
34759
|
-
|
|
34742
|
+
case 85 /* LocalizableTextLiteral */:
|
|
34743
|
+
case 80 /* LocalizableTextTemplateLiteral */: {
|
|
34744
|
+
const resolved = this.analyzer.resolveLocalizableTextOrTextTemplate(node);
|
|
34745
|
+
if (resolved.kind === "ok") {
|
|
34746
|
+
this.recordUsage(resolved.value, void 0);
|
|
34747
|
+
}
|
|
34748
|
+
break;
|
|
34760
34749
|
}
|
|
34761
34750
|
}
|
|
34762
34751
|
return void 0;
|
|
@@ -37982,14 +37971,19 @@ var PackageAndStaticVariablesInitializationValidator = class {
|
|
|
37982
37971
|
}
|
|
37983
37972
|
};
|
|
37984
37973
|
|
|
37985
|
-
// source/analysis/
|
|
37986
|
-
var
|
|
37974
|
+
// source/analysis/PackageMemberConflictsValidator.ts
|
|
37975
|
+
var PackageMemberConflictsValidator = class {
|
|
37987
37976
|
constructor(analyzer, members) {
|
|
37988
37977
|
this.analyzer = analyzer;
|
|
37989
37978
|
this.members = members;
|
|
37990
37979
|
this.diagnostics = new Array();
|
|
37991
37980
|
}
|
|
37992
37981
|
validate() {
|
|
37982
|
+
this.validateNameConflicts();
|
|
37983
|
+
this.validateTextConflicts();
|
|
37984
|
+
return this.diagnostics;
|
|
37985
|
+
}
|
|
37986
|
+
validateNameConflicts() {
|
|
37993
37987
|
const membersByNameKey = Query.groupByToMap(this.members.getNamedMembers(), (m) => m.getName().key);
|
|
37994
37988
|
for (const members of membersByNameKey.values()) {
|
|
37995
37989
|
if (members.length <= 1) {
|
|
@@ -38006,7 +38000,17 @@ var PackageMemberNameConflictsValidator = class {
|
|
|
38006
38000
|
);
|
|
38007
38001
|
}
|
|
38008
38002
|
}
|
|
38009
|
-
|
|
38003
|
+
}
|
|
38004
|
+
validateTextConflicts() {
|
|
38005
|
+
const textTranslationsByTextKey = Query.groupByToMap(this.members.getTextTranslations(), (m) => m.getKey());
|
|
38006
|
+
for (const textTranslations of textTranslationsByTextKey.values()) {
|
|
38007
|
+
if (textTranslations.length > 1) {
|
|
38008
|
+
this.createAndAddTextConflictDiagnosticsForAllEntities(
|
|
38009
|
+
textTranslations,
|
|
38010
|
+
308 /* PackageAlreadyContainsDeclarationWithTheSameName */
|
|
38011
|
+
);
|
|
38012
|
+
}
|
|
38013
|
+
}
|
|
38010
38014
|
}
|
|
38011
38015
|
validateFunctionNameConflicts(entities) {
|
|
38012
38016
|
for (const entity of entities) {
|
|
@@ -38047,6 +38051,11 @@ var PackageMemberNameConflictsValidator = class {
|
|
|
38047
38051
|
}
|
|
38048
38052
|
}
|
|
38049
38053
|
}
|
|
38054
|
+
createAndAddTextConflictDiagnosticsForAllEntities(entities, diagnosticCode) {
|
|
38055
|
+
for (const entity of entities) {
|
|
38056
|
+
this.reportTextConflictDiagnostic(entity, diagnosticCode);
|
|
38057
|
+
}
|
|
38058
|
+
}
|
|
38050
38059
|
shouldReportConflictWithMemberBasedOnHiding(entity1, entity2) {
|
|
38051
38060
|
const entity1Hiding = entity1.isHidden();
|
|
38052
38061
|
const entity2Hiding = entity2.isHidden();
|
|
@@ -38065,6 +38074,13 @@ var PackageMemberNameConflictsValidator = class {
|
|
|
38065
38074
|
this.diagnostics.push(new Diagnostic(diagnosticData, diagnosticLocation));
|
|
38066
38075
|
}
|
|
38067
38076
|
}
|
|
38077
|
+
reportTextConflictDiagnostic(entity, code) {
|
|
38078
|
+
const diagnosticLocation = this.getDiagnosticLocation(entity);
|
|
38079
|
+
if (diagnosticLocation !== void 0) {
|
|
38080
|
+
const diagnosticData = DiagnosticData.withCode(code);
|
|
38081
|
+
this.diagnostics.push(new Diagnostic(diagnosticData, diagnosticLocation));
|
|
38082
|
+
}
|
|
38083
|
+
}
|
|
38068
38084
|
getDiagnosticLocation(entity) {
|
|
38069
38085
|
return this.analyzer.getEntityDiagnosticLocation(entity);
|
|
38070
38086
|
}
|
|
@@ -38076,7 +38092,7 @@ var SourcePackageMemberConflictsValidator = class {
|
|
|
38076
38092
|
}
|
|
38077
38093
|
validate() {
|
|
38078
38094
|
const entity = this.analyzer.entity.ofPackage(this.package_);
|
|
38079
|
-
return new
|
|
38095
|
+
return new PackageMemberConflictsValidator(
|
|
38080
38096
|
this.analyzer,
|
|
38081
38097
|
entity.getMembers()
|
|
38082
38098
|
).validate();
|
|
@@ -38085,11 +38101,13 @@ var SourcePackageMemberConflictsValidator = class {
|
|
|
38085
38101
|
|
|
38086
38102
|
// source/analysis/SourceFileMembers.ts
|
|
38087
38103
|
var SourceFileMembers = class _SourceFileMembers {
|
|
38088
|
-
constructor(analyzer, namedMembers, typeExtensions) {
|
|
38104
|
+
constructor(analyzer, namedMembers, typeExtensions, textTranslations) {
|
|
38089
38105
|
this.declarationsByName_ = new Cached();
|
|
38106
|
+
this.textTranslationsByTextKey_ = new Cached();
|
|
38090
38107
|
this.analyzer = analyzer;
|
|
38091
38108
|
this.namedMembers = namedMembers;
|
|
38092
38109
|
this.typeExtensions = typeExtensions;
|
|
38110
|
+
this.textTranslations = textTranslations;
|
|
38093
38111
|
}
|
|
38094
38112
|
static {
|
|
38095
38113
|
this.emptyNamedMembers = [];
|
|
@@ -38097,9 +38115,17 @@ var SourceFileMembers = class _SourceFileMembers {
|
|
|
38097
38115
|
static {
|
|
38098
38116
|
this.emptyPackageAliases = [];
|
|
38099
38117
|
}
|
|
38118
|
+
static {
|
|
38119
|
+
this.emptyTextTranslations = [];
|
|
38120
|
+
}
|
|
38100
38121
|
get declarationsByName() {
|
|
38101
38122
|
return this.declarationsByName_.getOrInsertWith(() => Query.groupByToMap(this.namedMembers, (d) => d.getName().key));
|
|
38102
38123
|
}
|
|
38124
|
+
get textTranslationsByTextKey() {
|
|
38125
|
+
return this.textTranslationsByTextKey_.getOrInsertWith(
|
|
38126
|
+
() => Query.groupByToMap(this.textTranslations, (d) => d.getKey())
|
|
38127
|
+
);
|
|
38128
|
+
}
|
|
38103
38129
|
getNamedDeclarations() {
|
|
38104
38130
|
return this.namedMembers;
|
|
38105
38131
|
}
|
|
@@ -38115,6 +38141,12 @@ var SourceFileMembers = class _SourceFileMembers {
|
|
|
38115
38141
|
getTypeExtensions() {
|
|
38116
38142
|
return this.typeExtensions;
|
|
38117
38143
|
}
|
|
38144
|
+
getTextTranslations() {
|
|
38145
|
+
return this.textTranslations;
|
|
38146
|
+
}
|
|
38147
|
+
getTextTranslationsByTextKey(key) {
|
|
38148
|
+
return this.textTranslationsByTextKey.get(key) ?? _SourceFileMembers.emptyTextTranslations;
|
|
38149
|
+
}
|
|
38118
38150
|
validateNameConflicts(diagnostics) {
|
|
38119
38151
|
const packageAliasesByNameKey = Query.from(this.namedMembers).filter((d) => d.kind === 10 /* PackageAlias */).groupByToMap((a) => a.getName().key);
|
|
38120
38152
|
for (const [name, aliases] of packageAliasesByNameKey) {
|
|
@@ -39645,8 +39677,8 @@ var SemanticContextBase = class _SemanticContextBase {
|
|
|
39645
39677
|
const result = sourceFileContext.getOwnTypeExtensionsByType(type, hidingMatcher);
|
|
39646
39678
|
return result ?? _SemanticContextBase.emptyTypeExtensions;
|
|
39647
39679
|
}
|
|
39648
|
-
|
|
39649
|
-
return this.getSourceFileContext().
|
|
39680
|
+
getTextTranslationEntityByTextKey(key) {
|
|
39681
|
+
return this.getSourceFileContext().getTextTranslationEntityByTextKey(key);
|
|
39650
39682
|
}
|
|
39651
39683
|
*semanticContexts() {
|
|
39652
39684
|
let context = this.asContext;
|
|
@@ -41031,8 +41063,8 @@ var SourceFileSemanticContext = class extends SemanticContextBase {
|
|
|
41031
41063
|
getOwnTypeExtensionsByType(type, hidingMatcher) {
|
|
41032
41064
|
return this.containingPackageMemberLookup.getTypeExtensions(type, hidingMatcher).concat(this.importedPackageMemberLookups.flatMap((m) => m.getTypeExtensions(type, hidingMatcher)));
|
|
41033
41065
|
}
|
|
41034
|
-
|
|
41035
|
-
return this.primaryTextTranslationPackage?.
|
|
41066
|
+
getTextTranslationEntityByTextKey(key) {
|
|
41067
|
+
return this.primaryTextTranslationPackage?.entity.getMembers().getTextTranslationsByTextKey(key) ?? [];
|
|
41036
41068
|
}
|
|
41037
41069
|
convertPackageMemberToNamedDeclaration(declaration) {
|
|
41038
41070
|
switch (declaration.kind) {
|
|
@@ -41836,13 +41868,11 @@ var Analyzer12 = class {
|
|
|
41836
41868
|
this.prefixUnaryExpressionOperatorResolutionResults = /* @__PURE__ */ new Map();
|
|
41837
41869
|
this.binaryExpressionUserDefinableOperatorResolutionResults = /* @__PURE__ */ new Map();
|
|
41838
41870
|
this.assignmentStatementOperatorResolutionResults = /* @__PURE__ */ new Map();
|
|
41839
|
-
this.extendedTypes = /* @__PURE__ */ new Map();
|
|
41840
41871
|
this.analyzedTranslationPackages = /* @__PURE__ */ new Map();
|
|
41841
|
-
this.
|
|
41872
|
+
this.resolvedTextTranslationPackages = /* @__PURE__ */ new Map();
|
|
41842
41873
|
this.textTranslationPackagesByTargetPackage = new Cached();
|
|
41843
41874
|
this.primaryTextTranslationPackageByTargetPackage = /* @__PURE__ */ new Map();
|
|
41844
|
-
this.
|
|
41845
|
-
this.primaryTextTranslationEntityByLocalizableTextTemplate = /* @__PURE__ */ new Map();
|
|
41875
|
+
this.resolvedLocalizableTexts = /* @__PURE__ */ new Map();
|
|
41846
41876
|
this.linkedMultiPlatformPackagesByPlatform = /* @__PURE__ */ new Map();
|
|
41847
41877
|
this.isFunctionGeneratorCheckResults = /* @__PURE__ */ new Map();
|
|
41848
41878
|
this.namedDeclarationsUsageCountResults = /* @__PURE__ */ new Map();
|
|
@@ -43026,35 +43056,6 @@ var Analyzer12 = class {
|
|
|
43026
43056
|
getDefaultTypeParameterConstraint(locale) {
|
|
43027
43057
|
return this.includeNullToType(this.getLocalizedStandardTypes(locale).refObject, locale);
|
|
43028
43058
|
}
|
|
43029
|
-
getExtendedType(node) {
|
|
43030
|
-
let result = this.extendedTypes.get(node);
|
|
43031
|
-
if (result === void 0) {
|
|
43032
|
-
const typeResolver = new NamedTypeResolver(this, node.extendedTypeClause.qualifiedName);
|
|
43033
|
-
const resolutionResult = typeResolver.resolve();
|
|
43034
|
-
if (resolutionResult.diagnostics.length > 0) {
|
|
43035
|
-
result = new WithDiagnostics_error(resolutionResult.diagnostics);
|
|
43036
|
-
} else {
|
|
43037
|
-
let arity;
|
|
43038
|
-
if (node.extendedTypeClause.commaList !== void 0) {
|
|
43039
|
-
arity = node.extendedTypeClause.commaList.commas.length + 1;
|
|
43040
|
-
} else {
|
|
43041
|
-
arity = 0;
|
|
43042
|
-
}
|
|
43043
|
-
const type = resolutionResult.types.find((t) => t.getArity() === arity);
|
|
43044
|
-
if (type === void 0) {
|
|
43045
|
-
result = new WithDiagnostics_error([this.createNodeDiagnostic(
|
|
43046
|
-
228 /* TypeWithArity0NotFound */,
|
|
43047
|
-
node.extendedTypeClause,
|
|
43048
|
-
[arity.toString()]
|
|
43049
|
-
)]);
|
|
43050
|
-
} else {
|
|
43051
|
-
result = new WithDiagnostics_ok(type);
|
|
43052
|
-
}
|
|
43053
|
-
}
|
|
43054
|
-
this.extendedTypes.set(node, result);
|
|
43055
|
-
}
|
|
43056
|
-
return result;
|
|
43057
|
-
}
|
|
43058
43059
|
getAnalyzedTranslationPackageIfTargetResolved(package_) {
|
|
43059
43060
|
let resultOpt = this.analyzedTranslationPackages.get(package_);
|
|
43060
43061
|
if (resultOpt === void 0) {
|
|
@@ -43068,16 +43069,17 @@ var Analyzer12 = class {
|
|
|
43068
43069
|
}
|
|
43069
43070
|
return resultOpt.toNullable();
|
|
43070
43071
|
}
|
|
43071
|
-
|
|
43072
|
-
let resultOpt = this.
|
|
43072
|
+
resolveTextTranslationPackage(package_) {
|
|
43073
|
+
let resultOpt = this.resolvedTextTranslationPackages.get(package_);
|
|
43073
43074
|
if (resultOpt === void 0) {
|
|
43074
43075
|
let result;
|
|
43076
|
+
const entity = this.entity.ofPackage(package_);
|
|
43075
43077
|
const targetPackage = this.getOriginalPackageEntityByName(package_.configuration.targetPackageName);
|
|
43076
43078
|
if (targetPackage !== void 0) {
|
|
43077
|
-
result = new
|
|
43079
|
+
result = new ResolvedTextTranslationPackage(package_, entity, targetPackage);
|
|
43078
43080
|
}
|
|
43079
43081
|
resultOpt = Option.fromNullable(result);
|
|
43080
|
-
this.
|
|
43082
|
+
this.resolvedTextTranslationPackages.set(package_, resultOpt);
|
|
43081
43083
|
}
|
|
43082
43084
|
return resultOpt.toNullable();
|
|
43083
43085
|
}
|
|
@@ -43098,8 +43100,8 @@ var Analyzer12 = class {
|
|
|
43098
43100
|
(p) => p.kind === "translation" ? this.getAnalyzedTranslationPackageIfTargetResolved(p) : void 0
|
|
43099
43101
|
);
|
|
43100
43102
|
}
|
|
43101
|
-
|
|
43102
|
-
return Query.from(this.compilation.allPackages).mapAndFilter((p) => p.kind === "text-translation" ? this.
|
|
43103
|
+
enumerateResolvedTextTranslationPackages() {
|
|
43104
|
+
return Query.from(this.compilation.allPackages).mapAndFilter((p) => p.kind === "text-translation" ? this.resolveTextTranslationPackage(p) : void 0);
|
|
43103
43105
|
}
|
|
43104
43106
|
getLinkedMultiPlatformPackagesByPlatform(entity) {
|
|
43105
43107
|
entity = entity.getOriginalEntity();
|
|
@@ -43128,7 +43130,7 @@ var Analyzer12 = class {
|
|
|
43128
43130
|
}
|
|
43129
43131
|
getTextTranslationPackagesMap() {
|
|
43130
43132
|
return this.textTranslationPackagesByTargetPackage.getOrInsertWith(() => {
|
|
43131
|
-
return this.
|
|
43133
|
+
return this.enumerateResolvedTextTranslationPackages().groupByToMap((p) => p.targetPackage);
|
|
43132
43134
|
});
|
|
43133
43135
|
}
|
|
43134
43136
|
getTextTranslationPackagesOfTargetPackage(targetPackage) {
|
|
@@ -43143,27 +43145,33 @@ var Analyzer12 = class {
|
|
|
43143
43145
|
}
|
|
43144
43146
|
return resultOpt.toNullable();
|
|
43145
43147
|
}
|
|
43146
|
-
|
|
43147
|
-
let
|
|
43148
|
-
if (
|
|
43149
|
-
const sourceFileSemanticContext = this.semanticContext.ofSourceFile(node.sourceFile);
|
|
43150
|
-
const textKey = TextIdentity.keyFromLocalizableTextLiteral(node);
|
|
43151
|
-
const result = sourceFileSemanticContext.getPrimaryTextTranslationEntityByTextKey(textKey);
|
|
43152
|
-
resultOpt = Option.fromNullable(result);
|
|
43153
|
-
this.primaryTextTranslationEntityByLocalizableText.set(node, resultOpt);
|
|
43154
|
-
}
|
|
43155
|
-
return resultOpt.toNullable();
|
|
43156
|
-
}
|
|
43157
|
-
getPrimaryTextTranslationEntityByLocalizableTextTemplate(node) {
|
|
43158
|
-
let resultOpt = this.primaryTextTranslationEntityByLocalizableTextTemplate.get(node);
|
|
43159
|
-
if (resultOpt === void 0) {
|
|
43148
|
+
resolveLocalizableTextOrTextTemplate(node) {
|
|
43149
|
+
let result = this.resolvedLocalizableTexts.get(node);
|
|
43150
|
+
if (result === void 0) {
|
|
43160
43151
|
const sourceFileSemanticContext = this.semanticContext.ofSourceFile(node.sourceFile);
|
|
43161
|
-
|
|
43162
|
-
|
|
43163
|
-
|
|
43164
|
-
|
|
43152
|
+
let textKey;
|
|
43153
|
+
if (node.kind === 85 /* LocalizableTextLiteral */) {
|
|
43154
|
+
textKey = TextIdentity.keyFromLocalizableTextLiteral(node);
|
|
43155
|
+
} else if (node.kind === 80 /* LocalizableTextTemplateLiteral */) {
|
|
43156
|
+
textKey = TextIdentity.keyFromLocalizableTextTemplateLiteral(node);
|
|
43157
|
+
} else {
|
|
43158
|
+
Debug.never(node);
|
|
43159
|
+
}
|
|
43160
|
+
const entities = sourceFileSemanticContext.getTextTranslationEntityByTextKey(textKey);
|
|
43161
|
+
if (entities.length === 1) {
|
|
43162
|
+
result = new WithDiagnostics_ok(entities[0]);
|
|
43163
|
+
} else {
|
|
43164
|
+
const diagnostic = this.createNodeDiagnostic(
|
|
43165
|
+
385 /* TextIsMissingAmongPrimaryTextTranslationDefinitions */,
|
|
43166
|
+
node,
|
|
43167
|
+
void 0,
|
|
43168
|
+
1 /* Warning */
|
|
43169
|
+
);
|
|
43170
|
+
result = new WithDiagnostics_error(diagnostic);
|
|
43171
|
+
}
|
|
43172
|
+
this.resolvedLocalizableTexts.set(node, result);
|
|
43165
43173
|
}
|
|
43166
|
-
return
|
|
43174
|
+
return result;
|
|
43167
43175
|
}
|
|
43168
43176
|
instantiateType(entity, typeArguments) {
|
|
43169
43177
|
switch (entity.typeEntityKind) {
|
|
@@ -45259,12 +45267,10 @@ var TargetType = class {
|
|
|
45259
45267
|
getTargetTypeOfChildOfTextTemplateSpan(parent, child) {
|
|
45260
45268
|
if (parent.parent.parent.kind === 80 /* LocalizableTextTemplateLiteral */) {
|
|
45261
45269
|
const spanList = parent.parent;
|
|
45262
|
-
const
|
|
45263
|
-
|
|
45264
|
-
);
|
|
45265
|
-
if (textTranslationEntity !== void 0) {
|
|
45270
|
+
const resolved = this.analyzer.resolveLocalizableTextOrTextTemplate(parent.parent.parent);
|
|
45271
|
+
if (resolved.kind === "ok") {
|
|
45266
45272
|
const parameterIndex = spanList.spans.findIndex((s) => s.expression === child);
|
|
45267
|
-
const parameterEntity2 =
|
|
45273
|
+
const parameterEntity2 = resolved.value.getParameters()[parameterIndex];
|
|
45268
45274
|
return parameterEntity2.getType();
|
|
45269
45275
|
}
|
|
45270
45276
|
}
|
|
@@ -45416,7 +45422,6 @@ var Entity4 = class {
|
|
|
45416
45422
|
this.setterEntities = /* @__PURE__ */ new Map();
|
|
45417
45423
|
this.typeExtensionEntities = /* @__PURE__ */ new Map();
|
|
45418
45424
|
this.packageAliasEntities = /* @__PURE__ */ new Map();
|
|
45419
|
-
this.translationTextTemplateParameterEntities = /* @__PURE__ */ new Map();
|
|
45420
45425
|
this.textTranslationDeclarationEntities = /* @__PURE__ */ new Map();
|
|
45421
45426
|
this.functionLiteralEntities = /* @__PURE__ */ new Map();
|
|
45422
45427
|
this.functionBlockLiteralEntities = /* @__PURE__ */ new Map();
|
|
@@ -46309,6 +46314,7 @@ var SourceFileMembersMap = class {
|
|
|
46309
46314
|
if (result === void 0) {
|
|
46310
46315
|
const namedMembers = new Array();
|
|
46311
46316
|
const typeExtensionEntities = new Array();
|
|
46317
|
+
const textTranslationEntities = new Array();
|
|
46312
46318
|
const packageImports = this.analyzer.getPackageImportsOfDirective(
|
|
46313
46319
|
node.packageImportDirectiveList.packageImportDirectives
|
|
46314
46320
|
);
|
|
@@ -46357,9 +46363,16 @@ var SourceFileMembersMap = class {
|
|
|
46357
46363
|
typeExtensionEntities.push(this.analyzer.entity.ofTypeExtensionDeclaration(d));
|
|
46358
46364
|
break;
|
|
46359
46365
|
}
|
|
46366
|
+
case 123 /* TranslationsDeclaration */: {
|
|
46367
|
+
for (const t of d.translationList.elements) {
|
|
46368
|
+
if (t.kind === 140 /* TextTranslationDeclaration */ || t.kind === 141 /* TextTranslationFunctionDeclaration */) {
|
|
46369
|
+
textTranslationEntities.push(this.analyzer.entity.ofTextTranslationDeclaration(t.sourceText));
|
|
46370
|
+
}
|
|
46371
|
+
}
|
|
46372
|
+
break;
|
|
46373
|
+
}
|
|
46360
46374
|
case 24 /* PackageEntryPointDeclaration */:
|
|
46361
46375
|
case 23 /* PackageConstructorDeclaration */:
|
|
46362
|
-
case 123 /* TranslationsDeclaration */:
|
|
46363
46376
|
case 41 /* MissingPackageMemberDeclaration */:
|
|
46364
46377
|
break;
|
|
46365
46378
|
default:
|
|
@@ -46372,7 +46385,7 @@ var SourceFileMembersMap = class {
|
|
|
46372
46385
|
const backingVariables = this.analyzer.createBackingPackageVariables(namedMembers, packageEntity2);
|
|
46373
46386
|
namedMembers.push(...backingVariables);
|
|
46374
46387
|
}
|
|
46375
|
-
result = new SourceFileMembers(this.analyzer, namedMembers, typeExtensionEntities);
|
|
46388
|
+
result = new SourceFileMembers(this.analyzer, namedMembers, typeExtensionEntities, textTranslationEntities);
|
|
46376
46389
|
this.sourceFileMembersMap.set(node, result);
|
|
46377
46390
|
}
|
|
46378
46391
|
return result;
|
|
@@ -47671,7 +47684,7 @@ var PackageImports = class {
|
|
|
47671
47684
|
let result = this.packagesAvailableForImport.get(pkg2);
|
|
47672
47685
|
if (result === void 0) {
|
|
47673
47686
|
result = this.analyzer.getPackageEntities();
|
|
47674
|
-
if (pkg2.kind === "program" && pkg2.configuration.packageImportLocales.length > 0) {
|
|
47687
|
+
if ((pkg2.kind === "program" || pkg2.kind === "text-translation") && pkg2.configuration.packageImportLocales.length > 0) {
|
|
47675
47688
|
result = result.filter((p) => pkg2.configuration.packageImportLocales.every((l) => !l.packageName.considerEqual(p.getName()) || l.locale === p.getLocale()));
|
|
47676
47689
|
}
|
|
47677
47690
|
this.packagesAvailableForImport.set(pkg2, result);
|
|
@@ -47717,7 +47730,7 @@ var PackageImports = class {
|
|
|
47717
47730
|
getAutomaticallyImportedPackages(pkg2) {
|
|
47718
47731
|
let result = this.automaticallyImportedPackages.get(pkg2);
|
|
47719
47732
|
if (result === void 0) {
|
|
47720
|
-
if (pkg2.kind === "program") {
|
|
47733
|
+
if (pkg2.kind === "program" || pkg2.kind === "text-translation") {
|
|
47721
47734
|
const availablePackages = this.getPackagesAvailableForImport(pkg2);
|
|
47722
47735
|
if (pkg2.configuration.automaticallyImportedPackages === void 0) {
|
|
47723
47736
|
const locale = pkg2.configuration.locale;
|
|
@@ -49866,7 +49879,7 @@ var SourceFileAnalyzer = class {
|
|
|
49866
49879
|
get textTranslationPackage() {
|
|
49867
49880
|
return this.textTranslationPackage_.getOrInsertWith(() => {
|
|
49868
49881
|
if (this.sourceFile.package.kind === "text-translation") {
|
|
49869
|
-
return this.analyzer.
|
|
49882
|
+
return this.analyzer.resolveTextTranslationPackage(this.sourceFile.package);
|
|
49870
49883
|
}
|
|
49871
49884
|
return void 0;
|
|
49872
49885
|
});
|
|
@@ -49891,7 +49904,7 @@ var SourceFileAnalyzer = class {
|
|
|
49891
49904
|
this.addDiagnosticsLocatedInAnalyzedFile(variableInitializationDiagnostics);
|
|
49892
49905
|
}
|
|
49893
49906
|
this.modifierValidator.validateTopLevelPackageMembers(sourceFileNode.declarationList);
|
|
49894
|
-
if (this.sourceFile.package.kind === "program") {
|
|
49907
|
+
if (this.sourceFile.package.kind === "program" || this.sourceFile.package.kind === "text-translation") {
|
|
49895
49908
|
this.addDiagnosticsLocatedInAnalyzedFile(
|
|
49896
49909
|
this.analyzer.validateSourcePackageMemberConflicts(this.sourceFile.package)
|
|
49897
49910
|
);
|
|
@@ -49978,33 +49991,23 @@ var SourceFileAnalyzer = class {
|
|
|
49978
49991
|
break;
|
|
49979
49992
|
}
|
|
49980
49993
|
case 85 /* LocalizableTextLiteral */: {
|
|
49981
|
-
const
|
|
49982
|
-
if (
|
|
49983
|
-
this.
|
|
49984
|
-
385 /* TextIsMissingInPrimaryTextTranslationPackage */,
|
|
49985
|
-
node,
|
|
49986
|
-
void 0,
|
|
49987
|
-
1 /* Warning */
|
|
49988
|
-
));
|
|
49994
|
+
const resolved = this.analyzer.resolveLocalizableTextOrTextTemplate(node);
|
|
49995
|
+
if (resolved.kind === "error") {
|
|
49996
|
+
this.addDiagnostics(resolved.value);
|
|
49989
49997
|
}
|
|
49990
49998
|
break;
|
|
49991
49999
|
}
|
|
49992
50000
|
case 80 /* LocalizableTextTemplateLiteral */: {
|
|
49993
|
-
const
|
|
49994
|
-
if (
|
|
50001
|
+
const resolved = this.analyzer.resolveLocalizableTextOrTextTemplate(node);
|
|
50002
|
+
if (resolved.kind === "error") {
|
|
50003
|
+
this.addDiagnostics(resolved.value);
|
|
50004
|
+
} else {
|
|
49995
50005
|
const spans = node.spanList.spans;
|
|
49996
50006
|
for (let i = 0; i < spans.length; i++) {
|
|
49997
50007
|
const argument2 = spans[i].expression;
|
|
49998
|
-
const parameter =
|
|
50008
|
+
const parameter = resolved.value.getParameters()[i];
|
|
49999
50009
|
this.checkExpressionTypeIsAssignableToTargetType(argument2, parameter.getType());
|
|
50000
50010
|
}
|
|
50001
|
-
} else {
|
|
50002
|
-
this.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
50003
|
-
386 /* TextTemplateIsMissingInPrimaryTextTranslationPackage */,
|
|
50004
|
-
node,
|
|
50005
|
-
void 0,
|
|
50006
|
-
1 /* Warning */
|
|
50007
|
-
));
|
|
50008
50011
|
}
|
|
50009
50012
|
break;
|
|
50010
50013
|
}
|
|
@@ -50035,13 +50038,13 @@ var SourceFileAnalyzer = class {
|
|
|
50035
50038
|
controller.skipChildrenTraverse();
|
|
50036
50039
|
} else {
|
|
50037
50040
|
if (textTranslationPackage.isPrimary()) {
|
|
50038
|
-
const targetPackage = textTranslationPackage.
|
|
50041
|
+
const targetPackage = textTranslationPackage.targetPackage;
|
|
50039
50042
|
const packages = this.analyzer.getTextTranslationPackagesOfTargetPackage(targetPackage);
|
|
50040
50043
|
if (packages !== void 0 && packages.some(
|
|
50041
50044
|
(p) => p.isPrimary() && p !== textTranslationPackage
|
|
50042
50045
|
)) {
|
|
50043
50046
|
this.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
50044
|
-
|
|
50047
|
+
391 /* OnlyOneTextTranslationPackageShouldBeMarkedAsPrimary */,
|
|
50045
50048
|
node.translationsKeyword,
|
|
50046
50049
|
[]
|
|
50047
50050
|
));
|
|
@@ -50301,10 +50304,7 @@ var SourceFileAnalyzer = class {
|
|
|
50301
50304
|
}
|
|
50302
50305
|
case 38 /* TypeExtensionDeclaration */: {
|
|
50303
50306
|
const entity = this.analyzer.entity.ofTypeExtensionDeclaration(node);
|
|
50304
|
-
|
|
50305
|
-
if (extendedType.kind === "error") {
|
|
50306
|
-
this.addDiagnostics(extendedType.value);
|
|
50307
|
-
}
|
|
50307
|
+
entity.ensureAllDiagnosticsReported?.();
|
|
50308
50308
|
this.modifierValidator.validateTopLevelTypeMembers(
|
|
50309
50309
|
node.memberBlock.memberList,
|
|
50310
50310
|
5 /* TypeExtension */,
|
|
@@ -52020,12 +52020,13 @@ var SourceFileAnalyzer = class {
|
|
|
52020
52020
|
}
|
|
52021
52021
|
const pkg2 = this.textTranslationPackage;
|
|
52022
52022
|
if (pkg2 !== void 0 && !pkg2.isPrimary()) {
|
|
52023
|
-
const primaryPkg = this.analyzer.getPrimaryTextTranslationPackageOfTargetPackage(pkg2.
|
|
52023
|
+
const primaryPkg = this.analyzer.getPrimaryTextTranslationPackageOfTargetPackage(pkg2.targetPackage);
|
|
52024
52024
|
if (primaryPkg !== void 0) {
|
|
52025
|
-
const
|
|
52026
|
-
|
|
52025
|
+
const textKey = TextIdentity.keyFromTextTranslationSource(sourceText);
|
|
52026
|
+
const textTranslation = primaryPkg.entity.getMembers().getTextTranslationsByTextKey(textKey);
|
|
52027
|
+
if (textTranslation.length === 0) {
|
|
52027
52028
|
this.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
52028
|
-
385 /*
|
|
52029
|
+
385 /* TextIsMissingAmongPrimaryTextTranslationDefinitions */,
|
|
52029
52030
|
sourceText,
|
|
52030
52031
|
void 0,
|
|
52031
52032
|
1 /* Warning */
|
|
@@ -52114,9 +52115,6 @@ var SourcePackageDependencyGraph = class {
|
|
|
52114
52115
|
const node = this.getNodeForPackage(rootPackage);
|
|
52115
52116
|
yield* __yieldStar(this.nodeAndDependenciesRecursively(node, platformKind, enumeratedPackages));
|
|
52116
52117
|
}
|
|
52117
|
-
for (const pkg2 of this.analyzer.enumerateAnalyzedTextTranslationPackages()) {
|
|
52118
|
-
yield pkg2.getDefinition();
|
|
52119
|
-
}
|
|
52120
52118
|
}
|
|
52121
52119
|
getNodeForPackage(pkg2) {
|
|
52122
52120
|
let result = this.nodeByPackage.get(pkg2);
|
|
@@ -52125,15 +52123,15 @@ var SourcePackageDependencyGraph = class {
|
|
|
52125
52123
|
}
|
|
52126
52124
|
result = new SourcePackageDependencyGraphNodeInternal(pkg2);
|
|
52127
52125
|
this.nodeByPackage.set(pkg2, result);
|
|
52128
|
-
const
|
|
52126
|
+
const importedPackagesMap = /* @__PURE__ */ new Map();
|
|
52129
52127
|
for (const sourceFile of pkg2.sourceFiles) {
|
|
52130
52128
|
const importInfos = this.analyzer.packageImports.getUniqueImportedPackages(sourceFile);
|
|
52131
52129
|
for (const importInfo of importInfos) {
|
|
52132
52130
|
const originalImportedPackageEntity = importInfo.entity.getOriginalEntity();
|
|
52133
|
-
let translationPackages =
|
|
52131
|
+
let translationPackages = importedPackagesMap.get(originalImportedPackageEntity);
|
|
52134
52132
|
if (translationPackages === void 0) {
|
|
52135
52133
|
translationPackages = /* @__PURE__ */ new Set();
|
|
52136
|
-
|
|
52134
|
+
importedPackagesMap.set(originalImportedPackageEntity, translationPackages);
|
|
52137
52135
|
}
|
|
52138
52136
|
const translation = importInfo.entity.getTranslation();
|
|
52139
52137
|
if (translation !== void 0) {
|
|
@@ -52141,13 +52139,12 @@ var SourcePackageDependencyGraph = class {
|
|
|
52141
52139
|
}
|
|
52142
52140
|
}
|
|
52143
52141
|
}
|
|
52144
|
-
for (const [packageEntity2, translationPackages] of
|
|
52142
|
+
for (const [packageEntity2, translationPackages] of importedPackagesMap) {
|
|
52145
52143
|
const definition = packageEntity2.getDefinition();
|
|
52146
52144
|
if (definition.kind !== 0 /* Source */) {
|
|
52147
52145
|
continue;
|
|
52148
52146
|
}
|
|
52149
52147
|
const node = this.getNodeForPackage(definition.package);
|
|
52150
|
-
const translationPackageArray = Array.from(translationPackages);
|
|
52151
52148
|
const implementationPackagesByPlatformKind = /* @__PURE__ */ new Map();
|
|
52152
52149
|
if (packageEntity2.getInterfacePackageInfo()?.kind === "multi-platform") {
|
|
52153
52150
|
const linkedMultiPlatformPackagesByPlatform = this.analyzer.getLinkedMultiPlatformPackagesByPlatform(packageEntity2);
|
|
@@ -52162,6 +52159,7 @@ var SourcePackageDependencyGraph = class {
|
|
|
52162
52159
|
}
|
|
52163
52160
|
}
|
|
52164
52161
|
}
|
|
52162
|
+
const translationPackageArray = Array.from(translationPackages);
|
|
52165
52163
|
const link = new SourcePackageDependencyGraphLinkInternal(
|
|
52166
52164
|
node,
|
|
52167
52165
|
translationPackageArray,
|
|
@@ -52169,6 +52167,15 @@ var SourcePackageDependencyGraph = class {
|
|
|
52169
52167
|
);
|
|
52170
52168
|
result.links.push(link);
|
|
52171
52169
|
}
|
|
52170
|
+
const textTranslationPackages = this.analyzer.getTextTranslationPackagesOfTargetPackage(
|
|
52171
|
+
this.analyzer.entity.ofPackage(pkg2)
|
|
52172
|
+
);
|
|
52173
|
+
if (textTranslationPackages !== void 0) {
|
|
52174
|
+
for (const textTranslationPackage of textTranslationPackages) {
|
|
52175
|
+
const node = this.getNodeForPackage(textTranslationPackage.sourcePackage);
|
|
52176
|
+
result.textTranslationPackages.push(node);
|
|
52177
|
+
}
|
|
52178
|
+
}
|
|
52172
52179
|
return result;
|
|
52173
52180
|
}
|
|
52174
52181
|
*nodeAndDependenciesRecursively(node, platformKind, enumeratedPackages) {
|
|
@@ -52178,10 +52185,10 @@ var SourcePackageDependencyGraph = class {
|
|
|
52178
52185
|
for (const link of node.links) {
|
|
52179
52186
|
yield* __yieldStar(this.nodeAndDependenciesRecursively(link.node, platformKind, enumeratedPackages));
|
|
52180
52187
|
for (const translationPackage of link.translationPackages) {
|
|
52181
|
-
const
|
|
52182
|
-
if (!enumeratedPackages.has(
|
|
52183
|
-
yield
|
|
52184
|
-
enumeratedPackages.add(
|
|
52188
|
+
const sourcePackage = translationPackage.getDefinition();
|
|
52189
|
+
if (!enumeratedPackages.has(sourcePackage)) {
|
|
52190
|
+
yield sourcePackage;
|
|
52191
|
+
enumeratedPackages.add(sourcePackage);
|
|
52185
52192
|
}
|
|
52186
52193
|
}
|
|
52187
52194
|
const implementationPackageNode = link.implementationPackageByPlatformKind.get(platformKind);
|
|
@@ -52193,6 +52200,13 @@ var SourcePackageDependencyGraph = class {
|
|
|
52193
52200
|
));
|
|
52194
52201
|
}
|
|
52195
52202
|
}
|
|
52203
|
+
for (const textTranslationPackage of node.textTranslationPackages) {
|
|
52204
|
+
const sourcePackage = textTranslationPackage.pkg;
|
|
52205
|
+
if (!enumeratedPackages.has(sourcePackage)) {
|
|
52206
|
+
yield sourcePackage;
|
|
52207
|
+
enumeratedPackages.add(sourcePackage);
|
|
52208
|
+
}
|
|
52209
|
+
}
|
|
52196
52210
|
}
|
|
52197
52211
|
}
|
|
52198
52212
|
};
|
|
@@ -52200,6 +52214,7 @@ var SourcePackageDependencyGraphNodeInternal = class {
|
|
|
52200
52214
|
constructor(pkg2) {
|
|
52201
52215
|
this.pkg = pkg2;
|
|
52202
52216
|
this.links = new Array();
|
|
52217
|
+
this.textTranslationPackages = new Array();
|
|
52203
52218
|
}
|
|
52204
52219
|
};
|
|
52205
52220
|
var SourcePackageDependencyGraphLinkInternal = class {
|
|
@@ -53986,7 +54001,7 @@ var SourcePackageEntity = class {
|
|
|
53986
54001
|
});
|
|
53987
54002
|
}
|
|
53988
54003
|
getSupportedPlatforms() {
|
|
53989
|
-
if (this.package_.kind === "program") {
|
|
54004
|
+
if (this.package_.kind === "program" || this.package_.kind === "text-translation") {
|
|
53990
54005
|
switch (this.package_.configuration.targetPlatform.kind) {
|
|
53991
54006
|
case "any":
|
|
53992
54007
|
return [0 /* JavaScript */, 2 /* DotNet */];
|
|
@@ -54021,12 +54036,20 @@ var SourcePackageEntity = class {
|
|
|
54021
54036
|
createPackageMembers() {
|
|
54022
54037
|
let namedMembers = Query.empty();
|
|
54023
54038
|
let typeExtensions = Query.empty();
|
|
54039
|
+
let textTranslationEntities = Query.empty();
|
|
54024
54040
|
for (const sourceFile of this.package_.sourceFiles) {
|
|
54025
54041
|
const sourceFileMembers = this.analyzer.getSourceFileMembers(sourceFile.getSyntaxNode());
|
|
54026
|
-
namedMembers = namedMembers.chain(
|
|
54042
|
+
namedMembers = namedMembers.chain(
|
|
54043
|
+
sourceFileMembers.getNamedDeclarations().filter((d) => d.kind !== 10 /* PackageAlias */)
|
|
54044
|
+
);
|
|
54027
54045
|
typeExtensions = typeExtensions.chain(sourceFileMembers.getTypeExtensions());
|
|
54046
|
+
textTranslationEntities = textTranslationEntities.chain(sourceFileMembers.getTextTranslations());
|
|
54028
54047
|
}
|
|
54029
|
-
return new PackageEntityMembers(
|
|
54048
|
+
return new PackageEntityMembers(
|
|
54049
|
+
namedMembers.toArray(),
|
|
54050
|
+
typeExtensions.toArray(),
|
|
54051
|
+
textTranslationEntities.toArray()
|
|
54052
|
+
);
|
|
54030
54053
|
}
|
|
54031
54054
|
createInterfacePackageInfo() {
|
|
54032
54055
|
if (this.package_.kind !== "program") {
|
|
@@ -54741,6 +54764,9 @@ var TextTranslationDeclarationEntity = class {
|
|
|
54741
54764
|
getDialect() {
|
|
54742
54765
|
return this.node.dialect;
|
|
54743
54766
|
}
|
|
54767
|
+
isHidden() {
|
|
54768
|
+
return void 0;
|
|
54769
|
+
}
|
|
54744
54770
|
};
|
|
54745
54771
|
TextTranslationDeclarationEntity = __decorateClass([
|
|
54746
54772
|
entityToStringDecorator
|
|
@@ -54752,7 +54778,9 @@ var SourceTypeExtensionEntity = class {
|
|
|
54752
54778
|
this.kind = 11 /* TypeExtension */;
|
|
54753
54779
|
this.members = new Cached();
|
|
54754
54780
|
this.hiding = new Cached();
|
|
54781
|
+
this.extendedType = new Cached();
|
|
54755
54782
|
this.modifierFlags_ = 2048 /* NotComputed */;
|
|
54783
|
+
this.hasReportedAllDiagnostics = false;
|
|
54756
54784
|
this.analyzer = analyzer;
|
|
54757
54785
|
this.node = node;
|
|
54758
54786
|
}
|
|
@@ -54779,11 +54807,7 @@ var SourceTypeExtensionEntity = class {
|
|
|
54779
54807
|
return TreeQuery.getPackageEntity(this.node, this.analyzer);
|
|
54780
54808
|
}
|
|
54781
54809
|
getExtendedTypeEntity() {
|
|
54782
|
-
|
|
54783
|
-
if (extendedType.kind === "error") {
|
|
54784
|
-
return void 0;
|
|
54785
|
-
}
|
|
54786
|
-
return extendedType.value;
|
|
54810
|
+
return this.extendedType.getOrInsertWith(() => this.resolveExtendedType());
|
|
54787
54811
|
}
|
|
54788
54812
|
getDefinition() {
|
|
54789
54813
|
return { kind: 0 /* Source */, node: this.node };
|
|
@@ -54809,6 +54833,34 @@ var SourceTypeExtensionEntity = class {
|
|
|
54809
54833
|
getOriginalEntity() {
|
|
54810
54834
|
return this;
|
|
54811
54835
|
}
|
|
54836
|
+
ensureAllDiagnosticsReported() {
|
|
54837
|
+
if (!this.hasReportedAllDiagnostics) {
|
|
54838
|
+
this.getExtendedTypeEntity();
|
|
54839
|
+
this.hasReportedAllDiagnostics = true;
|
|
54840
|
+
}
|
|
54841
|
+
}
|
|
54842
|
+
resolveExtendedType() {
|
|
54843
|
+
let result;
|
|
54844
|
+
const diagnostics = this.analyzer.getAcceptorForDiagnosticsComputedLazily();
|
|
54845
|
+
const typeResolver = new NamedTypeResolver(this.analyzer, this.node.extendedTypeClause.qualifiedName);
|
|
54846
|
+
const resolutionResult = typeResolver.resolve();
|
|
54847
|
+
if (resolutionResult.diagnostics.length > 0) {
|
|
54848
|
+
for (const diagnostic of resolutionResult.diagnostics) {
|
|
54849
|
+
diagnostics.addDiagnostic(diagnostic);
|
|
54850
|
+
}
|
|
54851
|
+
} else {
|
|
54852
|
+
const arity = this.node.extendedTypeClause.commaList !== void 0 ? this.node.extendedTypeClause.commaList.commas.length + 1 : 0;
|
|
54853
|
+
result = resolutionResult.types.find((t) => t.getArity() === arity);
|
|
54854
|
+
if (result === void 0) {
|
|
54855
|
+
diagnostics.addDiagnostic(this.analyzer.createNodeDiagnostic(
|
|
54856
|
+
228 /* TypeWithArity0NotFound */,
|
|
54857
|
+
this.node.extendedTypeClause,
|
|
54858
|
+
[arity.toString()]
|
|
54859
|
+
));
|
|
54860
|
+
}
|
|
54861
|
+
}
|
|
54862
|
+
return result;
|
|
54863
|
+
}
|
|
54812
54864
|
};
|
|
54813
54865
|
SourceTypeExtensionEntity = __decorateClass([
|
|
54814
54866
|
entityToStringDecorator
|
|
@@ -71051,6 +71103,7 @@ export {
|
|
|
71051
71103
|
SourcePackageStructuredTypeDeclarationData,
|
|
71052
71104
|
SourceAnonymousStructuredTypeDeclarationData,
|
|
71053
71105
|
TextTranslationDeclarationEntity,
|
|
71106
|
+
PackageMemberLookup,
|
|
71054
71107
|
SourceTypeExtensionEntity,
|
|
71055
71108
|
SourceTypeParameterEntity,
|
|
71056
71109
|
PackageVariableDeclarationEntity,
|
|
@@ -71092,7 +71145,6 @@ export {
|
|
|
71092
71145
|
AccessedFunction_substitutedFunction,
|
|
71093
71146
|
AccessedFunctionParameter,
|
|
71094
71147
|
ImportedPackageNameTree,
|
|
71095
|
-
PackageMemberLookup,
|
|
71096
71148
|
SourceFileMembers,
|
|
71097
71149
|
semantic_context_exports,
|
|
71098
71150
|
Analyzer12 as Analyzer,
|