@zzzen/pyright-internal 1.2.0-dev.20250105 → 1.2.0-dev.20250112

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.
Files changed (42) hide show
  1. package/dist/analyzer/importStatementUtils.js +1 -1
  2. package/dist/analyzer/importStatementUtils.js.map +1 -1
  3. package/dist/analyzer/parentDirectoryCache.js +1 -1
  4. package/dist/analyzer/parentDirectoryCache.js.map +1 -1
  5. package/dist/analyzer/parseTreeUtils.d.ts +2 -1
  6. package/dist/analyzer/parseTreeUtils.js +22 -15
  7. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  8. package/dist/analyzer/typeEvaluator.js +3 -0
  9. package/dist/analyzer/typeEvaluator.js.map +1 -1
  10. package/dist/languageService/autoImporter.d.ts +6 -8
  11. package/dist/languageService/autoImporter.js +23 -16
  12. package/dist/languageService/autoImporter.js.map +1 -1
  13. package/dist/localization/localize.d.ts +1 -0
  14. package/dist/localization/localize.js +1 -0
  15. package/dist/localization/localize.js.map +1 -1
  16. package/dist/localization/package.nls.cs.json +4 -4
  17. package/dist/localization/package.nls.de.json +4 -4
  18. package/dist/localization/package.nls.en-us.json +1 -0
  19. package/dist/localization/package.nls.es.json +4 -4
  20. package/dist/localization/package.nls.fr.json +4 -4
  21. package/dist/localization/package.nls.it.json +4 -4
  22. package/dist/localization/package.nls.ja.json +4 -4
  23. package/dist/localization/package.nls.ko.json +4 -4
  24. package/dist/localization/package.nls.pl.json +4 -4
  25. package/dist/localization/package.nls.pt-br.json +4 -4
  26. package/dist/localization/package.nls.qps-ploc.json +4 -4
  27. package/dist/localization/package.nls.ru.json +4 -4
  28. package/dist/localization/package.nls.tr.json +4 -4
  29. package/dist/localization/package.nls.zh-cn.json +4 -4
  30. package/dist/localization/package.nls.zh-tw.json +4 -4
  31. package/dist/parser/parser.js +13 -3
  32. package/dist/parser/parser.js.map +1 -1
  33. package/dist/parser/stringTokenUtils.d.ts +1 -1
  34. package/dist/parser/stringTokenUtils.js +4 -2
  35. package/dist/parser/stringTokenUtils.js.map +1 -1
  36. package/dist/tests/harness/fourslash/testState.js +8 -0
  37. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  38. package/dist/tests/testUtils.d.ts +0 -1
  39. package/dist/tests/testUtils.js +29 -21
  40. package/dist/tests/testUtils.js.map +1 -1
  41. package/dist/tests/typeEvaluator4.test.js +1 -1
  42. package/package.json +5 -5
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "Le type \"{type}\" n'est pas hachable",
816
816
  "uninitializedAbstractVariable": "La variable d’instance « {name} » est définie dans la classe de base abstraite « {classType} » mais n’est pas initialisée",
817
817
  "unreachableExcept": "« {exceptionType} » est une sous-classe de « {parentType} »",
818
- "useDictInstead": "Utilisez Dict[T1, T2] pour indiquer un type de dictionnaire",
819
- "useListInstead": "Utilisez List[T] pour indiquer un type de liste ou Union[T1, T2] pour indiquer un type d'union",
820
- "useTupleInstead": "Utiliser tuple[T1, ..., Tn] pour indiquer un type de tuple ou Union[T1, T2] pour indiquer un type d’union",
821
- "useTypeInstead": "Utiliser le Type[T] à la place",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "La variance de l'argument de type \"{typeVarName}\" est incompatible avec la classe de base \"{className}\"",
823
823
  "varianceMismatchForTypeAlias": "La variance de l'argument de type \"{typeVarName}\" est incompatible avec \"{typeAliasParam}\""
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "Il tipo \"{type}\" non è hashable",
816
816
  "uninitializedAbstractVariable": "La variabile di istanza \"{name}\" è definita nella classe di base astratta \"{classType}\" ma non è inizializzata",
817
817
  "unreachableExcept": "\"{exceptionType}\" è una sottoclasse di \"{parentType}\"",
818
- "useDictInstead": "Usare Dict[T1, T2] per indicare un tipo di dizionario",
819
- "useListInstead": "Usare List[T] per indicare un tipo di list o Union[T1, T2] per indicare un tipo di unione",
820
- "useTupleInstead": "Usare tuple[T1, ..., Tn] per indicare un tipo di tuple o Union[T1, T2] per indicare un tipo di unione",
821
- "useTypeInstead": "In alternativa, usare Type[T]",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "La varianza dell'argomento tipo \"{typeVarName}\" non è compatibile con la classe di base \"{className}\"",
823
823
  "varianceMismatchForTypeAlias": "La varianza dell'argomento tipo \"{typeVarName}\" non è compatibile con \"{typeAliasParam}\""
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "型 \"{type}\" はハッシュ可能ではありません",
816
816
  "uninitializedAbstractVariable": "インスタンス変数 \"{name}\" は抽象基本クラス \"{classType}\" で定義されていますが、初期化されていません",
