coc-pyright 1.1.189 → 1.1.206

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 CHANGED
@@ -52,7 +52,7 @@ These configurations are used by `coc-pyright`, you need to set them in your `co
52
52
  | python.formatting.yapfArgs | Arguments passed to yapf | [] |
53
53
  | python.formatting.autopep8Path | Custom path to autopep8 | autopep8 |
54
54
  | python.formatting.autopep8Args | Arguments passed to autopep8 | [] |
55
- | python.linting.enabled | Whether to lint Python files | true |
55
+ | python.linting.enabled | Whether to lint Python files with external linters | true |
56
56
  | python.linting.flake8Enabled | Whether to lint with flake8 | false |
57
57
  | python.linting.banditEnabled | Whether to lint with bandit | false |
58
58
  | python.linting.mypyEnabled | Whether to lint with mypy | false |
@@ -67,9 +67,12 @@ These configurations are used by `coc-pyright`, you need to set them in your `co
67
67
  | pyright.server | Custom `pyright-langserver` path | '' |
68
68
  | pyright.disableCompletion | Disables completion from Pyright, left other LSP features work | false |
69
69
  | pyright.disableDiagnostics | Disable diagnostics from Pyright | false |
70
+ | pyright.completion.importSupport | Enable `python-import` completion source support | true |
70
71
  | pyright.completion.snippetSupport | Enable completion snippets support | true |
71
72
  | pyright.organizeimports.provider | Organize imports provider, `pyright` or `isort` | pyright |
72
73
 
74
+ Additional configuration options can be found in [package.json](./package.json).
75
+
73
76
  ## pyrightconfig.json
74
77
 
