coc-pyright 1.1.232 → 1.1.235

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 +74 -68
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
24
  var __commonJS = (cb, mod) => function __require() {
26
25
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
27
26
  };
@@ -29,22 +28,16 @@ var __export = (target, all) => {
29
28
  for (var name in all)
30
29
  __defProp(target, name, { get: all[name], enumerable: true });
31
30
  };
32
- var __reExport = (target, module2, copyDefault, desc) => {
33
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
34
- for (let key of __getOwnPropNames(module2))
35
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
36
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
31
+ var __copyProps = (to, from, except, desc) => {
32
+ if (from && typeof from === "object" || typeof from === "function") {
33
+ for (let key of __getOwnPropNames(from))
34
+ if (!__hasOwnProp.call(to, key) && key !== except)
35
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
37
36
  }
38
- return target;
37
+ return to;
39
38
  };
40
- var __toESM = (module2, isNodeMode) => {
41
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
42
- };
43
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
44
- return (module2, temp) => {
45
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
46
- };
47
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
39
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
40
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
41
 
49
42
  // node_modules/semver/internal/constants.js
50
43
  var require_constants = __commonJS({
@@ -10395,7 +10388,7 @@ var require_Subscription = __commonJS({
10395
10388
  this.initialTeardown = initialTeardown;
10396
10389
  this.closed = false;
10397
10390
  this._parentage = null;
10398
- this._teardowns = null;
10391
+ this._finalizers = null;
10399
10392
  }
10400
10393
  Subscription2.prototype.unsubscribe = function() {
10401
10394
  var e_1, _a, e_2, _b;
@@ -10426,22 +10419,22 @@ var require_Subscription = __commonJS({
10426
10419
  _parentage.remove(this);
10427
10420
  }
10428
10421
  }
10429
- var initialTeardown = this.initialTeardown;
10430
- if (isFunction_1.isFunction(initialTeardown)) {
10422
+ var initialFinalizer = this.initialTeardown;
10423
+ if (isFunction_1.isFunction(initialFinalizer)) {
10431
10424
  try {
10432
- initialTeardown();
10425
+ initialFinalizer();
10433
10426
  } catch (e) {
10434
10427
  errors = e instanceof UnsubscriptionError_1.UnsubscriptionError ? e.errors : [e];
10435
10428
  }
10436
10429
  }
10437
- var _teardowns = this._teardowns;
10438
- if (_teardowns) {
10439
- this._teardowns = null;
10430
+ var _finalizers = this._finalizers;
10431
+ if (_finalizers) {
10432
+ this._finalizers = null;
10440
10433
  try {
10441
- for (var _teardowns_1 = __values(_teardowns), _teardowns_1_1 = _teardowns_1.next(); !_teardowns_1_1.done; _teardowns_1_1 = _teardowns_1.next()) {
10442
- var teardown_1 = _teardowns_1_1.value;
10434
+ for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
10435
+ var finalizer = _finalizers_1_1.value;
10443
10436
  try {
10444
- execTeardown(teardown_1);
10437
+ execFinalizer(finalizer);
10445
10438
  } catch (err) {
10446
10439
  errors = errors !== null && errors !== void 0 ? errors : [];
10447
10440
  if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
@@ -10455,8 +10448,8 @@ var require_Subscription = __commonJS({
10455
10448
  e_2 = { error: e_2_1 };
10456
10449
  } finally {
10457
10450
  try {
10458
- if (_teardowns_1_1 && !_teardowns_1_1.done && (_b = _teardowns_1.return))
10459
- _b.call(_teardowns_1);
10451
+ if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return))
10452
+ _b.call(_finalizers_1);
10460
10453
  } finally {
10461
10454
  if (e_2)
10462
10455
  throw e_2.error;
@@ -10472,7 +10465,7 @@ var require_Subscription = __commonJS({
10472
10465
  var _a;
10473
10466
  if (teardown && teardown !== this) {
10474
10467
  if (this.closed) {
10475
- execTeardown(teardown);
10468
+ execFinalizer(teardown);
10476
10469
  } else {
10477
10470
  if (teardown instanceof Subscription2) {
10478
10471
  if (teardown.closed || teardown._hasParent(this)) {
@@ -10480,7 +10473,7 @@ var require_Subscription = __commonJS({
10480
10473
  }
10481
10474
  teardown._addParent(this);
10482
10475
  }
10483
- (this._teardowns = (_a = this._teardowns) !== null && _a !== void 0 ? _a : []).push(teardown);
10476
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
10484
10477
  }
10485
10478
  }
10486
10479
  };
@@ -10501,8 +10494,8 @@ var require_Subscription = __commonJS({
10501
10494
  }
10502
10495
  };
10503
10496
  Subscription2.prototype.remove = function(teardown) {
10504
- var _teardowns = this._teardowns;
10505
- _teardowns && arrRemove_1.arrRemove(_teardowns, teardown);
10497
+ var _finalizers = this._finalizers;
10498
+ _finalizers && arrRemove_1.arrRemove(_finalizers, teardown);
10506
10499
  if (teardown instanceof Subscription2) {
10507
10500
  teardown._removeParent(this);
10508
10501
  }
@@ -10520,11 +10513,11 @@ var require_Subscription = __commonJS({
10520
10513
  return value instanceof Subscription || value && "closed" in value && isFunction_1.isFunction(value.remove) && isFunction_1.isFunction(value.add) && isFunction_1.isFunction(value.unsubscribe);
10521
10514
  }
10522
10515
  exports.isSubscription = isSubscription;
10523
- function execTeardown(teardown) {
10524
- if (isFunction_1.isFunction(teardown)) {
10525
- teardown();
10516
+ function execFinalizer(finalizer) {
10517
+ if (isFunction_1.isFunction(finalizer)) {
10518
+ finalizer();
10526
10519
  } else {
10527
- teardown.unsubscribe();
10520
+ finalizer.unsubscribe();
10528
10521
  }
10529
10522
  }
10530
10523
  }
@@ -10579,13 +10572,16 @@ var require_timeoutProvider = __commonJS({
10579
10572
  Object.defineProperty(exports, "__esModule", { value: true });
10580
10573
  exports.timeoutProvider = void 0;
10581
10574
  exports.timeoutProvider = {
10582
- setTimeout: function() {
10575
+ setTimeout: function(handler, timeout) {
10583
10576
  var args = [];
10584
- for (var _i = 0; _i < arguments.length; _i++) {
10585
- args[_i] = arguments[_i];
10577
+ for (var _i = 2; _i < arguments.length; _i++) {
10578
+ args[_i - 2] = arguments[_i];
10586
10579
  }
10587
10580
  var delegate = exports.timeoutProvider.delegate;
10588
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) || setTimeout).apply(void 0, __spreadArray([], __read(args)));
10581
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
10582
+ return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));
10583
+ }
10584
+ return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
10589
10585
  },
10590
10586
  clearTimeout: function(handle) {
10591
10587
  var delegate = exports.timeoutProvider.delegate;
@@ -11490,6 +11486,7 @@ var require_Subject = __commonJS({
11490
11486
  function Subject2() {
11491
11487
  var _this = _super.call(this) || this;
11492
11488
  _this.closed = false;
11489
+ _this.currentObservers = null;
11493
11490
  _this.observers = [];
11494
11491
  _this.isStopped = false;
11495
11492
  _this.hasError = false;
@@ -11512,18 +11509,20 @@ var require_Subject = __commonJS({
11512
11509
  var e_1, _a;
11513
11510
  _this._throwIfClosed();
11514
11511
  if (!_this.isStopped) {
11515
- var copy = _this.observers.slice();
11512
+ if (!_this.currentObservers) {
11513
+ _this.currentObservers = Array.from(_this.observers);
11514
+ }
11516
11515
  try {
11517
- for (var copy_1 = __values(copy), copy_1_1 = copy_1.next(); !copy_1_1.done; copy_1_1 = copy_1.next()) {
11518
- var observer = copy_1_1.value;
11516
+ for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
11517
+ var observer = _c.value;
11519
11518
  observer.next(value);
11520
11519
  }
11521
11520
  } catch (e_1_1) {
11522
11521
  e_1 = { error: e_1_1 };
11523
11522
  } finally {
11524
11523
  try {
11525
- if (copy_1_1 && !copy_1_1.done && (_a = copy_1.return))
11526
- _a.call(copy_1);
11524
+ if (_c && !_c.done && (_a = _b.return))
11525
+ _a.call(_b);
11527
11526
  } finally {
11528
11527
  if (e_1)
11529
11528
  throw e_1.error;
@@ -11561,7 +11560,7 @@ var require_Subject = __commonJS({
11561
11560
  };
11562
11561
  Subject2.prototype.unsubscribe = function() {
11563
11562
  this.isStopped = this.closed = true;
11564
- this.observers = null;
11563
+ this.observers = this.currentObservers = null;
11565
11564
  };
11566
11565
  Object.defineProperty(Subject2.prototype, "observed", {
11567
11566
  get: function() {
@@ -11581,10 +11580,17 @@ var require_Subject = __commonJS({
11581
11580
  return this._innerSubscribe(subscriber);
11582
11581
  };
11583
11582
  Subject2.prototype._innerSubscribe = function(subscriber) {
11583
+ var _this = this;
11584
11584
  var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
11585
- return hasError || isStopped ? Subscription_1.EMPTY_SUBSCRIPTION : (observers.push(subscriber), new Subscription_1.Subscription(function() {
11586
- return arrRemove_1.arrRemove(observers, subscriber);
11587
- }));
11585
+ if (hasError || isStopped) {
11586
+ return Subscription_1.EMPTY_SUBSCRIPTION;
11587
+ }
11588
+ this.currentObservers = null;
11589
+ observers.push(subscriber);
11590
+ return new Subscription_1.Subscription(function() {
11591
+ _this.currentObservers = null;
11592
+ arrRemove_1.arrRemove(observers, subscriber);
11593
+ });
11588
11594
  };
11589
11595
  Subject2.prototype._checkFinalizedStatuses = function(subscriber) {
11590
11596
  var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
@@ -11950,13 +11956,16 @@ var require_intervalProvider = __commonJS({
11950
11956
  Object.defineProperty(exports, "__esModule", { value: true });
11951
11957
  exports.intervalProvider = void 0;
11952
11958
  exports.intervalProvider = {
11953
- setInterval: function() {
11959
+ setInterval: function(handler, timeout) {
11954
11960
  var args = [];
11955
- for (var _i = 0; _i < arguments.length; _i++) {
11956
- args[_i] = arguments[_i];
11961
+ for (var _i = 2; _i < arguments.length; _i++) {
11962
+ args[_i - 2] = arguments[_i];
11957
11963
  }
11958
11964
  var delegate = exports.intervalProvider.delegate;
11959
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) || setInterval).apply(void 0, __spreadArray([], __read(args)));
11965
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
11966
+ return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));
11967
+ }
11968
+ return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));
11960
11969
  },
11961
11970
  clearInterval: function(handle) {
11962
11971
  var delegate = exports.intervalProvider.delegate;
@@ -14092,7 +14101,7 @@ var require_timeout = __commonJS({
14092
14101
  }
14093
14102
  lastValue = null;
14094
14103
  }));
14095
- startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
14104
+ !seen && startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
14096
14105
  });
14097
14106
  }
14098
14107
  exports.timeout = timeout;
@@ -14442,7 +14451,7 @@ var require_mergeInternals = __commonJS({
14442
14451
  var innerFrom_1 = require_innerFrom();
14443
14452
  var executeSchedule_1 = require_executeSchedule();
14444
14453
  var OperatorSubscriber_1 = require_OperatorSubscriber();
14445
- function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
14454
+ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
14446
14455
  var buffer = [];
14447
14456
  var active = 0;
14448
14457
  var index = 0;
@@ -14497,7 +14506,7 @@ var require_mergeInternals = __commonJS({
14497
14506
  checkComplete();
14498
14507
  }));
14499
14508
  return function() {
14500
- additionalTeardown === null || additionalTeardown === void 0 ? void 0 : additionalTeardown();
14509
+ additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
14501
14510
  };
14502
14511
  }
14503
14512
  exports.mergeInternals = mergeInternals;
@@ -18073,14 +18082,11 @@ var require_shareReplay = __commonJS({
18073
18082
  var ReplaySubject_1 = require_ReplaySubject();
18074
18083
  var share_1 = require_share();
18075
18084
  function shareReplay(configOrBufferSize, windowTime, scheduler) {
18076
- var _a, _b;
18085
+ var _a, _b, _c;
18077
18086
  var bufferSize;
18078
18087
  var refCount = false;
18079
18088
  if (configOrBufferSize && typeof configOrBufferSize === "object") {
18080
- bufferSize = (_a = configOrBufferSize.bufferSize) !== null && _a !== void 0 ? _a : Infinity;
18081
- windowTime = (_b = configOrBufferSize.windowTime) !== null && _b !== void 0 ? _b : Infinity;
18082
- refCount = !!configOrBufferSize.refCount;
18083
- scheduler = configOrBufferSize.scheduler;
18089
+ _a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler;
18084
18090
  } else {
18085
18091
  bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;
18086
18092
  }
@@ -20949,6 +20955,7 @@ var src_exports = {};
20949
20955
  __export(src_exports, {
20950
20956
  activate: () => activate
20951
20957
  });
20958
+ module.exports = __toCommonJS(src_exports);
20952
20959
  var import_coc24 = require("coc.nvim");
20953
20960
  var import_fs = require("fs");
20954
20961
  var import_path5 = require("path");
@@ -21854,7 +21861,7 @@ var BaseFormatter = class {
21854
21861
  }
21855
21862
  const filepath = import_coc4.Uri.parse(document.uri).fsPath;
21856
21863
  const tempFile = await this.createTempFile(document);
21857
- if (this.checkCancellation(filepath, tempFile, token)) {
21864
+ if (this.checkCancellation(filepath, tempFile, "start", token)) {
21858
21865
  return [];
21859
21866
  }
21860
21867
  args.push(tempFile);
@@ -21872,7 +21879,7 @@ var BaseFormatter = class {
21872
21879
  this.outputChannel.appendLine("");
21873
21880
  this.outputChannel.appendLine(`${"#".repeat(10)} ${this.Id} output:`);
21874
21881
  this.outputChannel.appendLine(data);
21875
- if (this.checkCancellation(filepath, tempFile, token)) {
21882
+ if (this.checkCancellation(filepath, tempFile, "success", token)) {
21876
21883
  return [];
21877
21884
  }
21878
21885
  const edits = getTextEditsFromPatch(document.getText(), data);
@@ -21880,11 +21887,11 @@ var BaseFormatter = class {
21880
21887
  import_coc4.window.showMessage(`Formatted with ${this.Id}`);
21881
21888
  return edits;
21882
21889
  }).catch((error) => {
21883
- if (this.checkCancellation(filepath, tempFile, token)) {
21884
- return [];
21885
- }
21886
21890
  this.handleError(this.Id, error).catch(() => {
21887
21891
  });
21892
+ if (this.checkCancellation(filepath, tempFile, "error", token)) {
21893
+ return [];
21894
+ }
21888
21895
  return [];
21889
21896
  }).finally(() => {
21890
21897
  this.deleteTempFile(filepath, tempFile).catch(() => {
@@ -21910,9 +21917,9 @@ var BaseFormatter = class {
21910
21917
  }
21911
21918
  return Promise.resolve();
21912
21919
  }
21913
- checkCancellation(originalFile, tempFile, token) {
21920
+ checkCancellation(originalFile, tempFile, state, token) {
21914
21921
  if (token && token.isCancellationRequested) {
21915
- this.outputChannel.appendLine(`${"#".repeat(10)} ${this.Id} formatting action is canceled.`);
21922
+ this.outputChannel.appendLine(`${"#".repeat(10)} ${this.Id} formatting action is canceled on ${state}`);
21916
21923
  this.deleteTempFile(originalFile, tempFile).catch(() => {
21917
21924
  });
21918
21925
  return true;
@@ -23653,7 +23660,6 @@ var ImportCompletionProvider = class {
23653
23660
  return items;
23654
23661
  }
23655
23662
  };
23656
- module.exports = __toCommonJS(src_exports);
23657
23663
  // Annotate the CommonJS export names for ESM import in node:
23658
23664
  0 && (module.exports = {
23659
23665
  activate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.232",
3
+ "version": "1.1.235",
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",
@@ -1403,6 +1403,6 @@
1403
1403
  ]
1404
1404
  },
1405
1405
  "dependencies": {
1406
- "pyright": "^1.1.232"
1406
+ "pyright": "^1.1.235"
1407
1407
  }
1408
1408
  }