817
817
  "unreachableExcept": "\"{exceptionType}\" は \"{parentType}\" のサブクラスです",
818
- "useDictInstead": "辞書の種類を示すには、Dict[T1, T2] を使用します",
819
- "useListInstead": "List[T] を使用して list 型を示すか、Union[T1, T2] を使用して union 型を示します",
820
- "useTupleInstead": "tuple[T1, ..., Tn] を使用して tuple 型を示すか、Union[T1, T2] を使用して union 型を示します",
821
- "useTypeInstead": "代わりに Type[T] を使用する",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "型引数 \"{typeVarName}\" の分散は、基底クラス \"{className}\" と互換性がありません",
823
823
  "varianceMismatchForTypeAlias": "型引数 \"{typeVarName}\" の分散は \"{typeAliasParam}\" と互換性がありません"
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "‘{type}’ 형식을 해시할 수 없습니다.",
816
816
  "uninitializedAbstractVariable": "인스턴스 변수 \"{name}\"이(가) 추상 기본 클래스 \"{classType}\"에 정의되어 있지만 초기화되지 않았습니다.",
817
817
  "unreachableExcept": "\"{exceptionType}\"은(는) \"{parentType}\"의 서브클래스입니다.",
818
- "useDictInstead": "사전 형식을 나타내려면 Dict[T1, T2] 사용하세요.",
819
- "useListInstead": "List[T] 사용하여 list 형식을 나타내거나 Union[T1, T2]를 사용하여 union 형식을 나타내세요.",
820
- "useTupleInstead": "tuple[T1, ..., Tn] 사용하여 tuple 형식을 나타내거나 Union[T1, T2]을 사용하여 union 형식을 나타냅니다.",
821
- "useTypeInstead": "대신 Type[T] 사용",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "‘{typeVarName}’ 형식 인수의 차이는 ‘{className}’ 기본 클래스와 호환되지 않습니다.",
823
823
  "varianceMismatchForTypeAlias": "‘{typeVarName}’ 형식 인수의 차이는 ‘{typeAliasParam}’와(과) 호환되지 않습니다."
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "Typ „{type}” nie jest wartością skrótu",
816
816
  "uninitializedAbstractVariable": "zmienna wystąpienia „{name}” jest zdefiniowana w abstrakcyjnej klasie bazowej „{classType}” ale nie została zainicjowana",
817
817
  "unreachableExcept": "Typ „{exceptionType}” jest podklasą typu „{parentType}”",
818
- "useDictInstead": "Użyj funkcji Dict[T1, T2], aby wskazać typ słownika",
819
- "useListInstead": "Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type",
820
- "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type",
821
- "useTypeInstead": "Zamiast tego użyj typu Type[T].",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "Wariancja argumentu typu „{typeVarName}” jest niezgodna z klasą bazową „{className}”",
823
823
  "varianceMismatchForTypeAlias": "Wariancja argumentu typu „{typeVarName}” jest niezgodna z parametrem „{typeAliasParam}”"
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "O tipo \"{type}\" não é pode fazer hash",
816
816
  "uninitializedAbstractVariable": "A variável de instância \"{name}\" está definida na classe base abstrata \"{classType}\", mas não foi inicializada",
817
817
  "unreachableExcept": "\"{exceptionType}\" é uma subclasse de \"{parentType}\"",
818
- "useDictInstead": "Use Dict[T1, T2] para indicar um tipo de dicionário",
819
- "useListInstead": "Use List[T] para indicar um tipo de lista ou Union[T1, T2] para indicar um tipo de union",
820
- "useTupleInstead": "Use tuple[T1, ..., Tn] para indicar um tipo de tuple ou Union[T1, T2] para indicar um tipo de union",
821
- "useTypeInstead": "Use Type[T] em vez disso",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "A variação do argumento de tipo \"{typeVarName}\" é incompatível com a classe base \"{className}\"",
823
823
  "varianceMismatchForTypeAlias": "A variação do argumento de tipo \"{typeVarName}\" é incompatível com \"{typeAliasParam}\""
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "[IJEeq][นั้Tÿpë \"{tÿpë}\" ïs ñøt hæshæþlëẤğ倪İЂҰक्र्तिृนั้ढूँ]",
816
816
  "uninitializedAbstractVariable": "[uDuHt][นั้Ïñstæñçë værïæþlë \"{ñæmë}\" ïs ðëfïñëð ïñ æþstræçt þæsë çlæss \"{çlæssTÿpë}\" þµt ñøt ïñïtïælïzëðẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्นั้ढूँ]",
