coc-pyright 1.1.260 → 1.1.266
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/README.md +2 -1
- package/lib/index.js +259 -137
- package/package.json +18 -2
- package/schemas/pyrightconfig.schema.json +6 -0
package/README.md
CHANGED
|
@@ -65,8 +65,9 @@ These configurations are used by `coc-pyright`, you need to set them in your `co
|
|
|
65
65
|
| python.sortImports.path | Path to isort script, default using inner version | '' |
|
|
66
66
|
| python.sortImports.args | Arguments passed to isort | [] |
|
|
67
67
|
| pyright.server | Custom `pyright-langserver` path | '' |
|
|
68
|
-
| pyright.disableCompletion | Disables completion from Pyright
|
|
68
|
+
| pyright.disableCompletion | Disables completion from Pyright | false |
|
|
69
69
|
| pyright.disableDiagnostics | Disable diagnostics from Pyright | false |
|
|
70
|
+
| pyright.disableDocumentation | Disables hover documentation from Pyright | false |
|
|
70
71
|
| pyright.disableProgressNotifications | Disable the initialization and workdone progress notifications | false |
|
|
71
72
|
| pyright.completion.importSupport | Enable `python-import` completion source support | true |
|
|
72
73
|
| pyright.completion.snippetSupport | Enable completion snippets support | true |
|
package/lib/index.js
CHANGED
|
@@ -20,7 +20,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
20
|
}
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
24
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
28
|
|
|
26
29
|
// node_modules/semver/internal/constants.js
|
|
@@ -165,7 +168,9 @@ var require_semver = __commonJS({
|
|
|
165
168
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
166
169
|
}
|
|
167
170
|
if (version.length > MAX_LENGTH) {
|
|
168
|
-
throw new TypeError(
|
|
171
|
+
throw new TypeError(
|
|
172
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
173
|
+
);
|
|
169
174
|
}
|
|
170
175
|
debug("SemVer", version, options);
|
|
171
176
|
this.options = options;
|
|
@@ -434,7 +439,10 @@ var require_inc = __commonJS({
|
|
|
434
439
|
options = void 0;
|
|
435
440
|
}
|
|
436
441
|
try {
|
|
437
|
-
return new SemVer2(
|
|
442
|
+
return new SemVer2(
|
|
443
|
+
version instanceof SemVer2 ? version.version : version,
|
|
444
|
+
options
|
|
445
|
+
).inc(release, identifier).version;
|
|
438
446
|
} catch (er) {
|
|
439
447
|
return null;
|
|
440
448
|
}
|
|
@@ -2566,7 +2574,11 @@ var require_universalify = __commonJS({
|
|
|
2566
2574
|
fn.apply(this, args);
|
|
2567
2575
|
else {
|
|
2568
2576
|
return new Promise((resolve, reject) => {
|
|
2569
|
-
fn.call(
|
|
2577
|
+
fn.call(
|
|
2578
|
+
this,
|
|
2579
|
+
...args,
|
|
2580
|
+
(err, res) => err != null ? reject(err) : resolve(res)
|
|
2581
|
+
);
|
|
2570
2582
|
});
|
|
2571
2583
|
}
|
|
2572
2584
|
}, "name", { value: fn.name });
|
|
@@ -2707,19 +2719,24 @@ var require_polyfills = __commonJS({
|
|
|
2707
2719
|
}(fs6.readSync);
|
|
2708
2720
|
function patchLchmod(fs7) {
|
|
2709
2721
|
fs7.lchmod = function(path10, mode, callback) {
|
|
2710
|
-
fs7.open(
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
fs7.fchmod(fd, mode, function(err2) {
|
|
2717
|
-
fs7.close(fd, function(err22) {
|
|
2722
|
+
fs7.open(
|
|
2723
|
+
path10,
|
|
2724
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
2725
|
+
mode,
|
|
2726
|
+
function(err, fd) {
|
|
2727
|
+
if (err) {
|
|
2718
2728
|
if (callback)
|
|
2719
|
-
callback(
|
|
2729
|
+
callback(err);
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
fs7.fchmod(fd, mode, function(err2) {
|
|
2733
|
+
fs7.close(fd, function(err22) {
|
|
2734
|
+
if (callback)
|
|
2735
|
+
callback(err2 || err22);
|
|
2736
|
+
});
|
|
2720
2737
|
});
|
|
2721
|
-
}
|
|
2722
|
-
|
|
2738
|
+
}
|
|
2739
|
+
);
|
|
2723
2740
|
};
|
|
2724
2741
|
fs7.lchmodSync = function(path10, mode) {
|
|
2725
2742
|
var fd = fs7.openSync(path10, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
@@ -2914,12 +2931,12 @@ var require_legacy_streams = __commonJS({
|
|
|
2914
2931
|
if (this.encoding)
|
|
2915
2932
|
this.setEncoding(this.encoding);
|
|
2916
2933
|
if (this.start !== void 0) {
|
|
2917
|
-
if (typeof this.start
|
|
2934
|
+
if ("number" !== typeof this.start) {
|
|
2918
2935
|
throw TypeError("start must be a Number");
|
|
2919
2936
|
}
|
|
2920
2937
|
if (this.end === void 0) {
|
|
2921
2938
|
this.end = Infinity;
|
|
2922
|
-
} else if (typeof this.end
|
|
2939
|
+
} else if ("number" !== typeof this.end) {
|
|
2923
2940
|
throw TypeError("end must be a Number");
|
|
2924
2941
|
}
|
|
2925
2942
|
if (this.start > this.end) {
|
|
@@ -2962,7 +2979,7 @@ var require_legacy_streams = __commonJS({
|
|
|
2962
2979
|
this[key] = options[key];
|
|
2963
2980
|
}
|
|
2964
2981
|
if (this.start !== void 0) {
|
|
2965
|
-
if (typeof this.start
|
|
2982
|
+
if ("number" !== typeof this.start) {
|
|
2966
2983
|
throw TypeError("start must be a Number");
|
|
2967
2984
|
}
|
|
2968
2985
|
if (this.start < 0) {
|
|
@@ -3399,7 +3416,11 @@ var require_fs = __commonJS({
|
|
|
3399
3416
|
if (typeof fs6.realpath.native === "function") {
|
|
3400
3417
|
exports.realpath.native = u(fs6.realpath.native);
|
|
3401
3418
|
} else {
|
|
3402
|
-
process.emitWarning(
|
|
3419
|
+
process.emitWarning(
|
|
3420
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
3421
|
+
"Warning",
|
|
3422
|
+
"fs-extra-WARN0003"
|
|
3423
|
+
);
|
|
3403
3424
|
}
|
|
3404
3425
|
}
|
|
3405
3426
|
});
|
|
@@ -3675,7 +3696,11 @@ var require_copy = __commonJS({
|
|
|
3675
3696
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
3676
3697
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
3677
3698
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
3678
|
-
process.emitWarning(
|
|
3699
|
+
process.emitWarning(
|
|
3700
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
3701
|
+
"Warning",
|
|
3702
|
+
"fs-extra-WARN0001"
|
|
3703
|
+
);
|
|
3679
3704
|
}
|
|
3680
3705
|
stat.checkPaths(src, dest, "copy", opts, (err, stats) => {
|
|
3681
3706
|
if (err)
|
|
@@ -3894,7 +3919,11 @@ var require_copy_sync = __commonJS({
|
|
|
3894
3919
|
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
3895
3920
|
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
3896
3921
|
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
3897
|
-
process.emitWarning(
|
|
3922
|
+
process.emitWarning(
|
|
3923
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
3924
|
+
"Warning",
|
|
3925
|
+
"fs-extra-WARN0002"
|
|
3926
|
+
);
|
|
3898
3927
|
}
|
|
3899
3928
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
3900
3929
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
@@ -4711,7 +4740,10 @@ var require_universalify2 = __commonJS({
|
|
|
4711
4740
|
fn.apply(this, args);
|
|
4712
4741
|
else {
|
|
4713
4742
|
return new Promise((resolve, reject) => {
|
|
4714
|
-
fn.apply(
|
|
4743
|
+
fn.apply(
|
|
4744
|
+
this,
|
|
4745
|
+
args.concat([(err, res) => err ? reject(err) : resolve(res)])
|
|
4746
|
+
);
|
|
4715
4747
|
});
|
|
4716
4748
|
}
|
|
4717
4749
|
}, "name", { value: fn.name });
|
|
@@ -5415,7 +5447,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
5415
5447
|
diffs = [
|
|
5416
5448
|
new diff_match_patch2.Diff(DIFF_INSERT, longtext.substring(0, i)),
|
|
5417
5449
|
new diff_match_patch2.Diff(DIFF_EQUAL, shorttext),
|
|
5418
|
-
new diff_match_patch2.Diff(
|
|
5450
|
+
new diff_match_patch2.Diff(
|
|
5451
|
+
DIFF_INSERT,
|
|
5452
|
+
longtext.substring(i + shorttext.length)
|
|
5453
|
+
)
|
|
5419
5454
|
];
|
|
5420
5455
|
if (text1.length > text2.length) {
|
|
5421
5456
|
diffs[0][0] = diffs[2][0] = DIFF_DELETE;
|
|
@@ -5437,7 +5472,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
5437
5472
|
var mid_common = hm[4];
|
|
5438
5473
|
var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);
|
|
5439
5474
|
var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);
|
|
5440
|
-
return diffs_a.concat(
|
|
5475
|
+
return diffs_a.concat(
|
|
5476
|
+
[new diff_match_patch2.Diff(DIFF_EQUAL, mid_common)],
|
|
5477
|
+
diffs_b
|
|
5478
|
+
);
|
|
5441
5479
|
}
|
|
5442
5480
|
if (checklines && text1.length > 100 && text2.length > 100) {
|
|
5443
5481
|
return this.diff_lineMode_(text1, text2, deadline);
|
|
@@ -5470,7 +5508,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
5470
5508
|
break;
|
|
5471
5509
|
case DIFF_EQUAL:
|
|
5472
5510
|
if (count_delete >= 1 && count_insert >= 1) {
|
|
5473
|
-
diffs.splice(
|
|
5511
|
+
diffs.splice(
|
|
5512
|
+
pointer - count_delete - count_insert,
|
|
5513
|
+
count_delete + count_insert
|
|
5514
|
+
);
|
|
5474
5515
|
pointer = pointer - count_delete - count_insert;
|
|
5475
5516
|
var subDiff = this.diff_main(text_delete, text_insert, false, deadline);
|
|
5476
5517
|
for (var j = subDiff.length - 1; j >= 0; j--) {
|
|
@@ -5716,8 +5757,14 @@ var require_diff_match_patch = __commonJS({
|
|
|
5716
5757
|
var best_common = "";
|
|
5717
5758
|
var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
|
|
5718
5759
|
while ((j = shorttext2.indexOf(seed, j + 1)) != -1) {
|
|
5719
|
-
var prefixLength = dmp.diff_commonPrefix(
|
|
5720
|
-
|
|
5760
|
+
var prefixLength = dmp.diff_commonPrefix(
|
|
5761
|
+
longtext2.substring(i),
|
|
5762
|
+
shorttext2.substring(j)
|
|
5763
|
+
);
|
|
5764
|
+
var suffixLength = dmp.diff_commonSuffix(
|
|
5765
|
+
longtext2.substring(0, i),
|
|
5766
|
+
shorttext2.substring(0, j)
|
|
5767
|
+
);
|
|
5721
5768
|
if (best_common.length < suffixLength + prefixLength) {
|
|
5722
5769
|
best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
|
|
5723
5770
|
best_longtext_a = longtext2.substring(0, i - suffixLength);
|
|
@@ -5738,8 +5785,16 @@ var require_diff_match_patch = __commonJS({
|
|
|
5738
5785
|
return null;
|
|
5739
5786
|
}
|
|
5740
5787
|
}
|
|
5741
|
-
var hm1 = diff_halfMatchI_(
|
|
5742
|
-
|
|
5788
|
+
var hm1 = diff_halfMatchI_(
|
|
5789
|
+
longtext,
|
|
5790
|
+
shorttext,
|
|
5791
|
+
Math.ceil(longtext.length / 4)
|
|
5792
|
+
);
|
|
5793
|
+
var hm2 = diff_halfMatchI_(
|
|
5794
|
+
longtext,
|
|
5795
|
+
shorttext,
|
|
5796
|
+
Math.ceil(longtext.length / 2)
|
|
5797
|
+
);
|
|
5743
5798
|
var hm;
|
|
5744
5799
|
if (!hm1 && !hm2) {
|
|
5745
5800
|
return null;
|
|
@@ -5789,8 +5844,15 @@ var require_diff_match_patch = __commonJS({
|
|
|
5789
5844
|
} else {
|
|
5790
5845
|
length_deletions2 += diffs[pointer][1].length;
|
|
5791
5846
|
}
|
|
5792
|
-
if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(
|
|
5793
|
-
|
|
5847
|
+
if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(
|
|
5848
|
+
length_insertions2,
|
|
5849
|
+
length_deletions2
|
|
5850
|
+
)) {
|
|
5851
|
+
diffs.splice(
|
|
5852
|
+
equalities[equalitiesLength - 1],
|
|
5853
|
+
0,
|
|
5854
|
+
new diff_match_patch2.Diff(DIFF_DELETE, lastEquality)
|
|
5855
|
+
);
|
|
5794
5856
|
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
5795
5857
|
equalitiesLength--;
|
|
5796
5858
|
equalitiesLength--;
|
|
@@ -5818,14 +5880,20 @@ var require_diff_match_patch = __commonJS({
|
|
|
5818
5880
|
var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);
|
|
5819
5881
|
if (overlap_length1 >= overlap_length2) {
|
|
5820
5882
|
if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
|
|
5821
|
-
diffs.splice(pointer, 0, new diff_match_patch2.Diff(
|
|
5883
|
+
diffs.splice(pointer, 0, new diff_match_patch2.Diff(
|
|
5884
|
+
DIFF_EQUAL,
|
|
5885
|
+
insertion.substring(0, overlap_length1)
|
|
5886
|
+
));
|
|
5822
5887
|
diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
|
|
5823
5888
|
diffs[pointer + 1][1] = insertion.substring(overlap_length1);
|
|
5824
5889
|
pointer++;
|
|
5825
5890
|
}
|
|
5826
5891
|
} else {
|
|
5827
5892
|
if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
|
|
5828
|
-
diffs.splice(pointer, 0, new diff_match_patch2.Diff(
|
|
5893
|
+
diffs.splice(pointer, 0, new diff_match_patch2.Diff(
|
|
5894
|
+
DIFF_EQUAL,
|
|
5895
|
+
deletion.substring(0, overlap_length2)
|
|
5896
|
+
));
|
|
5829
5897
|
diffs[pointer - 1][0] = DIFF_INSERT;
|
|
5830
5898
|
diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
|
|
5831
5899
|
diffs[pointer + 1][0] = DIFF_DELETE;
|
|
@@ -5948,7 +6016,11 @@ var require_diff_match_patch = __commonJS({
|
|
|
5948
6016
|
post_ins = true;
|
|
5949
6017
|
}
|
|
5950
6018
|
if (lastEquality && (pre_ins && pre_del && post_ins && post_del || lastEquality.length < this.Diff_EditCost / 2 && pre_ins + pre_del + post_ins + post_del == 3)) {
|
|
5951
|
-
diffs.splice(
|
|
6019
|
+
diffs.splice(
|
|
6020
|
+
equalities[equalitiesLength - 1],
|
|
6021
|
+
0,
|
|
6022
|
+
new diff_match_patch2.Diff(DIFF_DELETE, lastEquality)
|
|
6023
|
+
);
|
|
5952
6024
|
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
5953
6025
|
equalitiesLength--;
|
|
5954
6026
|
lastEquality = null;
|
|
@@ -5997,7 +6069,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
5997
6069
|
if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
|
|
5998
6070
|
diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
|
|
5999
6071
|
} else {
|
|
6000
|
-
diffs.splice(0, 0, new diff_match_patch2.Diff(
|
|
6072
|
+
diffs.splice(0, 0, new diff_match_patch2.Diff(
|
|
6073
|
+
DIFF_EQUAL,
|
|
6074
|
+
text_insert.substring(0, commonlength)
|
|
6075
|
+
));
|
|
6001
6076
|
pointer++;
|
|
6002
6077
|
}
|
|
6003
6078
|
text_insert = text_insert.substring(commonlength);
|
|
@@ -6013,11 +6088,19 @@ var require_diff_match_patch = __commonJS({
|
|
|
6013
6088
|
pointer -= count_delete + count_insert;
|
|
6014
6089
|
diffs.splice(pointer, count_delete + count_insert);
|
|
6015
6090
|
if (text_delete.length) {
|
|
6016
|
-
diffs.splice(
|
|
6091
|
+
diffs.splice(
|
|
6092
|
+
pointer,
|
|
6093
|
+
0,
|
|
6094
|
+
new diff_match_patch2.Diff(DIFF_DELETE, text_delete)
|
|
6095
|
+
);
|
|
6017
6096
|
pointer++;
|
|
6018
6097
|
}
|
|
6019
6098
|
if (text_insert.length) {
|
|
6020
|
-
diffs.splice(
|
|
6099
|
+
diffs.splice(
|
|
6100
|
+
pointer,
|
|
6101
|
+
0,
|
|
6102
|
+
new diff_match_patch2.Diff(DIFF_INSERT, text_insert)
|
|
6103
|
+
);
|
|
6021
6104
|
pointer++;
|
|
6022
6105
|
}
|
|
6023
6106
|
pointer++;
|
|
@@ -6312,14 +6395,20 @@ var require_diff_match_patch = __commonJS({
|
|
|
6312
6395
|
var padding = 0;
|
|
6313
6396
|
while (text.indexOf(pattern) != text.lastIndexOf(pattern) && pattern.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin) {
|
|
6314
6397
|
padding += this.Patch_Margin;
|
|
6315
|
-
pattern = text.substring(
|
|
6398
|
+
pattern = text.substring(
|
|
6399
|
+
patch.start2 - padding,
|
|
6400
|
+
patch.start2 + patch.length1 + padding
|
|
6401
|
+
);
|
|
6316
6402
|
}
|
|
6317
6403
|
padding += this.Patch_Margin;
|
|
6318
6404
|
var prefix = text.substring(patch.start2 - padding, patch.start2);
|
|
6319
6405
|
if (prefix) {
|
|
6320
6406
|
patch.diffs.unshift(new diff_match_patch2.Diff(DIFF_EQUAL, prefix));
|
|
6321
6407
|
}
|
|
6322
|
-
var suffix = text.substring(
|
|
6408
|
+
var suffix = text.substring(
|
|
6409
|
+
patch.start2 + patch.length1,
|
|
6410
|
+
patch.start2 + patch.length1 + padding
|
|
6411
|
+
);
|
|
6323
6412
|
if (suffix) {
|
|
6324
6413
|
patch.diffs.push(new diff_match_patch2.Diff(DIFF_EQUAL, suffix));
|
|
6325
6414
|
}
|
|
@@ -6440,9 +6529,17 @@ var require_diff_match_patch = __commonJS({
|
|
|
6440
6529
|
var start_loc;
|
|
6441
6530
|
var end_loc = -1;
|
|
6442
6531
|
if (text1.length > this.Match_MaxBits) {
|
|
6443
|
-
start_loc = this.match_main(
|
|
6532
|
+
start_loc = this.match_main(
|
|
6533
|
+
text,
|
|
6534
|
+
text1.substring(0, this.Match_MaxBits),
|
|
6535
|
+
expected_loc
|
|
6536
|
+
);
|
|
6444
6537
|
if (start_loc != -1) {
|
|
6445
|
-
end_loc = this.match_main(
|
|
6538
|
+
end_loc = this.match_main(
|
|
6539
|
+
text,
|
|
6540
|
+
text1.substring(text1.length - this.Match_MaxBits),
|
|
6541
|
+
expected_loc + text1.length - this.Match_MaxBits
|
|
6542
|
+
);
|
|
6446
6543
|
if (end_loc == -1 || start_loc >= end_loc) {
|
|
6447
6544
|
start_loc = -1;
|
|
6448
6545
|
}
|
|
@@ -6480,7 +6577,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
6480
6577
|
if (mod[0] === DIFF_INSERT) {
|
|
6481
6578
|
text = text.substring(0, start_loc + index2) + mod[1] + text.substring(start_loc + index2);
|
|
6482
6579
|
} else if (mod[0] === DIFF_DELETE) {
|
|
6483
|
-
text = text.substring(0, start_loc + index2) + text.substring(start_loc + this.diff_xIndex(
|
|
6580
|
+
text = text.substring(0, start_loc + index2) + text.substring(start_loc + this.diff_xIndex(
|
|
6581
|
+
diffs,
|
|
6582
|
+
index1 + mod[1].length
|
|
6583
|
+
));
|
|
6484
6584
|
}
|
|
6485
6585
|
if (mod[0] !== DIFF_DELETE) {
|
|
6486
6586
|
index1 += mod[1].length;
|
|
@@ -6568,7 +6668,10 @@ var require_diff_match_patch = __commonJS({
|
|
|
6568
6668
|
patch.diffs.push(new diff_match_patch2.Diff(diff_type, diff_text));
|
|
6569
6669
|
bigpatch.diffs.shift();
|
|
6570
6670
|
} else {
|
|
6571
|
-
diff_text = diff_text.substring(
|
|
6671
|
+
diff_text = diff_text.substring(
|
|
6672
|
+
0,
|
|
6673
|
+
patch_size - patch.length1 - this.Patch_Margin
|
|
6674
|
+
);
|
|
6572
6675
|
patch.length1 += diff_text.length;
|
|
6573
6676
|
start1 += diff_text.length;
|
|
6574
6677
|
if (diff_type === DIFF_EQUAL) {
|
|
@@ -16311,7 +16414,7 @@ var require_connect = __commonJS({
|
|
|
16311
16414
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16312
16415
|
exports.connect = void 0;
|
|
16313
16416
|
var Subject_1 = require_Subject();
|
|
16314
|
-
var
|
|
16417
|
+
var innerFrom_1 = require_innerFrom();
|
|
16315
16418
|
var lift_1 = require_lift();
|
|
16316
16419
|
var fromSubscribable_1 = require_fromSubscribable();
|
|
16317
16420
|
var DEFAULT_CONFIG = {
|
|
@@ -16326,7 +16429,7 @@ var require_connect = __commonJS({
|
|
|
16326
16429
|
var connector = config.connector;
|
|
16327
16430
|
return lift_1.operate(function(source, subscriber) {
|
|
16328
16431
|
var subject = connector();
|
|
16329
|
-
|
|
16432
|
+
innerFrom_1.innerFrom(selector(fromSubscribable_1.fromSubscribable(subject))).subscribe(subscriber);
|
|
16330
16433
|
subscriber.add(source.subscribe(subject));
|
|
16331
16434
|
});
|
|
16332
16435
|
}
|
|
@@ -16812,47 +16915,6 @@ var require_every = __commonJS({
|
|
|
16812
16915
|
}
|
|
16813
16916
|
});
|
|
16814
16917
|
|
|
16815
|
-
// node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js
|
|
16816
|
-
var require_exhaustAll = __commonJS({
|
|
16817
|
-
"node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(exports) {
|
|
16818
|
-
"use strict";
|
|
16819
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16820
|
-
exports.exhaustAll = void 0;
|
|
16821
|
-
var lift_1 = require_lift();
|
|
16822
|
-
var innerFrom_1 = require_innerFrom();
|
|
16823
|
-
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
16824
|
-
function exhaustAll() {
|
|
16825
|
-
return lift_1.operate(function(source, subscriber) {
|
|
16826
|
-
var isComplete = false;
|
|
16827
|
-
var innerSub = null;
|
|
16828
|
-
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(inner) {
|
|
16829
|
-
if (!innerSub) {
|
|
16830
|
-
innerSub = innerFrom_1.innerFrom(inner).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, void 0, function() {
|
|
16831
|
-
innerSub = null;
|
|
16832
|
-
isComplete && subscriber.complete();
|
|
16833
|
-
}));
|
|
16834
|
-
}
|
|
16835
|
-
}, function() {
|
|
16836
|
-
isComplete = true;
|
|
16837
|
-
!innerSub && subscriber.complete();
|
|
16838
|
-
}));
|
|
16839
|
-
});
|
|
16840
|
-
}
|
|
16841
|
-
exports.exhaustAll = exhaustAll;
|
|
16842
|
-
}
|
|
16843
|
-
});
|
|
16844
|
-
|
|
16845
|
-
// node_modules/rxjs/dist/cjs/internal/operators/exhaust.js
|
|
16846
|
-
var require_exhaust = __commonJS({
|
|
16847
|
-
"node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(exports) {
|
|
16848
|
-
"use strict";
|
|
16849
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16850
|
-
exports.exhaust = void 0;
|
|
16851
|
-
var exhaustAll_1 = require_exhaustAll();
|
|
16852
|
-
exports.exhaust = exhaustAll_1.exhaustAll;
|
|
16853
|
-
}
|
|
16854
|
-
});
|
|
16855
|
-
|
|
16856
16918
|
// node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js
|
|
16857
16919
|
var require_exhaustMap = __commonJS({
|
|
16858
16920
|
"node_modules/rxjs/dist/cjs/internal/operators/exhaustMap.js"(exports) {
|
|
@@ -16895,6 +16957,32 @@ var require_exhaustMap = __commonJS({
|
|
|
16895
16957
|
}
|
|
16896
16958
|
});
|
|
16897
16959
|
|
|
16960
|
+
// node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js
|
|
16961
|
+
var require_exhaustAll = __commonJS({
|
|
16962
|
+
"node_modules/rxjs/dist/cjs/internal/operators/exhaustAll.js"(exports) {
|
|
16963
|
+
"use strict";
|
|
16964
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16965
|
+
exports.exhaustAll = void 0;
|
|
16966
|
+
var exhaustMap_1 = require_exhaustMap();
|
|
16967
|
+
var identity_1 = require_identity();
|
|
16968
|
+
function exhaustAll() {
|
|
16969
|
+
return exhaustMap_1.exhaustMap(identity_1.identity);
|
|
16970
|
+
}
|
|
16971
|
+
exports.exhaustAll = exhaustAll;
|
|
16972
|
+
}
|
|
16973
|
+
});
|
|
16974
|
+
|
|
16975
|
+
// node_modules/rxjs/dist/cjs/internal/operators/exhaust.js
|
|
16976
|
+
var require_exhaust = __commonJS({
|
|
16977
|
+
"node_modules/rxjs/dist/cjs/internal/operators/exhaust.js"(exports) {
|
|
16978
|
+
"use strict";
|
|
16979
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16980
|
+
exports.exhaust = void 0;
|
|
16981
|
+
var exhaustAll_1 = require_exhaustAll();
|
|
16982
|
+
exports.exhaust = exhaustAll_1.exhaustAll;
|
|
16983
|
+
}
|
|
16984
|
+
});
|
|
16985
|
+
|
|
16898
16986
|
// node_modules/rxjs/dist/cjs/internal/operators/expand.js
|
|
16899
16987
|
var require_expand = __commonJS({
|
|
16900
16988
|
"node_modules/rxjs/dist/cjs/internal/operators/expand.js"(exports) {
|
|
@@ -18021,8 +18109,7 @@ var require_share = __commonJS({
|
|
|
18021
18109
|
};
|
|
18022
18110
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18023
18111
|
exports.share = void 0;
|
|
18024
|
-
var
|
|
18025
|
-
var take_1 = require_take();
|
|
18112
|
+
var innerFrom_1 = require_innerFrom();
|
|
18026
18113
|
var Subject_1 = require_Subject();
|
|
18027
18114
|
var Subscriber_1 = require_Subscriber();
|
|
18028
18115
|
var lift_1 = require_lift();
|
|
@@ -18034,19 +18121,19 @@ var require_share = __commonJS({
|
|
|
18034
18121
|
return new Subject_1.Subject();
|
|
18035
18122
|
} : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;
|
|
18036
18123
|
return function(wrapperSource) {
|
|
18037
|
-
var connection
|
|
18038
|
-
var resetConnection
|
|
18039
|
-
var subject
|
|
18124
|
+
var connection;
|
|
18125
|
+
var resetConnection;
|
|
18126
|
+
var subject;
|
|
18040
18127
|
var refCount = 0;
|
|
18041
18128
|
var hasCompleted = false;
|
|
18042
18129
|
var hasErrored = false;
|
|
18043
18130
|
var cancelReset = function() {
|
|
18044
18131
|
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
18045
|
-
resetConnection =
|
|
18132
|
+
resetConnection = void 0;
|
|
18046
18133
|
};
|
|
18047
18134
|
var reset = function() {
|
|
18048
18135
|
cancelReset();
|
|
18049
|
-
connection = subject =
|
|
18136
|
+
connection = subject = void 0;
|
|
18050
18137
|
hasCompleted = hasErrored = false;
|
|
18051
18138
|
};
|
|
18052
18139
|
var resetAndUnsubscribe = function() {
|
|
@@ -18067,7 +18154,7 @@ var require_share = __commonJS({
|
|
|
18067
18154
|
}
|
|
18068
18155
|
});
|
|
18069
18156
|
dest.subscribe(subscriber);
|
|
18070
|
-
if (!connection) {
|
|
18157
|
+
if (!connection && refCount > 0) {
|
|
18071
18158
|
connection = new Subscriber_1.SafeSubscriber({
|
|
18072
18159
|
next: function(value) {
|
|
18073
18160
|
return dest.next(value);
|
|
@@ -18085,7 +18172,7 @@ var require_share = __commonJS({
|
|
|
18085
18172
|
dest.complete();
|
|
18086
18173
|
}
|
|
18087
18174
|
});
|
|
18088
|
-
|
|
18175
|
+
innerFrom_1.innerFrom(source).subscribe(connection);
|
|
18089
18176
|
}
|
|
18090
18177
|
})(wrapperSource);
|
|
18091
18178
|
};
|
|
@@ -18098,14 +18185,18 @@ var require_share = __commonJS({
|
|
|
18098
18185
|
}
|
|
18099
18186
|
if (on === true) {
|
|
18100
18187
|
reset();
|
|
18101
|
-
return
|
|
18188
|
+
return;
|
|
18102
18189
|
}
|
|
18103
18190
|
if (on === false) {
|
|
18104
|
-
return
|
|
18191
|
+
return;
|
|
18105
18192
|
}
|
|
18106
|
-
|
|
18107
|
-
|
|
18193
|
+
var onSubscriber = new Subscriber_1.SafeSubscriber({
|
|
18194
|
+
next: function() {
|
|
18195
|
+
onSubscriber.unsubscribe();
|
|
18196
|
+
reset();
|
|
18197
|
+
}
|
|
18108
18198
|
});
|
|
18199
|
+
return on.apply(void 0, __spreadArray([], __read(args))).subscribe(onSubscriber);
|
|
18109
18200
|
}
|
|
18110
18201
|
}
|
|
18111
18202
|
});
|
|
@@ -20746,7 +20837,10 @@ var require_minimatch = __commonJS({
|
|
|
20746
20837
|
};
|
|
20747
20838
|
Minimatch2.prototype.matchOne = function(file, pattern, partial) {
|
|
20748
20839
|
var options = this.options;
|
|
20749
|
-
this.debug(
|
|
20840
|
+
this.debug(
|
|
20841
|
+
"matchOne",
|
|
20842
|
+
{ "this": this, file, pattern }
|
|
20843
|
+
);
|
|
20750
20844
|
this.debug("matchOne", file.length, pattern.length);
|
|
20751
20845
|
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
20752
20846
|
this.debug("matchOne loop");
|
|
@@ -21394,12 +21488,14 @@ var _PythonSettings = class {
|
|
|
21394
21488
|
return import_path.default.isAbsolute(pathToCheck) ? pathToCheck : import_path.default.resolve(rootDir, pathToCheck);
|
|
21395
21489
|
}
|
|
21396
21490
|
initialize() {
|
|
21397
|
-
this.disposables.push(
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21491
|
+
this.disposables.push(
|
|
21492
|
+
import_coc2.workspace.onDidChangeConfiguration((event) => {
|
|
21493
|
+
if (event.affectsConfiguration("python")) {
|
|
21494
|
+
const currentConfig = import_coc2.workspace.getConfiguration("python", import_coc2.workspace.root);
|
|
21495
|
+
this.update(currentConfig);
|
|
21496
|
+
}
|
|
21497
|
+
})
|
|
21498
|
+
);
|
|
21403
21499
|
const initialConfig = import_coc2.workspace.getConfiguration("python", import_coc2.workspace.root);
|
|
21404
21500
|
if (initialConfig) {
|
|
21405
21501
|
this.update(initialConfig);
|
|
@@ -23213,17 +23309,20 @@ var RefactorProxy = class {
|
|
|
23213
23309
|
const pythonToolsExecutionService = new PythonExecutionService();
|
|
23214
23310
|
const result = pythonToolsExecutionService.execObservable(args, { cwd });
|
|
23215
23311
|
this._process = result.proc;
|
|
23216
|
-
result.out.subscribe(
|
|
23217
|
-
|
|
23218
|
-
if (
|
|
23219
|
-
this._startedSuccessfully
|
|
23220
|
-
|
|
23312
|
+
result.out.subscribe(
|
|
23313
|
+
(output) => {
|
|
23314
|
+
if (output.source === "stdout") {
|
|
23315
|
+
if (!this._startedSuccessfully && output.out.startsWith("STARTED")) {
|
|
23316
|
+
this._startedSuccessfully = true;
|
|
23317
|
+
return this.initialized.resolve();
|
|
23318
|
+
}
|
|
23319
|
+
this.onData(output.out);
|
|
23320
|
+
} else {
|
|
23321
|
+
this.handleStdError(output.out);
|
|
23221
23322
|
}
|
|
23222
|
-
|
|
23223
|
-
|
|
23224
|
-
|
|
23225
|
-
}
|
|
23226
|
-
}, (error) => this.handleError(error));
|
|
23323
|
+
},
|
|
23324
|
+
(error) => this.handleError(error)
|
|
23325
|
+
);
|
|
23227
23326
|
return this.initialized.promise;
|
|
23228
23327
|
}
|
|
23229
23328
|
handleStdError(data) {
|
|
@@ -23551,7 +23650,10 @@ async function provideHover(document, position, token, next) {
|
|
|
23551
23650
|
return hover;
|
|
23552
23651
|
}
|
|
23553
23652
|
async function handleDiagnostics(uri, diagnostics, next) {
|
|
23554
|
-
next(
|
|
23653
|
+
next(
|
|
23654
|
+
uri,
|
|
23655
|
+
diagnostics.filter((d) => d.message !== '"__" is not accessed')
|
|
23656
|
+
);
|
|
23555
23657
|
}
|
|
23556
23658
|
async function activate(context) {
|
|
23557
23659
|
const pyrightCfg = import_coc24.workspace.getConfiguration("pyright");
|
|
@@ -23590,6 +23692,9 @@ async function activate(context) {
|
|
|
23590
23692
|
if (pyrightCfg.get("disableDiagnostics")) {
|
|
23591
23693
|
disabledFeatures.push("diagnostics");
|
|
23592
23694
|
}
|
|
23695
|
+
if (pyrightCfg.get("disableDocumentation")) {
|
|
23696
|
+
disabledFeatures.push("hover");
|
|
23697
|
+
}
|
|
23593
23698
|
const disableProgress = pyrightCfg.get("disableProgressNotifications");
|
|
23594
23699
|
if (disableProgress)
|
|
23595
23700
|
disabledFeatures.push("progress");
|
|
@@ -23632,14 +23737,16 @@ async function activate(context) {
|
|
|
23632
23737
|
}
|
|
23633
23738
|
const textEditorCommands = ["pyright.organizeimports", "pyright.addoptionalforparam"];
|
|
23634
23739
|
textEditorCommands.forEach((commandName) => {
|
|
23635
|
-
context.subscriptions.push(
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
|
|
23641
|
-
|
|
23642
|
-
|
|
23740
|
+
context.subscriptions.push(
|
|
23741
|
+
import_coc24.commands.registerCommand(commandName, async (offset) => {
|
|
23742
|
+
const doc = await import_coc24.workspace.document;
|
|
23743
|
+
const cmd = {
|
|
23744
|
+
command: commandName,
|
|
23745
|
+
arguments: [doc.uri.toString(), offset]
|
|
23746
|
+
};
|
|
23747
|
+
await client.sendRequest(method, cmd);
|
|
23748
|
+
})
|
|
23749
|
+
);
|
|
23643
23750
|
});
|
|
23644
23751
|
let command = "pyright.restartserver";
|
|
23645
23752
|
let disposable = import_coc24.commands.registerCommand(command, async () => {
|
|
@@ -23665,20 +23772,35 @@ async function activate(context) {
|
|
|
23665
23772
|
await client.sendRequest(method, cmd);
|
|
23666
23773
|
});
|
|
23667
23774
|
context.subscriptions.push(disposable);
|
|
23668
|
-
disposable = import_coc24.commands.registerCommand(
|
|
23669
|
-
|
|
23670
|
-
|
|
23671
|
-
|
|
23775
|
+
disposable = import_coc24.commands.registerCommand(
|
|
23776
|
+
"python.refactorExtractVariable",
|
|
23777
|
+
async (document, range) => {
|
|
23778
|
+
await extractVariable(context.extensionPath, document, range, outputChannel).catch(() => {
|
|
23779
|
+
});
|
|
23780
|
+
},
|
|
23781
|
+
null,
|
|
23782
|
+
true
|
|
23783
|
+
);
|
|
23672
23784
|
context.subscriptions.push(disposable);
|
|
23673
|
-
disposable = import_coc24.commands.registerCommand(
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23785
|
+
disposable = import_coc24.commands.registerCommand(
|
|
23786
|
+
"python.refactorExtractMethod",
|
|
23787
|
+
async (document, range) => {
|
|
23788
|
+
await extractMethod(context.extensionPath, document, range, outputChannel).catch(() => {
|
|
23789
|
+
});
|
|
23790
|
+
},
|
|
23791
|
+
null,
|
|
23792
|
+
true
|
|
23793
|
+
);
|
|
23677
23794
|
context.subscriptions.push(disposable);
|
|
23678
|
-
disposable = import_coc24.commands.registerCommand(
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23795
|
+
disposable = import_coc24.commands.registerCommand(
|
|
23796
|
+
"pyright.addImport",
|
|
23797
|
+
async (document, name, parent) => {
|
|
23798
|
+
await addImport(context.extensionPath, document, name, parent, outputChannel).catch(() => {
|
|
23799
|
+
});
|
|
23800
|
+
},
|
|
23801
|
+
null,
|
|
23802
|
+
true
|
|
23803
|
+
);
|
|
23682
23804
|
context.subscriptions.push(disposable);
|
|
23683
23805
|
disposable = import_coc24.commands.registerCommand("python.sortImports", async () => {
|
|
23684
23806
|
await sortImports(context.extensionPath, outputChannel).catch(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-pyright",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.266",
|
|
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",
|
|
@@ -667,6 +667,17 @@
|
|
|
667
667
|
"error"
|
|
668
668
|
]
|
|
669
669
|
},
|
|
670
|
+
"reportUnnecessaryContains": {
|
|
671
|
+
"type": "string",
|
|
672
|
+
"description": "Diagnostics for 'in' operation that is statically determined to be unnecessary. Such operations are sometimes indicative of a programming error.",
|
|
673
|
+
"default": "none",
|
|
674
|
+
"enum": [
|
|
675
|
+
"none",
|
|
676
|
+
"information",
|
|
677
|
+
"warning",
|
|
678
|
+
"error"
|
|
679
|
+
]
|
|
680
|
+
},
|
|
670
681
|
"reportAssertAlwaysTrue": {
|
|
671
682
|
"type": "string",
|
|
672
683
|
"description": "Diagnostics for 'assert' statement that will provably always assert. This can be indicative of a programming error.",
|
|
@@ -1338,6 +1349,11 @@
|
|
|
1338
1349
|
"default": false,
|
|
1339
1350
|
"description": "Disable diagnostics from Pyright"
|
|
1340
1351
|
},
|
|
1352
|
+
"pyright.disableDocumentation": {
|
|
1353
|
+
"type": "boolean",
|
|
1354
|
+
"default": false,
|
|
1355
|
+
"description": "Disable hover documentation from Pyright"
|
|
1356
|
+
},
|
|
1341
1357
|
"pyright.disableProgressNotifications": {
|
|
1342
1358
|
"type": "boolean",
|
|
1343
1359
|
"default": false,
|
|
@@ -1419,6 +1435,6 @@
|
|
|
1419
1435
|
]
|
|
1420
1436
|
},
|
|
1421
1437
|
"dependencies": {
|
|
1422
|
-
"pyright": "^1.1.
|
|
1438
|
+
"pyright": "^1.1.266"
|
|
1423
1439
|
}
|
|
1424
1440
|
}
|
|
@@ -424,6 +424,12 @@
|
|
|
424
424
|
"title": "Controls reporting the use of '==' or '!=' comparisons that are unnecessary",
|
|
425
425
|
"default": "none"
|
|
426
426
|
},
|
|
427
|
+
"reportUnnecessaryContains": {
|
|
428
|
+
"$id": "#/properties/reportUnnecessaryContains",
|
|
429
|
+
"$ref": "#/definitions/diagnostic",
|
|
430
|
+
"title": "Controls reporting the use of 'in' operations that are unnecessary",
|
|
431
|
+
"default": "none"
|
|
432
|
+
},
|
|
427
433
|
"reportAssertAlwaysTrue": {
|
|
428
434
|
"$id": "#/properties/reportAssertAlwaysTrue",
|
|
429
435
|
"$ref": "#/definitions/diagnostic",
|