75
78
  Pyright supports [pyrightconfig.json](https://github.com/microsoft/pyright/blob/master/docs/configuration.md) that provide granular control over settings.
@@ -114,4 +117,4 @@ MIT
114
117
 
115
118
  ---
116
119
 
117
- > This extension is created by [create-coc-extension](https://github.com/fannheyward/create-coc-extension)
120
+ > This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)
package/lib/index.js CHANGED
@@ -20,24 +20,28 @@ var __spreadValues = (a, b) => {
20
20
  };
21
21
  var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
22
  var __commonJS = (cb, mod) => function __require() {
23
- return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
24
  };
25
25
  var __export = (target, all) => {
26
- __markAsModule(target);
27
26
  for (var name in all)
28
27
  __defProp(target, name, { get: all[name], enumerable: true });
29
28
  };
30
- var __reExport = (target, module2, desc) => {
29
+ var __reExport = (target, module2, copyDefault, desc) => {
31
30
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
32
31
  for (let key of __getOwnPropNames(module2))
33
- if (!__hasOwnProp.call(target, key) && key !== "default")
32
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
34
33
  __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
35
34
  }
36
35
  return target;
37
36
  };
38
- var __toModule = (module2) => {
39
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
37
+ var __toESM = (module2, isNodeMode) => {
38
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
40
39
  };
40
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
+ return (module2, temp) => {
42
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
+ };
44
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
41
45
 
42
46
  // node_modules/semver/internal/constants.js
43
47
  var require_constants = __commonJS({
@@ -1212,7 +1216,7 @@ var require_lru_cache = __commonJS({
1212
1216
  if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
1213
1217
  this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
1214
1218
  }
1215
- this[CACHE] = new Map();
1219
+ this[CACHE] = /* @__PURE__ */ new Map();
1216
1220
  this[LRU_LIST] = new Yallist();
1217
1221
  this[LENGTH] = 0;
1218
1222
  }
@@ -1443,7 +1447,7 @@ var require_range = __commonJS({
1443
1447
  const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1444
1448
  const rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)).filter(this.options.loose ? (comp) => !!comp.match(compRe) : () => true).map((comp) => new Comparator(comp, this.options));
1445
1449
  const l = rangeList.length;
1446
- const rangeMap = new Map();
1450
+ const rangeMap = /* @__PURE__ */ new Map();
1447
1451
  for (const comp of rangeList) {
1448
1452
  if (isNullSet(comp))
1449
1453
  return [comp];
@@ -2162,7 +2166,7 @@ var require_subset = __commonJS({
2162
2166
  else
2163
2167
  dom = [new Comparator(">=0.0.0")];
2164
2168
  }
2165
- const eqSet = new Set();
2169
+ const eqSet = /* @__PURE__ */ new Set();
2166
2170
  let gt, lt2;
2167
2171
  for (const c of sub) {
2168
2172
  if (c.operator === ">" || c.operator === ">=")
@@ -2968,7 +2972,7 @@ var require_clone = __commonJS({
2968
2972
  if (obj instanceof Object)
2969
2973
  var copy = { __proto__: obj.__proto__ };
2970
2974
  else
2971
- var copy = Object.create(null);
2975
+ var copy = /* @__PURE__ */ Object.create(null);
2972
2976
  Object.getOwnPropertyNames(obj).forEach(function(key) {
2973
2977
  Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
2974
2978
  });
@@ -11004,15 +11008,19 @@ var require_Observable = __commonJS({
11004
11008
  var _this = this;
11005
11009
  promiseCtor = getPromiseCtor(promiseCtor);
11006
11010
  return new promiseCtor(function(resolve, reject) {
11007
- var subscription;
11008
- subscription = _this.subscribe(function(value) {
11009
- try {
11010
- next(value);
11011
- } catch (err) {
11012
- reject(err);
11013
- subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
11014
- }
11015
- }, reject, resolve);
11011
+ var subscriber = new Subscriber_1.SafeSubscriber({
11012
+ next: function(value) {
11013
+ try {
11014
+ next(value);
11015
+ } catch (err) {
11016
+ reject(err);
11017
+ subscriber.unsubscribe();
11018
+ }
11019
+ },
11020
+ error: reject,
11021
+ complete: resolve
11022
+ });
11023
+ _this.subscribe(subscriber);
11016
11024
  });
11017
11025
  };
11018
11026
  Observable3.prototype._subscribe = function(subscriber) {
@@ -12226,7 +12234,9 @@ var require_AsapAction = __commonJS({
12226
12234
  if (delay != null && delay > 0 || delay == null && this.delay > 0) {
12227
12235
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
12228
12236
  }
12229
- if (scheduler.actions.length === 0) {
12237
+ if (!scheduler.actions.some(function(action) {
12238
+ return action.id === id;
12239
+ })) {
12230
12240
  immediateProvider_1.immediateProvider.clearImmediate(id);
12231
12241
  scheduler._scheduled = void 0;
12232
12242
  }
@@ -12368,20 +12378,19 @@ var require_AsapScheduler = __commonJS({
12368
12378
  }
12369
12379
  AsapScheduler2.prototype.flush = function(action) {
12370
12380
  this._active = true;
12381
+ var flushId = this._scheduled;
12371
12382
  this._scheduled = void 0;
12372
12383
  var actions = this.actions;
12373
12384
  var error;
12374
- var index = -1;
12375
12385
  action = action || actions.shift();
12376
- var count = actions.length;
12377
12386
  do {
12378
12387
  if (error = action.execute(action.state, action.delay)) {
12379
12388
  break;
12380
12389
  }
12381
- } while (++index < count && (action = actions.shift()));
12390
+ } while ((action = actions[0]) && action.id === flushId && actions.shift());
12382
12391
  this._active = false;
12383
12392
  if (error) {
12384
- while (++index < count && (action = actions.shift())) {
12393
+ while ((action = actions[0]) && action.id === flushId && actions.shift()) {
12385
12394
  action.unsubscribe();
12386
12395
  }
12387
12396
  throw error;
@@ -12593,7 +12602,9 @@ var require_AnimationFrameAction = __commonJS({
12593
12602
  if (delay != null && delay > 0 || delay == null && this.delay > 0) {
12594
12603
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
12595
12604
  }
12596
- if (scheduler.actions.length === 0) {
12605
+ if (!scheduler.actions.some(function(action) {
12606
+ return action.id === id;
12607
+ })) {
12597
12608
  animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
12598
12609
  scheduler._scheduled = void 0;
12599
12610
  }
@@ -12640,20 +12651,19 @@ var require_AnimationFrameScheduler = __commonJS({
12640
12651
  }
12641
12652
  AnimationFrameScheduler2.prototype.flush = function(action) {
12642
12653
  this._active = true;
12654
+ var flushId = this._scheduled;
12643
12655
  this._scheduled = void 0;
12644
12656
  var actions = this.actions;
12645
12657
  var error;
12646
- var index = -1;
12647
12658
  action = action || actions.shift();
12648
- var count = actions.length;
12649
12659
  do {
12650
12660
  if (error = action.execute(action.state, action.delay)) {
12651
12661
  break;
12652
12662
  }
12653
- } while (++index < count && (action = actions.shift()));
12663
+ } while ((action = actions[0]) && action.id === flushId && actions.shift());
12654
12664
  this._active = false;
12655
12665
  if (error) {
12656
- while (++index < count && (action = actions.shift())) {
12666
+ while ((action = actions[0]) && action.id === flushId && actions.shift()) {
12657
12667
  action.unsubscribe();
12658
12668
  }
12659
12669
  throw error;
@@ -16559,7 +16569,7 @@ var require_distinct = __commonJS({
16559
16569
  var noop_1 = require_noop();
16560
16570
  function distinct(keySelector, flushes) {
16561
16571
  return lift_1.operate(function(source, subscriber) {
16562
- var distinctKeys = new Set();
16572
+ var distinctKeys = /* @__PURE__ */ new Set();
16563
16573
  source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, function(value) {
16564
16574
  var key = keySelector ? keySelector(value) : value;
16565
16575
  if (!distinctKeys.has(key)) {
@@ -16994,7 +17004,7 @@ var require_groupBy = __commonJS({
16994
17004
  } else {
16995
17005
  duration = elementOrOptions.duration, element = elementOrOptions.element, connector = elementOrOptions.connector;
16996
17006
  }
16997
- var groups = new Map();
17007
+ var groups = /* @__PURE__ */ new Map();
16998
17008
  var notify = function(cb) {
16999
17009
  groups.forEach(cb);
17000
17010
  cb(subscriber);
@@ -17623,23 +17633,44 @@ var require_repeat = __commonJS({
17623
17633
  var empty_1 = require_empty2();
17624
17634
  var lift_1 = require_lift();
17625
17635
  var OperatorSubscriber_1 = require_OperatorSubscriber();
17626
- function repeat(count) {
17627
- if (count === void 0) {
17628
- count = Infinity;
17636
+ var innerFrom_1 = require_innerFrom();
17637
+ var timer_1 = require_timer();
17638
+ function repeat(countOrConfig) {
17639
+ var _a;
17640
+ var count = Infinity;
17641
+ var delay;
17642
+ if (countOrConfig != null) {
17643
+ if (typeof countOrConfig === "object") {
17644
+ _a = countOrConfig.count, count = _a === void 0 ? Infinity : _a, delay = countOrConfig.delay;
17645
+ } else {
17646
+ count = countOrConfig;
17647
+ }
17629
17648
  }
17630
17649
  return count <= 0 ? function() {
17631
17650
  return empty_1.EMPTY;
17632
17651
  } : lift_1.operate(function(source, subscriber) {
17633
17652
  var soFar = 0;
17634
- var innerSub;
17635
- var subscribeForRepeat = function() {
17653
+ var sourceSub;
17654
+ var resubscribe = function() {
17655
+ sourceSub === null || sourceSub === void 0 ? void 0 : sourceSub.unsubscribe();
17656
+ sourceSub = null;
17657
+ if (delay != null) {
17658
+ var notifier = typeof delay === "number" ? timer_1.timer(delay) : innerFrom_1.innerFrom(delay(soFar));
17659
+ var notifierSubscriber_1 = new OperatorSubscriber_1.OperatorSubscriber(subscriber, function() {
17660
+ notifierSubscriber_1.unsubscribe();
17661
+ subscribeToSource();
17662
+ });
17663
+ notifier.subscribe(notifierSubscriber_1);
17664
+ } else {
17665
+ subscribeToSource();
17666
+ }
17667
+ };
17668
+ var subscribeToSource = function() {
17636
17669
  var syncUnsub = false;
17637
- innerSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
17670
+ sourceSub = source.subscribe(new OperatorSubscriber_1.OperatorSubscriber(subscriber, void 0, function() {
17638
17671
  if (++soFar < count) {
17639
- if (innerSub) {
17640
- innerSub.unsubscribe();
17641
- innerSub = null;
17642
- subscribeForRepeat();
17672
+ if (sourceSub) {
17673
+ resubscribe();
17643
17674
  } else {
17644
17675
  syncUnsub = true;
17645
17676
  }
@@ -17648,12 +17679,10 @@ var require_repeat = __commonJS({
17648
17679
  }
17649
17680
  }));
17650
17681
  if (syncUnsub) {
17651
- innerSub.unsubscribe();
17652
- innerSub = null;
17653
- subscribeForRepeat();
17682
+ resubscribe();
17654
17683
  }
17655
17684
  };
17656
- subscribeForRepeat();
17685
+ subscribeToSource();
17657
17686
  });
17658
17687
  }
17659
17688
  exports.repeat = repeat;
@@ -18457,9 +18486,12 @@ var require_throttle = __commonJS({
18457
18486
  leading: true,
18458
18487
  trailing: false
18459
18488
  };
18460
- function throttle(durationSelector, _a) {
18461
- var _b = _a === void 0 ? exports.defaultThrottleConfig : _a, leading = _b.leading, trailing = _b.trailing;
18489
+ function throttle(durationSelector, config) {
18490
+ if (config === void 0) {
18491
+ config = exports.defaultThrottleConfig;
18492
+ }
18462
18493
  return lift_1.operate(function(source, subscriber) {
18494
+ var leading = config.leading, trailing = config.trailing;
18463
18495
  var hasValue = false;
18464
18496
  var sendValue = null;
18465
18497
  var throttled = null;
@@ -20952,17 +20984,18 @@ var require_named_js_regexp = __commonJS({
20952
20984
  });
20953
20985
 
20954
20986
  // src/index.ts
20955
- __export(exports, {
20987
+ var src_exports = {};
20988
+ __export(src_exports, {
20956
20989
  activate: () => activate
20957
20990
  });
20958
- var import_coc24 = __toModule(require("coc.nvim"));
20959
- var import_fs = __toModule(require("fs"));
20960
- var import_path5 = __toModule(require("path"));
20961
- var import_semver2 = __toModule(require_semver2());
20962
- var import_which2 = __toModule(require_which());
20991
+ var import_coc24 = require("coc.nvim");
20992
+ var import_fs = require("fs");
20993
+ var import_path5 = require("path");
20994
+ var import_semver2 = __toESM(require_semver2());
20995
+ var import_which2 = __toESM(require_which());
20963
20996
 
20964
20997
  // src/codeActionsProvider.ts
20965
- var import_coc = __toModule(require("coc.nvim"));
20998
+ var import_coc = require("coc.nvim");
20966
20999
  var PythonCodeActionProvider = class {
20967
21000
  wholeRange(doc, range) {
20968
21001
  const whole = import_coc.Range.create(0, 0, doc.lineCount, 0);
@@ -21087,16 +21120,15 @@ var PythonCodeActionProvider = class {
21087
21120
  };
21088
21121
 
21089
21122
  // src/configSettings.ts
21090
- var child_process = __toModule(require("child_process"));
21091
- var import_coc2 = __toModule(require("coc.nvim"));
21092
- var import_fs_extra = __toModule(require_lib());
21093
- var import_path = __toModule(require("path"));
21094
- var import_untildify = __toModule(require_untildify());
21095
- var import_which = __toModule(require_which());
21123
+ var child_process = __toESM(require("child_process"));
21124
+ var import_coc2 = require("coc.nvim");
21125
+ var import_fs_extra = __toESM(require_lib());
21126
+ var import_path = __toESM(require("path"));
21127
+ var import_untildify = __toESM(require_untildify());
21128
+ var import_which = __toESM(require_which());
21096
21129
 
21097
21130
  // src/systemVariables.ts
21098
- var Path = __toModule(require("path"));
21099
- "use strict";
21131
+ var Path = __toESM(require("path"));
21100
21132
  var _typeof = {
21101
21133
  number: "number",
21102
21134
  string: "string",
@@ -21155,7 +21187,7 @@ var AbstractSystemVariables = class {
21155
21187
  });
21156
21188
  }
21157
21189
  __resolveLiteral(values) {
21158
- const result = Object.create(null);
21190
+ const result = /* @__PURE__ */ Object.create(null);
21159
21191
  Object.keys(values).forEach((key) => {
21160
21192
  const value = values[key];
21161
21193
  result[key] = this.resolve(value);
@@ -21163,7 +21195,7 @@ var AbstractSystemVariables = class {
21163
21195
  return result;
21164
21196
  }
21165
21197
  __resolveAnyLiteral(values) {
21166
- const result = Object.create(null);
21198
+ const result = /* @__PURE__ */ Object.create(null);
21167
21199
  Object.keys(values).forEach((key) => {
21168
21200
  const value = values[key];
21169
21201
  result[key] = this.resolveAny(value);
@@ -21351,7 +21383,7 @@ var _PythonSettings = class {
21351
21383
  }
21352
21384
  };
21353
21385
  var PythonSettings = _PythonSettings;
21354
- PythonSettings.pythonSettings = new Map();
21386
+ PythonSettings.pythonSettings = /* @__PURE__ */ new Map();
21355
21387
  function getPythonExecutable(pythonPath) {
21356
21388
  pythonPath = (0, import_untildify.default)(pythonPath);
21357
21389
  if (pythonPath === "python" || pythonPath.indexOf(import_path.default.sep) === -1 || import_path.default.basename(pythonPath) === import_path.default.dirname(pythonPath)) {
@@ -21374,27 +21406,21 @@ function isValidPythonPath(pythonPath) {
21374
21406
  }
21375
21407
 
21376
21408
  // src/formatProvider.ts
21377
- var import_coc8 = __toModule(require("coc.nvim"));
21409
+ var import_coc8 = require("coc.nvim");
21378
21410
 
21379
21411
  // src/formatters/baseFormatter.ts
21380
- var import_coc4 = __toModule(require("coc.nvim"));
21381
- var import_fs_extra2 = __toModule(require_lib());
21382
- var import_md5 = __toModule(require_md5());
21383
- var import_path2 = __toModule(require("path"));
21384
- var import_semver = __toModule(require_semver2());
21385
- var import_util = __toModule(require("util"));
21412
+ var import_coc4 = require("coc.nvim");
21413
+ var import_fs_extra2 = __toESM(require_lib());
21414
+ var import_md5 = __toESM(require_md5());
21415
+ var import_path2 = __toESM(require("path"));
21416
+ var import_semver = __toESM(require_semver2());
21417
+ var import_util = require("util");
21386
21418
 
21387
21419
  // src/common.ts
21388
- var import_coc3 = __toModule(require("coc.nvim"));
21389
- var import_diff_match_patch = __toModule(require_diff_match_patch());
21390
- var import_os = __toModule(require("os"));
21420
+ var import_coc3 = require("coc.nvim");
21421
+ var import_diff_match_patch = __toESM(require_diff_match_patch());
21422
+ var import_os = require("os");
21391
21423
  var NEW_LINE_LENGTH = import_os.EOL.length;
21392
- var EditAction;
21393
- (function(EditAction2) {
21394
- EditAction2[EditAction2["Delete"] = 0] = "Delete";
21395
- EditAction2[EditAction2["Insert"] = 1] = "Insert";
21396
- EditAction2[EditAction2["Replace"] = 2] = "Replace";
21397
- })(EditAction || (EditAction = {}));
21398
21424
  var Edit = class {
21399
21425
  constructor(action, start) {
21400
21426
  this.action = action;
@@ -21403,11 +21429,11 @@ var Edit = class {
21403
21429
  }
21404
21430
  apply() {
21405
21431
  switch (this.action) {
21406
- case 1:
21432
+ case 1 /* Insert */:
21407
21433
  return import_coc3.TextEdit.insert(this.start, this.text);
21408
- case 0:
21434
+ case 0 /* Delete */:
21409
21435
  return import_coc3.TextEdit.del(import_coc3.Range.create(this.start, this.end));
21410
- case 2:
21436
+ case 2 /* Replace */:
21411
21437
  return import_coc3.TextEdit.replace(import_coc3.Range.create(this.start, this.end), this.text);
21412
21438
  default:
21413
21439
  return {
@@ -21440,17 +21466,17 @@ function getTextEditsInternal(before, diffs, startLine = 0) {
21440
21466
  switch (diffs[i][0]) {
21441
21467
  case dmp.DIFF_DELETE:
21442
21468
  if (edit === null) {
21443
- edit = new Edit(0, start);
21444
- } else if (edit.action !== 0) {
21469
+ edit = new Edit(0 /* Delete */, start);
21470
+ } else if (edit.action !== 0 /* Delete */) {
21445
21471
  throw new Error("cannot format due to an internal error.");
21446
21472
  }
21447
21473
  edit.end = { line, character };
21448
21474
  break;
21449
21475
  case dmp.DIFF_INSERT:
21450
21476
  if (edit === null) {
21451
- edit = new Edit(1, start);
21452
- } else if (edit.action === 0) {
21453
- edit.action = 2;
21477
+ edit = new Edit(1 /* Insert */, start);
21478
+ } else if (edit.action === 0 /* Delete */) {
21479
+ edit.action = 2 /* Replace */;
21454
21480
  }
21455
21481
  line = start.line;
21456
21482
  character = start.character;
@@ -21586,13 +21612,12 @@ function getWindowsLineEndingCount(document, offset) {
21586
21612
  }
21587
21613
 
21588
21614
  // src/processService.ts
21589
- var import_child_process = __toModule(require("child_process"));
21590
- var iconv = __toModule(require_lib2());
21591
- var import_os2 = __toModule(require("os"));
21592
- var import_rxjs = __toModule(require_cjs());
21615
+ var import_child_process = require("child_process");
21616
+ var iconv = __toESM(require_lib2());
21617
+ var import_os2 = require("os");
21618
+ var import_rxjs = __toESM(require_cjs());
21593
21619
 
21594
21620
  // src/async.ts
21595
- "use strict";
21596
21621
  var DeferredImpl = class {
21597
21622
  constructor(scope = null) {
21598
21623
  this.scope = scope;
@@ -21958,7 +21983,7 @@ var AutoPep8Formatter = class extends BaseFormatter {
21958
21983
  };
21959
21984
 
21960
21985
  // src/formatters/black.ts
21961
- var import_coc5 = __toModule(require("coc.nvim"));
21986
+ var import_coc5 = require("coc.nvim");
21962
21987
  var BlackFormatter = class extends BaseFormatter {
21963
21988
  constructor(pythonSettings, outputChannel) {
21964
21989
  super("black", pythonSettings, outputChannel);
@@ -22008,7 +22033,7 @@ var YapfFormatter = class extends BaseFormatter {
22008
22033
  };
22009
22034
 
22010
22035
  // src/formatters/darker.ts
22011
- var import_coc6 = __toModule(require("coc.nvim"));
22036
+ var import_coc6 = require("coc.nvim");
22012
22037
  var DarkerFormatter = class extends BaseFormatter {
22013
22038
  constructor(pythonSettings, outputChannel) {
22014
22039
  super("darker", pythonSettings, outputChannel);
@@ -22030,8 +22055,8 @@ var DarkerFormatter = class extends BaseFormatter {
22030
22055
  };
22031
22056
 
22032
22057
  // src/formatters/blackd.ts
22033
- var import_coc7 = __toModule(require("coc.nvim"));
22034
- var import_child_process2 = __toModule(require("child_process"));
22058
+ var import_coc7 = require("coc.nvim");
22059
+ var import_child_process2 = require("child_process");
22035
22060
  var BlackdFormatter = class extends BaseFormatter {
22036
22061
  constructor(pythonSettings, outputChannel) {
22037
22062
  super("blackd", pythonSettings, outputChannel);
@@ -22064,7 +22089,11 @@ var BlackdFormatter = class extends BaseFormatter {
22064
22089
  import_coc7.window.showErrorMessage("blackd request error");
22065
22090
  this.outputChannel.appendLine("");
22066
22091
  this.outputChannel.appendLine(`${"#".repeat(10)} blackd request error:`);
22067
- this.outputChannel.appendLine(e);
22092
+ if (typeof e === "string") {
22093
+ this.outputChannel.appendLine(e);
22094
+ } else if (e instanceof Error) {
22095
+ this.outputChannel.appendLine(e.message);
22096
+ }
22068
22097
  return [];
22069
22098
  }
22070
22099
  }
@@ -22086,7 +22115,7 @@ var BlackdFormatter = class extends BaseFormatter {
22086
22115
  // src/formatProvider.ts
22087
22116
  var PythonFormattingEditProvider = class {
22088
22117
  constructor() {
22089
- this.formatters = new Map();
22118
+ this.formatters = /* @__PURE__ */ new Map();
22090
22119
  this.disposables = [];
22091
22120
  this.pythonSettings = PythonSettings.getInstance();
22092
22121
  this.outputChannel = import_coc8.window.createOutputChannel("coc-pyright-formatting");
@@ -22136,10 +22165,10 @@ var PythonFormattingEditProvider = class {
22136
22165
  };
22137
22166
 
22138
22167
  // src/isortProvider.ts
22139
- var import_coc9 = __toModule(require("coc.nvim"));
22140
- var import_fs_extra3 = __toModule(require_lib());
22141
- var import_md52 = __toModule(require_md5());
22142
- var path3 = __toModule(require("path"));
22168
+ var import_coc9 = require("coc.nvim");
22169
+ var import_fs_extra3 = __toESM(require_lib());
22170
+ var import_md52 = __toESM(require_md5());
22171
+ var path3 = __toESM(require("path"));
22143
22172
  function getTempFileWithDocumentContents2(document) {
22144
22173
  return new Promise((resolve, reject) => {
22145
22174
  const fsPath = import_coc9.Uri.parse(document.uri).fsPath;
@@ -22180,7 +22209,12 @@ async function sortImports(extensionRoot, outputChannel) {
22180
22209
  const edits = getTextEditsFromPatch(doc.getDocumentContent(), patch);
22181
22210
  await doc.applyEdits(edits);
22182
22211
  } catch (err) {
22183
- const message = typeof err === "string" ? err : err.message ? err.message : err;
22212
+ let message = "";
22213
+ if (typeof err === "string") {
22214
+ message = err;
22215
+ } else if (err instanceof Error) {
22216
+ message = err.message;
22217
+ }
22184
22218
  outputChannel.appendLine(`${"#".repeat(10)} isort Output ${"#".repeat(10)}`);
22185
22219
  outputChannel.appendLine(`Error from isort:
22186
22220
  ${message}`);
@@ -22189,17 +22223,16 @@ ${message}`);
22189
22223
  }
22190
22224
 
22191
22225
  // src/linterProvider.ts
22192
- var import_coc21 = __toModule(require("coc.nvim"));
22226
+ var import_coc21 = require("coc.nvim");
22193
22227
 
22194
22228
  // src/linters/lintingEngine.ts
22195
- var import_coc20 = __toModule(require("coc.nvim"));
22196
- var import_fs_extra5 = __toModule(require_lib());
22197
- var import_minimatch = __toModule(require_minimatch());
22198
- var import_path4 = __toModule(require("path"));
22229
+ var import_coc20 = require("coc.nvim");
22230
+ var import_fs_extra5 = __toESM(require_lib());
22231
+ var import_minimatch = __toESM(require_minimatch());
22232
+ var import_path4 = __toESM(require("path"));
22199
22233
 
22200
22234
  // src/types.ts
22201
- var Product;
22202
- (function(Product2) {
22235
+ var Product = /* @__PURE__ */ ((Product2) => {
22203
22236
  Product2[Product2["pylint"] = 1] = "pylint";
22204
22237
  Product2[Product2["flake8"] = 2] = "flake8";
22205
22238
  Product2[Product2["pycodestyle"] = 3] = "pycodestyle";
@@ -22215,37 +22248,37 @@ var Product;
22215
22248
  Product2[Product2["darker"] = 13] = "darker";
22216
22249
  Product2[Product2["rope"] = 14] = "rope";
22217
22250
  Product2[Product2["blackd"] = 15] = "blackd";
22218
- })(Product || (Product = {}));
22219
- var LintMessageSeverity;
22220
- (function(LintMessageSeverity2) {
22251
+ return Product2;
22252
+ })(Product || {});
22253
+ var LintMessageSeverity = /* @__PURE__ */ ((LintMessageSeverity2) => {
22221
22254
  LintMessageSeverity2[LintMessageSeverity2["Hint"] = 0] = "Hint";
22222
22255
  LintMessageSeverity2[LintMessageSeverity2["Error"] = 1] = "Error";
22223
22256
  LintMessageSeverity2[LintMessageSeverity2["Warning"] = 2] = "Warning";
22224
22257
  LintMessageSeverity2[LintMessageSeverity2["Information"] = 3] = "Information";
22225
- })(LintMessageSeverity || (LintMessageSeverity = {}));
22258
+ return LintMessageSeverity2;
22259
+ })(LintMessageSeverity || {});
22226
22260
  var LinterErrors;
22227
- (function(LinterErrors2) {
22261
+ ((LinterErrors2) => {
22228
22262
  let pylint;
22229
- (function(pylint2) {
22263
+ ((pylint2) => {
22230
22264
  pylint2.InvalidSyntax = "E0001";
22231
22265
  })(pylint = LinterErrors2.pylint || (LinterErrors2.pylint = {}));
22232
22266
  let prospector;
22233
- (function(prospector2) {
22267
+ ((prospector2) => {
22234
22268
  prospector2.InvalidSyntax = "F999";
22235
22269
  })(prospector = LinterErrors2.prospector || (LinterErrors2.prospector = {}));
22236
22270
  let flake8;
22237
- (function(flake82) {
22271
+ ((flake82) => {
22238
22272
  flake82.InvalidSyntax = "E999";
22239
22273
  })(flake8 = LinterErrors2.flake8 || (LinterErrors2.flake8 = {}));
22240
22274
  })(LinterErrors || (LinterErrors = {}));
22241
22275
 
22242
22276
  // src/linters/bandit.ts
22243
- var import_coc11 = __toModule(require("coc.nvim"));
22277
+ var import_coc11 = require("coc.nvim");
22244
22278
 
22245
22279
  // src/linters/baseLinter.ts
22246
- var import_coc10 = __toModule(require("coc.nvim"));
22247
- var import_named_js_regexp = __toModule(require_named_js_regexp());
22248
- "use strict";
22280
+ var import_coc10 = require("coc.nvim");
22281
+ var import_named_js_regexp = __toESM(require_named_js_regexp());
22249
22282
  var REGEX = "(?<line>\\d+),(?<column>-?\\d+),(?<type>\\w+),(?<code>\\w+\\d+):(?<message>.*)\\r?(\\n|$)";
22250
22283
  function matchNamedRegEx(data, regex) {
22251
22284
  const compiledRegexp = (0, import_named_js_regexp.default)(regex, "g");
@@ -22294,13 +22327,13 @@ var BaseLinter = class {
22294
22327
  const severityName = categorySeverity[error];
22295
22328
  switch (severityName) {
22296
22329
  case "Error":
22297
- return LintMessageSeverity.Error;
22330
+ return 1 /* Error */;
22298
22331
  case "Hint":
22299
- return LintMessageSeverity.Hint;
22332
+ return 0 /* Hint */;
22300
22333
  case "Information":
22301
- return LintMessageSeverity.Information;
22334
+ return 3 /* Information */;
22302
22335
  case "Warning":
22303
- return LintMessageSeverity.Warning;
22336
+ return 2 /* Warning */;
22304
22337
  default: {
22305
22338
  if (LintMessageSeverity[severityName]) {
22306
22339
  return LintMessageSeverity[severityName];
@@ -22308,7 +22341,7 @@ var BaseLinter = class {
22308
22341
  }
22309
22342
  }
22310
22343
  }
22311
- return LintMessageSeverity.Information;
22344
+ return 3 /* Information */;
22312
22345
  }
22313
22346
  async run(args, document, cancellation, regEx = REGEX) {
22314
22347
  if (!this.info.isEnabled(import_coc10.Uri.parse(document.uri))) {
@@ -22328,7 +22361,9 @@ var BaseLinter = class {
22328
22361
  return await this.parseMessages(result.stdout, document, cancellation, regEx);
22329
22362
  } catch (error) {
22330
22363
  this.outputChannel.appendLine(`Linting with ${this.info.id} failed:`);
22331
- this.outputChannel.appendLine(error.message.toString());
22364
+ if (error instanceof Error) {
22365
+ this.outputChannel.appendLine(error.message.toString());
22366
+ }
22332
22367
  return [];
22333
22368
  }
22334
22369
  }
@@ -22344,10 +22379,14 @@ var BaseLinter = class {
22344
22379
  break;
22345
22380
  }
22346
22381
  }
22347
- } catch (ex) {
22382
+ } catch (err) {
22348
22383
  this.outputChannel.appendLine(`${"#".repeat(10)} Linter ${this.info.id} failed to parse the line:`);
22349
22384
  this.outputChannel.appendLine(line);
22350
- this.outputChannel.appendLine(ex);
22385
+ if (typeof err === "string") {
22386
+ this.outputChannel.appendLine(err);
22387
+ } else if (err instanceof Error) {
22388
+ this.outputChannel.appendLine(err.message);
22389
+ }
22351
22390
  }
22352
22391
  }
22353
22392
  return messages;
@@ -22355,11 +22394,10 @@ var BaseLinter = class {
22355
22394
  };
22356
22395
 
22357
22396
  // src/linters/bandit.ts
22358
- "use strict";
22359
22397
  var severityMapping = {
22360
- LOW: LintMessageSeverity.Information,
22361
- MEDIUM: LintMessageSeverity.Warning,
22362
- HIGH: LintMessageSeverity.Error
22398
+ LOW: 3 /* Information */,
22399
+ MEDIUM: 2 /* Warning */,
22400
+ HIGH: 1 /* Error */
22363
22401
  };
22364
22402
  var Bandit = class extends BaseLinter {
22365
22403
  constructor(info, outputChannel) {
@@ -22375,7 +22413,7 @@ var Bandit = class extends BaseLinter {
22375
22413
  };
22376
22414
 
22377
22415
  // src/linters/flake8.ts
22378
- var import_coc12 = __toModule(require("coc.nvim"));
22416
+ var import_coc12 = require("coc.nvim");
22379
22417
  var COLUMN_OFF_SET = 1;
22380
22418
  var Flake8 = class extends BaseLinter {
22381
22419
  constructor(info, outputChannel) {
@@ -22391,7 +22429,7 @@ var Flake8 = class extends BaseLinter {
22391
22429
  };
22392
22430
 
22393
22431
  // src/linters/linterInfo.ts
22394
- var path4 = __toModule(require("path"));
22432
+ var path4 = __toESM(require("path"));
22395
22433
  var LinterInfo = class {
22396
22434
  constructor(product, id, configService, configFileNames = []) {
22397
22435
  this.configService = configService;
@@ -22442,7 +22480,7 @@ var LinterInfo = class {
22442
22480
  };
22443
22481
 
22444
22482
  // src/linters/mypy.ts
22445
- var import_coc13 = __toModule(require("coc.nvim"));
22483
+ var import_coc13 = require("coc.nvim");
22446
22484
  var COLUMN_OFF_SET2 = 1;
22447
22485
  var REGEX2 = "(?<file>[^:]+):(?<line>\\d+)(:(?<column>\\d+))?: (?<type>\\w+): (?<message>.*)\\r?(\\n|$)";
22448
22486
  var MyPy = class extends BaseLinter {
@@ -22460,8 +22498,8 @@ var MyPy = class extends BaseLinter {
22460
22498
  };
22461
22499
 
22462
22500
  // src/linters/prospector.ts
22463
- var import_coc14 = __toModule(require("coc.nvim"));
22464
- var import_path3 = __toModule(require("path"));
22501
+ var import_coc14 = require("coc.nvim");
22502
+ var import_path3 = __toESM(require("path"));
22465
22503
  var Prospector = class extends BaseLinter {
22466
22504
  constructor(info, outputChannel) {
22467
22505
  super(info, outputChannel);
@@ -22494,7 +22532,7 @@ var Prospector = class extends BaseLinter {
22494
22532
  };
22495
22533
 
22496
22534
  // src/linters/pycodestyle.ts
22497
- var import_coc15 = __toModule(require("coc.nvim"));
22535
+ var import_coc15 = require("coc.nvim");
22498
22536
  var COLUMN_OFF_SET3 = 1;
22499
22537
  var PyCodeStyle = class extends BaseLinter {
22500
22538
  constructor(info, outputChannel) {
@@ -22510,8 +22548,8 @@ var PyCodeStyle = class extends BaseLinter {
22510
22548
  };
22511
22549
 
22512
22550
  // src/linters/pydocstyle.ts
22513
- var import_coc16 = __toModule(require("coc.nvim"));
22514
- var path6 = __toModule(require("path"));
22551
+ var import_coc16 = require("coc.nvim");
22552
+ var path6 = __toESM(require("path"));
22515
22553
  var PyDocStyle = class extends BaseLinter {
22516
22554
  constructor(info, outputChannel) {
22517
22555
  super(info, outputChannel);
@@ -22522,7 +22560,7 @@ var PyDocStyle = class extends BaseLinter {
22522
22560
  return [];
22523
22561
  const messages = await this.run([import_coc16.Uri.parse(document.uri).fsPath], document, cancellation);
22524
22562
  messages.forEach((msg) => {
22525
- msg.severity = LintMessageSeverity.Warning;
22563
+ msg.severity = 2 /* Warning */;
22526
22564
  });
22527
22565
  return messages;
22528
22566
  }
@@ -22561,9 +22599,13 @@ var PyDocStyle = class extends BaseLinter {
22561
22599
  type: "",
22562
22600
  provider: this.info.id
22563
22601
  };
22564
- } catch (ex) {
22602
+ } catch (err) {
22565
22603
  this.outputChannel.appendLine(`Failed to parse pydocstyle line '${line}'`);
22566
- this.outputChannel.appendLine(ex.message);
22604
+ if (typeof err === "string") {
22605
+ this.outputChannel.appendLine(err);
22606
+ } else if (err instanceof Error) {
22607
+ this.outputChannel.appendLine(err.message);
22608
+ }
22567
22609
  return;
22568
22610
  }
22569
22611
  }).filter((item) => item !== void 0).map((item) => item);
@@ -22571,7 +22613,7 @@ var PyDocStyle = class extends BaseLinter {
22571
22613
  };
22572
22614
 
22573
22615
  // src/linters/pylama.ts
22574
- var import_coc17 = __toModule(require("coc.nvim"));
22616
+ var import_coc17 = require("coc.nvim");
22575
22617
  var REGEX3 = "(?<file>.py):(?<line>\\d+):(?<column>\\d+): \\[(?<type>\\w+)\\] (?<code>\\w\\d+):? (?<message>.*)\\r?(\\n|$)";
22576
22618
  var COLUMN_OFF_SET4 = 1;
22577
22619
  var PyLama = class extends BaseLinter {
@@ -22581,14 +22623,14 @@ var PyLama = class extends BaseLinter {
22581
22623
  async runLinter(document, cancellation) {
22582
22624
  const messages = await this.run(["--format=parsable", import_coc17.Uri.parse(document.uri).fsPath], document, cancellation, REGEX3);
22583
22625
  messages.forEach((msg) => {
22584
- msg.severity = LintMessageSeverity.Warning;
22626
+ msg.severity = 2 /* Warning */;
22585
22627
  });
22586
22628
  return messages;
22587
22629
  }
22588
22630
  };
22589
22631
 
22590
22632
  // src/linters/pylint.ts
22591
- var import_coc18 = __toModule(require("coc.nvim"));
22633
+ var import_coc18 = require("coc.nvim");
22592
22634
  var REGEX4 = "(?<line>\\d+),(?<column>-?\\d+),(?<type>\\w+),(?<code>[\\w-]+):(?<message>.*)\\r?(\\n|$)";
22593
22635
  var Pylint = class extends BaseLinter {
22594
22636
  constructor(info, outputChannel) {
@@ -22606,9 +22648,9 @@ var Pylint = class extends BaseLinter {
22606
22648
  };
22607
22649
 
22608
22650
  // src/linters/pytype.ts
22609
- var import_coc19 = __toModule(require("coc.nvim"));
22610
- var import_fs_extra4 = __toModule(require_lib());
22611
- var path7 = __toModule(require("path"));
22651
+ var import_coc19 = require("coc.nvim");
22652
+ var import_fs_extra4 = __toESM(require_lib());
22653
+ var path7 = __toESM(require("path"));
22612
22654
  var pytypecfg = "pytype.cfg";
22613
22655
  var REGEX5 = '^File \\"(?<file>.*)\\", line (?<line>\\d+), in (<module>|\\w+): (?<message>.*)\\r?(\\n|$)';
22614
22656
  var pytypeErrors = [
@@ -22675,11 +22717,11 @@ var Pytype = class extends BaseLinter {
22675
22717
  });
22676
22718
  for (const msg of messages) {
22677
22719
  msg.type = "Hint";
22678
- msg.severity = LintMessageSeverity.Hint;
22720
+ msg.severity = 0 /* Hint */;
22679
22721
  const match = /\[(.*)\]/g.exec(msg.message);
22680
22722
  if (match && match.length >= 2) {
22681
22723
  if (pytypeErrors.includes(match[1])) {
22682
- msg.severity = LintMessageSeverity.Error;
22724
+ msg.severity = 1 /* Error */;
22683
22725
  }
22684
22726
  }
22685
22727
  }
@@ -22715,19 +22757,18 @@ var Pytype = class extends BaseLinter {
22715
22757
  };
22716
22758
 
22717
22759
  // src/linters/lintingEngine.ts
22718
- "use strict";
22719
22760
  var PYTHON = { language: "python" };
22720
- var lintSeverityToVSSeverity = new Map();
22721
- lintSeverityToVSSeverity.set(LintMessageSeverity.Error, import_coc20.DiagnosticSeverity.Error);
22722
- lintSeverityToVSSeverity.set(LintMessageSeverity.Hint, import_coc20.DiagnosticSeverity.Hint);
22723
- lintSeverityToVSSeverity.set(LintMessageSeverity.Information, import_coc20.DiagnosticSeverity.Information);
22724
- lintSeverityToVSSeverity.set(LintMessageSeverity.Warning, import_coc20.DiagnosticSeverity.Warning);
22761
+ var lintSeverityToVSSeverity = /* @__PURE__ */ new Map();
22762
+ lintSeverityToVSSeverity.set(1 /* Error */, import_coc20.DiagnosticSeverity.Error);
22763
+ lintSeverityToVSSeverity.set(0 /* Hint */, import_coc20.DiagnosticSeverity.Hint);
22764
+ lintSeverityToVSSeverity.set(3 /* Information */, import_coc20.DiagnosticSeverity.Information);
22765
+ lintSeverityToVSSeverity.set(2 /* Warning */, import_coc20.DiagnosticSeverity.Warning);
22725
22766
  var DisabledLinter = class {
22726
22767
  constructor(configService) {
22727
22768
  this.configService = configService;
22728
22769
  }
22729
22770
  get info() {
22730
- return new LinterInfo(Product.pylint, "pylint", this.configService);
22771
+ return new LinterInfo(1 /* pylint */, "pylint", this.configService);
22731
22772
  }
22732
22773
  async lint() {
22733
22774
  return [];
@@ -22735,20 +22776,20 @@ var DisabledLinter = class {
22735
22776
  };
22736
22777
  var LintingEngine = class {
22737
22778
  constructor() {
22738
- this.pendingLintings = new Map();
22779
+ this.pendingLintings = /* @__PURE__ */ new Map();
22739
22780
  this.outputChannel = import_coc20.window.createOutputChannel("coc-pyright-linting");
22740
22781
  this.diagnosticCollection = import_coc20.languages.createDiagnosticCollection("python");
22741
22782
  this.configService = PythonSettings.getInstance();
22742
22783
  this.linters = [
22743
- new LinterInfo(Product.bandit, "bandit", this.configService),
22744
- new LinterInfo(Product.flake8, "flake8", this.configService),
22745
- new LinterInfo(Product.pylint, "pylint", this.configService, [".pylintrc", "pylintrc"]),
22746
- new LinterInfo(Product.mypy, "mypy", this.configService),
22747
- new LinterInfo(Product.pycodestyle, "pycodestyle", this.configService),
22748
- new LinterInfo(Product.prospector, "prospector", this.configService),
22749
- new LinterInfo(Product.pydocstyle, "pydocstyle", this.configService),
22750
- new LinterInfo(Product.pylama, "pylama", this.configService),
22751
- new LinterInfo(Product.pytype, "pytype", this.configService)
22784
+ new LinterInfo(8 /* bandit */, "bandit", this.configService),
22785
+ new LinterInfo(2 /* flake8 */, "flake8", this.configService),
22786
+ new LinterInfo(1 /* pylint */, "pylint", this.configService, [".pylintrc", "pylintrc"]),
22787
+ new LinterInfo(7 /* mypy */, "mypy", this.configService),
22788
+ new LinterInfo(3 /* pycodestyle */, "pycodestyle", this.configService),
22789
+ new LinterInfo(5 /* prospector */, "prospector", this.configService),
22790
+ new LinterInfo(6 /* pydocstyle */, "pydocstyle", this.configService),
22791
+ new LinterInfo(4 /* pylama */, "pylama", this.configService),
22792
+ new LinterInfo(9 /* pytype */, "pytype", this.configService)
22752
22793
  ];
22753
22794
  }
22754
22795
  get diagnostics() {
@@ -22872,23 +22913,23 @@ var LintingEngine = class {
22872
22913
  }
22873
22914
  const error = "Linter manager: Unknown linter";
22874
22915
  switch (info.product) {
22875
- case Product.bandit:
22916
+ case 8 /* bandit */:
22876
22917
  return new Bandit(info, outputChannel);
22877
- case Product.flake8:
22918
+ case 2 /* flake8 */:
22878
22919
  return new Flake8(info, outputChannel);
22879
- case Product.pylint:
22920
+ case 1 /* pylint */:
22880
22921
  return new Pylint(info, outputChannel);
22881
- case Product.mypy:
22922
+ case 7 /* mypy */:
22882
22923
  return new MyPy(info, outputChannel);
22883
- case Product.prospector:
22924
+ case 5 /* prospector */:
22884
22925
  return new Prospector(info, outputChannel);
22885
- case Product.pylama:
22926
+ case 4 /* pylama */:
22886
22927
  return new PyLama(info, outputChannel);
22887
- case Product.pydocstyle:
22928
+ case 6 /* pydocstyle */:
22888
22929
  return new PyDocStyle(info, outputChannel);
22889
- case Product.pycodestyle:
22930
+ case 3 /* pycodestyle */:
22890
22931
  return new PyCodeStyle(info, outputChannel);
22891
- case Product.pytype:
22932
+ case 9 /* pytype */:
22892
22933
  return new Pytype(info, outputChannel);
22893
22934
  default:
22894
22935
  break;
@@ -22948,11 +22989,11 @@ var LinterProvider = class {
22948
22989
  };
22949
22990
 
22950
22991
  // src/refactorProvider.ts
22951
- var import_coc23 = __toModule(require("coc.nvim"));
22992
+ var import_coc23 = require("coc.nvim");
22952
22993
 
22953
22994
  // src/refactorProxy.ts
22954
- var import_coc22 = __toModule(require("coc.nvim"));
22955
- var path9 = __toModule(require("path"));
22995
+ var import_coc22 = require("coc.nvim");
22996
+ var path9 = __toESM(require("path"));
22956
22997
  var RefactorProxy = class {
22957
22998
  constructor(extensionDir, pythonSettings, workspaceRoot) {
22958
22999
  this.pythonSettings = pythonSettings;
@@ -23197,7 +23238,7 @@ async function applyImports(doc, resp, outputChannel) {
23197
23238
  if (typeof error === "string") {
23198
23239
  errorMessage = error;
23199
23240
  }
23200
- if (typeof error === "object" && error.message) {
23241
+ if (error instanceof Error) {
23201
23242
  errorMessage = error.message;
23202
23243
  }
23203
23244
  outputChannel.appendLine(`${"#".repeat(10)}Rope Output${"#".repeat(10)}`);
@@ -23247,7 +23288,7 @@ async function extractName(textEditor, newName, renameResponse, outputChannel) {
23247
23288
  if (typeof error === "string") {
23248
23289
  errorMessage = error;
23249
23290
  }
23250
- if (typeof error === "object" && error.message) {
23291
+ if (error instanceof Error) {
23251
23292
  errorMessage = error.message;
23252
23293
  }
23253
23294
  outputChannel.appendLine(`${"#".repeat(10)}Refactor Output${"#".repeat(10)}`);
@@ -23283,7 +23324,7 @@ function toJSONObject(obj) {
23283
23324
  if (Array.isArray(obj)) {
23284
23325
  return obj.map(toJSONObject);
23285
23326
  } else if (typeof obj === "object") {
23286
- const res = Object.create(null);
23327
+ const res = /* @__PURE__ */ Object.create(null);
23287
23328
  for (const key in obj) {
23288
23329
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
23289
23330
  res[key] = toJSONObject(obj[key]);
@@ -23435,8 +23476,11 @@ async function activate(context) {
23435
23476
  context.subscriptions.push(new LinterProvider(context));
23436
23477
  const codeActionProvider = new PythonCodeActionProvider();
23437
23478
  context.subscriptions.push(import_coc24.languages.registerCodeActionProvider(documentSelector, codeActionProvider, "Pyright"));
23438
- const provider = new ImportCompletionProvider();
23439
- context.subscriptions.push(import_coc24.languages.registerCompletionItemProvider("python-import", "PY", "python", provider, [" "]));
23479
+ const importSupport = pyrightCfg.get("completion.importSupport");
23480
+ if (importSupport) {
23481
+ const provider = new ImportCompletionProvider();
23482
+ context.subscriptions.push(import_coc24.languages.registerCompletionItemProvider("python-import", "PY", ["python"], provider, [" "]));
23483
+ }
23440
23484
  const textEditorCommands = ["pyright.organizeimports", "pyright.addoptionalforparam"];
23441
23485
  textEditorCommands.forEach((commandName) => {
23442
23486
  context.subscriptions.push(import_coc24.commands.registerCommand(commandName, async (offset) => {
@@ -23522,11 +23566,12 @@ var ImportCompletionProvider = class {
23522
23566
  return [];
23523
23567
  const items = [];
23524
23568
  for (const o of result.items) {
23525
- items.push({ label: o.word, sortText: o.sortText });
23569
+ items.push({ label: o.word, sortText: o.sortText, kind: import_coc24.CompletionItemKind.Module, filterText: o.filterText });
23526
23570
  }
23527
23571
  return items;
23528
23572
  }
23529
23573
  };
23574
+ module.exports = __toCommonJS(src_exports);
23530
23575
  // Annotate the CommonJS export names for ESM import in node:
23531
23576
  0 && (module.exports = {
23532
23577
  activate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.189",
3
+ "version": "1.1.206",
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",
@@ -39,15 +39,15 @@
39
39
  "@types/fs-extra": "^9.0.2",
40
40
  "@types/md5": "^2.2.0",
41
41
  "@types/minimatch": "^3.0.3",
42
- "@types/node": "10.12.0",
42
+ "@types/node": "12.12",
43
43
  "@types/semver": "^7.3.9",
44
44
  "@types/which": "^2.0.0",
45
- "@typescript-eslint/eslint-plugin": "^5.4.0",
46
- "@typescript-eslint/parser": "^5.4.0",
45
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
46
+ "@typescript-eslint/parser": "^5.6.0",
47
47
  "coc.nvim": "^0.0.81-next.7",
48
48
  "diff-match-patch": "^1.0.5",
49
- "esbuild": "^0.13.15",
50
- "eslint": "^8.3.0",
49
+ "esbuild": "^0.14.2",
50
+ "eslint": "^8.4.1",
51
51
  "fs-extra": "^10.0.0",
52
52
  "iconv-lite": "^0.6.2",
53
53
  "md5": "^2.3.0",
@@ -57,7 +57,7 @@
57
57
  "rxjs-compat": "^6.6.7",
58
58
  "semver": "^7.3.2",
59
59
  "tree-kill": "^1.2.2",
60
- "typescript": "^4.5.2",
60
+ "typescript": "^4.5.3",
61
61
  "untildify": "^4.0.0",
62
62
  "which": "^2.0.2"
63
63
  },
@@ -163,7 +163,7 @@
163
163
  "reportPropertyTypeMismatch": {
164
164
  "type": "string",
165
165
  "description": "Diagnostics for property whose setter and getter have mismatched types.",
166
- "default": "error",
166
+ "default": "none",
167
167
  "enum": [
168
168
  "none",
169
169
  "information",
@@ -710,6 +710,17 @@
710
710
  "error"
711
711
  ]
712
712
  },
713
+ "reportUnsupportedDunderAll": {
714
+ "type": "string",
715
+ "description": "Diagnostics for unsupported operations performed on __all__.",
716
+ "default": "warning",
717
+ "enum": [
718
+ "none",
719
+ "information",
720
+ "warning",
721
+ "error"
722
+ ]
723
+ },
713
724
  "reportUnusedCallResult": {
714
725
  "type": "string",
715
726
  "description": "Diagnostics for call expressions whose results are not consumed and are not None.",
@@ -732,10 +743,10 @@
732
743
  "error"
733
744
  ]
734
745
  },
735
- "reportUnsupportedDunderAll": {
746
+ "reportUnnecessaryTypeIgnoreComment": {
736
747
  "type": "string",
737
- "description": "Diagnostics for unsupported operations performed on __all__.",
738
- "default": "warning",
748
+ "description": "Diagnostics for '# type: ignore' comments that have no effect.",
749
+ "default": "none",
739
750
  "enum": [
740
751
  "none",
741
752
  "information",
@@ -777,7 +788,7 @@
777
788
  "python.linting.enabled": {
778
789
  "type": "boolean",
779
790
  "default": true,
780
- "description": "Whether to lint Python files.",
791
+ "description": "Whether to lint Python files with external linters, you can also disable diagnostics from Pyright by `pyright.disableDiagnostics` to use external linters only.",
781
792
  "scope": "resource"
782
793
  },
783
794
  "python.linting.flake8Args": {
@@ -1271,6 +1282,11 @@
1271
1282
  "default": false,
1272
1283
  "description": "Disable diagnostics from Pyright"
1273
1284
  },
1285
+ "pyright.completion.importSupport": {
1286
+ "type": "boolean",
1287
+ "default": true,
1288
+ "description": "Enable `python-import` completion source, will list suggestions after input `import`"
1289
+ },
1274
1290
  "pyright.completion.snippetSupport": {
1275
1291
  "type": "boolean",
1276
1292
  "default": true,
@@ -1342,6 +1358,6 @@
1342
1358
  ]
1343
1359
  },
1344
1360
  "dependencies": {
1345
- "pyright": "^1.1.189"
1361
+ "pyright": "^1.1.206"
1346
1362
  }
1347
1363
  }
@@ -141,7 +141,7 @@
141
141
  "$id": "#/properties/reportPropertyTypeMismatch",
142
142
  "$ref": "#/definitions/diagnostic",
143
143
  "title": "Controls reporting of property getter/setter type mismatches",
144
- "default": "error"
144
+ "default": "none"
145
145
  },
146
146
  "reportFunctionMemberAccess": {
147
147
  "$id": "#/properties/reportFunctionMemberAccess",
@@ -455,12 +455,18 @@
455
455
  "title": "Controls reporting of call expressions that returns Coroutine whose results are not consumed",
456
456
  "default": "error"
457
457
  },
458
+ "reportUnnecessaryTypeIgnoreComment": {
459
+ "$id": "#/properties/reportUnnecessaryTypeIgnoreComment",
460
+ "$ref": "#/definitions/diagnostic",
461
+ "title": "Controls reporting of '# type: ignore' comments that have no effect'",
462
+ "default": "none"
463
+ },
458
464
  "extraPaths": {
459
- "$id": "#/properties/executionEnvironments/items/properties/extraPaths",
465
+ "$id": "#/properties/extraPaths",
460
466
  "type": "array",
461
467
  "title": "Additional import search resolution paths",
462
468
  "items": {
463
- "$id": "#/properties/executionEnvironments/items/properties/extraPaths/items",
469
+ "$id": "#/properties/extraPaths/items",
464
470
  "type": "string",
465
471
  "title": "Additional import search resolution path",
466
472
  "default": "",
@@ -542,7 +548,7 @@
542
548
  }
543
549
  },
544
550
  "pythonVersion": {
545
- "$id": "#/properties/pythonVersion",
551
+ "$id": "#/properties/executionEnvironments/items/properties/pythonVersion",
546
552
  "type": "string",
547
553
  "title": "Python version to assume during type analysis",
548
554
  "default": "",
@@ -552,7 +558,7 @@
552
558
  "pattern": "^3\\.[0-9]+$"
553
559
  },
554
560
  "pythonPlatform": {
555
- "$id": "#/properties/pythonPlatform",
561
+ "$id": "#/properties/executionEnvironments/items/properties/pythonPlatform",
556
562
  "type": "string",
557
563
  "title": "Python platform to assume during type analysis",
558
564
  "default": "",