817
817
  "unreachableExcept": "[3CSUL][นั้\"{ëxçëptïøñTÿpë}\" ïs æ sµþçlæss øf \"{pærëñtTÿpë}\"Ấğ倪İЂҰक्र्तिृまẤğ倪İЂҰนั้ढूँ]",
818
- "useDictInstead": "[LReB5][นั้Üsë Dict[T1, T2] tø ïñðïçætë æ ðïçtïøñærÿ tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İนั้ढूँ]",
819
- "useListInstead": "[RPu0E][นั้Üsë List[T] tø ïñðïçætë æ list tÿpë ør Union[T1, T2] tø ïñðïçætë æ union tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪นั้ढूँ]",
820
- "useTupleInstead": "[jaFqC][นั้Üsë tuple[T1, ..., Tn] tø ïñðïçætë æ tuple tÿpë ør Union[T1, T2] tø ïñðïçætë æ union tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्นั้ढूँ]",
821
- "useTypeInstead": "[Zig8D][นั้Üsë Type[T] ïñstëæðẤğ倪İЂҰक्นั้ढूँ]",
818
+ "useDictInstead": "[LReB5][นั้Üsë dict[T1, T2] tø ïñðïçætë æ ðïçtïøñærÿ tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İนั้ढूँ]",
819
+ "useListInstead": "[RPu0E][นั้Üsë list[T] tø ïñðïçætë æ list tÿpë ør T1 | T2 tø ïñðïçætë æ union tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまนั้ढूँ]",
820
+ "useTupleInstead": "[jaFqC][นั้Üsë tuple[T1, ..., Tn] tø ïñðïçætë æ tuple tÿpë ør T1 | T2 tø ïñðïçætë æ union tÿpëẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪İЂนั้ढूँ]",
821
+ "useTypeInstead": "[Zig8D][นั้Üsë type[T] ïñstëæðẤğ倪İЂҰक्นั้ढूँ]",
822
822
  "varianceMismatchForClass": "[fqhIl][นั้Værïæñçë øf tÿpë ærgµmëñt \"{tÿpëVærÑæmë}\" ïs ïñçømpætïþlë wïth þæsë çlæss \"{çlæssÑæmë}\"Ấğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्นั้ढूँ]",
823
823
  "varianceMismatchForTypeAlias": "[YSiVx][นั้Værïæñçë øf tÿpë ærgµmëñt \"{tÿpëVærÑæmë}\" ïs ïñçømpætïþlë wïth \"{tÿpëÆlïæsPæræm}\"Ấğ倪İЂҰक्र्तिृまẤğ倪İЂҰक्र्तिृまẤğ倪İนั้ढूँ]"
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "Тип \"{type}\" не является хэшируемым",
816
816
  "uninitializedAbstractVariable": "Переменная экземпляра \"{name}\" определена в абстрактном базовом классе \"{classType}\", но не инициализирована",
817
817
  "unreachableExcept": "\"{exceptionType}\" является подклассом \"{parentType}\"",
818
- "useDictInstead": "Используйте Dict[T1, T2] для указания типа словаря",
819
- "useListInstead": "Используйте List[T] для указания типа list или Union[T1, T2] для указания типа union",
820
- "useTupleInstead": "Используйте конструкцию tuple[T1, ..., Tn], чтобы указать тип tuple, или Union[T1, T2], чтобы указать тип union",
821
- "useTypeInstead": "Используйте вместо этого Type[T]",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "Вариант аргумента типа \"{typeVarName}\" несовместим с базовым классом \"{className}\"",
823
823
  "varianceMismatchForTypeAlias": "Отклонение аргумента типа \"{typeVarName}\" несовместимо с \"{typeAliasParam}\""
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "\"{type}\" türü karmalanabilir değil",
816
816
  "uninitializedAbstractVariable": "\"{name}\" örnek değişkeni, \"{classType}\" soyut temel sınıfında tanımlandı ancak başlatılmadı",
817
817
  "unreachableExcept": "\"{exceptionType}\", \"{parentType}\" üst öğesinin bir alt sınıfı",
818
- "useDictInstead": "Sözlük türünü belirtmek için Dict[T1, T2] kullanın",
819
- "useListInstead": "Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type",
820
- "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type",
821
- "useTypeInstead": "Bunun yerine Type[T] kullanın",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "\"{typeVarName}\" tür bağımsız değişkeni \"{className}\" taban sınıfıyla uyumsuz",
823
823
  "varianceMismatchForTypeAlias": "\"{typeVarName}\" tür bağımsız değişkeninin varyansı, \"{typeAliasParam}\" ile uyumsuz"
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "类型“{type}”不可哈希",
816
816
  "uninitializedAbstractVariable": "实例变量“{name}”在抽象基类“{classType}”中定义,但未初始化",
