coc-pyright 1.1.268 → 1.1.269

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 (2) hide show
  1. package/lib/index.js +25 -3
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -42604,6 +42604,7 @@ var require_package_nls_en_us = __commonJS({
42604
42604
  keyValueInSet: "Key/value pairs are not allowed within a set",
42605
42605
  keywordArgInTypeArgument: "Keyword arguments cannot be used in type argument lists",
42606
42606
  keywordOnlyAfterArgs: 'Keyword-only argument separator not allowed after "*" parameter',
42607
+ keywordParameterMissing: 'One or more keyword parameters must follow "*" parameter',
42607
42608
  keywordSubscriptIllegal: "Keyword arguments within subscripts are not supported",
42608
42609
  lambdaReturnTypeUnknown: "Return type of lambda is unknown",
42609
42610
  lambdaReturnTypePartiallyUnknown: 'Return type of lambda, "{returnType}", is partially unknown',
@@ -43444,6 +43445,7 @@ var require_localize = __commonJS({
43444
43445
  Diagnostic5.keyValueInSet = () => getRawString("Diagnostic.keyValueInSet");
43445
43446
  Diagnostic5.keywordArgInTypeArgument = () => getRawString("Diagnostic.keywordArgInTypeArgument");
43446
43447
  Diagnostic5.keywordOnlyAfterArgs = () => getRawString("Diagnostic.keywordOnlyAfterArgs");
43448
+ Diagnostic5.keywordParameterMissing = () => getRawString("Diagnostic.keywordParameterMissing");
43447
43449
  Diagnostic5.keywordSubscriptIllegal = () => getRawString("Diagnostic.keywordSubscriptIllegal");
43448
43450
  Diagnostic5.lambdaReturnTypeUnknown = () => getRawString("Diagnostic.lambdaReturnTypeUnknown");
43449
43451
  Diagnostic5.lambdaReturnTypePartiallyUnknown = () => new ParameterizedString(getRawString("Diagnostic.lambdaReturnTypePartiallyUnknown"));
@@ -65298,7 +65300,8 @@ var require_typeEvaluator = __commonJS({
65298
65300
  ]);
65299
65301
  var maxReturnTypeInferenceStackSize = 2;
65300
65302
  var maxReturnTypeInferenceArgumentCount = 6;
65301
- var maxReturnTypeInferenceCodeFlowComplexity = 8;
65303
+ var maxReturnTypeInferenceCodeFlowComplexity = 32;
65304
+ var maxReturnCallSiteTypeInferenceCodeFlowComplexity = 8;
65302
65305
  var maxCallSiteReturnTypeCacheSize = 8;
65303
65306
  var maxEntriesToUseForInference = 64;
65304
65307
  var maxDeclarationsToUseForInference = 64;
@@ -77125,7 +77128,7 @@ var require_typeEvaluator = __commonJS({
77125
77128
  }
77126
77129
  const functionNode = type.details.declaration.node;
77127
77130
  const codeFlowComplexity = AnalyzerNodeInfo.getCodeFlowComplexity(functionNode);
77128
- if (codeFlowComplexity >= maxReturnTypeInferenceCodeFlowComplexity) {
77131
+ if (codeFlowComplexity >= maxReturnCallSiteTypeInferenceCodeFlowComplexity) {
77129
77132
  return void 0;
77130
77133
  }
77131
77134
  if (args.some((arg) => !arg.paramName)) {
@@ -86639,6 +86642,7 @@ var require_parser = __commonJS({
86639
86642
  let reportedNonDefaultParamErr = false;
86640
86643
  let sawKeywordOnlySeparator = false;
86641
86644
  let sawPositionOnlySeparator = false;
86645
+ let sawKeywordOnlyParamAfterSeparator = false;
86642
86646
  let sawArgs = false;
86643
86647
  let sawKwArgs = false;
86644
86648
  while (true) {
@@ -86673,6 +86677,9 @@ var require_parser = __commonJS({
86673
86677
  }
86674
86678
  sawPositionOnlySeparator = true;
86675
86679
  } else {
86680
+ if (sawKeywordOnlySeparator) {
86681
+ sawKeywordOnlyParamAfterSeparator = true;
86682
+ }
86676
86683
  if (param.defaultValue) {
86677
86684
  sawDefaultParam = true;
86678
86685
  } else if (sawDefaultParam && !sawKeywordOnlySeparator && !sawArgs) {
@@ -86704,6 +86711,9 @@ var require_parser = __commonJS({
86704
86711
  this._addError(localize_1.Localizer.Diagnostic.duplicateKwargsParam(), param);
86705
86712
  }
86706
86713
  sawKwArgs = true;
86714
+ if (sawKeywordOnlySeparator && !sawKeywordOnlyParamAfterSeparator) {
86715
+ this._addError(localize_1.Localizer.Diagnostic.keywordParameterMissing(), param);
86716
+ }
86707
86717
  } else if (sawKwArgs) {
86708
86718
  this._addError(localize_1.Localizer.Diagnostic.paramAfterKwargsParam(), param);
86709
86719
  }
@@ -92641,6 +92651,17 @@ async function provideHover(document, position, token, next) {
92641
92651
  }
92642
92652
  return hover;
92643
92653
  }
92654
+ async function provideSignatureHelp(document, position, context, token, next) {
92655
+ const sign = await next(document, position, context, token);
92656
+ if (sign && sign.signatures.length) {
92657
+ sign.signatures.forEach((info) => {
92658
+ if (info.documentation && typeof info.documentation === "object" && info.documentation.kind === "markdown") {
92659
+ info.documentation.value = info.documentation.value.replace(/ /g, " ");
92660
+ }
92661
+ });
92662
+ }
92663
+ return sign;
92664
+ }
92644
92665
  async function handleDiagnostics(uri, diagnostics, next) {
92645
92666
  next(
92646
92667
  uri,
@@ -92730,8 +92751,9 @@ async function activate(context) {
92730
92751
  configuration
92731
92752
  },
92732
92753
  provideHover,
92733
- handleDiagnostics,
92754
+ provideSignatureHelp,
92734
92755
  provideCompletionItem,
92756
+ handleDiagnostics,
92735
92757
  resolveCompletionItem
92736
92758
  }
92737
92759
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.268",
3
+ "version": "1.1.269",
4
4
  "description": "Pyright extension for coc.nvim, static type checker for Python",
5
5
  "author": "Heyward Fann <fannheyward@gmail.com>",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "@types/which": "^2.0.0",
45
45
  "@typescript-eslint/eslint-plugin": "^5.6.0",
46
46
  "@typescript-eslint/parser": "^5.6.0",
47
- "@zzzen/pyright-internal": "^1.2.0-dev.20220821",
47
+ "@zzzen/pyright-internal": "^1.2.0-dev.20220828",
48
48
  "coc.nvim": "^0.0.82",
49
49
  "diff-match-patch": "^1.0.5",
50
50
  "esbuild": "^0.14.2",
@@ -1451,6 +1451,6 @@
1451
1451
  ]
1452
1452
  },
1453
1453
  "dependencies": {
1454
- "pyright": "^1.1.268"
1454
+ "pyright": "^1.1.269"
1455
1455
  }
1456
1456
  }