817
817
  "unreachableExcept": "“{exceptionType}”是“{parentType}”的子类",
818
- "useDictInstead": "使用 Dict[T1, T2] 指示字典类型",
819
- "useListInstead": "使用 List[T] 指示 list 类型或使用 Union[T1, T2] 指示 union 类型",
820
- "useTupleInstead": "使用 tuple[T1, ..., Tn] 指示 tuple 类型或使用 Union[T1, T2] 指示 union 类型",
821
- "useTypeInstead": "改用 Type[T]",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "类型参数\"{typeVarName}\"的差异与基类\"{className}\"不兼容",
823
823
  "varianceMismatchForTypeAlias": "类型参数\"{typeVarName}\"的差异与\"{typeAliasParam}\"不兼容"
824
824
  },
@@ -815,10 +815,10 @@
815
815
  "unhashableType": "型別 \"{type}\" 無法雜湊",
816
816
  "uninitializedAbstractVariable": "執行個體變數 \"{name}\" 在抽象基底類別 \"{classType}\" 中定義,但未初始化",
817
817
  "unreachableExcept": "\"{exceptionType}\" 是 \"{parentType}\" 的子類別",
818
- "useDictInstead": "使用 Dict[T1, T2] 來表示字典型別",
819
- "useListInstead": "使用 List[T] 來指出 list 類型,或使用 Union[T1, T2] 來指出 union 類型",
820
- "useTupleInstead": "使用 tuple[T1, ..., Tn] 來指出 tuple 類型,或使用 Union[T1, T2] 來指出 union 類型",
821
- "useTypeInstead": "改為使用 Type[T]",
818
+ "useDictInstead": "Use dict[T1, T2] to indicate a dictionary type",
819
+ "useListInstead": "Use list[T] to indicate a list type or T1 | T2 to indicate a union type",
820
+ "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type",
821
+ "useTypeInstead": "Use type[T] instead",
822
822
  "varianceMismatchForClass": "型別引數 \"{typeVarName}\" 的變異數與基底類別 \"{className}\" 不相容",
823
823
  "varianceMismatchForTypeAlias": "型別引數 \"{typeVarName}\" 的變異數與 \"{typeAliasParam}\" 不相容"
824
824
  },
@@ -3015,6 +3015,7 @@ class Parser {
3015
3015
  _parseArgList() {
3016
3016
  const argList = [];
3017
3017
  let sawKeywordArg = false;
3018
+ let sawUnpackedKeywordArg = false;
3018
3019
  let trailingComma = false;
3019
3020
  while (true) {
3020
3021
  const nextTokenType = this._peekTokenType();
@@ -3028,8 +3029,16 @@ class Parser {
3028
3029
  if (arg.d.name) {
3029
3030
  sawKeywordArg = true;
3030
3031
  }
3031
- else if (sawKeywordArg && arg.d.argCategory === 0 /* ArgCategory.Simple */) {
3032
- this._addSyntaxError(localize_1.LocMessage.positionArgAfterNamedArg(), arg);
3032
+ else {
3033
+ if (sawKeywordArg && arg.d.argCategory === 0 /* ArgCategory.Simple */) {
3034
+ this._addSyntaxError(localize_1.LocMessage.positionArgAfterNamedArg(), arg);
3035
+ }
3036
+ if (sawUnpackedKeywordArg && arg.d.argCategory !== 2 /* ArgCategory.UnpackedDictionary */) {
3037
+ this._addSyntaxError(localize_1.LocMessage.positionArgAfterUnpackedDictArg(), arg);
3038
+ }
3039
+ }
3040
+ if (arg.d.argCategory === 2 /* ArgCategory.UnpackedDictionary */) {
3041
+ sawUnpackedKeywordArg = true;
3033
3042
  }
3034
3043
  argList.push(arg);
3035
3044
  if (!this._consumeTokenIfType(12 /* TokenType.Comma */)) {
@@ -3890,7 +3899,8 @@ class Parser {
3890
3899
  }
3891
3900
  else {
3892
3901
  const stringToken = stringNode.d.strings[0].d.token;
3893
- const stringValue = StringTokenUtils.getUnescapedString(stringNode.d.strings[0].d.token);
3902
+ const stringValue = StringTokenUtils.getUnescapedString(stringNode.d.strings[0].d.token,
3903
+ /* elideCrlf */ false);
3894
3904
  const unescapedString = stringValue.value;
3895
3905
  const tokenOffset = stringToken.start;
3896
3906
  const prefixLength = stringToken.prefixLength + stringToken.quoteMarkLength;