coc-pyright 1.1.194 → 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 |
@@ -71,6 +71,8 @@ These configurations are used by `coc-pyright`, you need to set them in your `co
71
71
  | pyright.completion.snippetSupport | Enable completion snippets support | true |
72
72
  | pyright.organizeimports.provider | Organize imports provider, `pyright` or `isort` | pyright |
73
73
 
74
+ Additional configuration options can be found in [package.json](./package.json).
75
+
74
76
  ## pyrightconfig.json
75
77
 
76
78
  Pyright supports [pyrightconfig.json](https://github.com/microsoft/pyright/blob/master/docs/configuration.md) that provide granular control over settings.
@@ -115,4 +117,4 @@ MIT
115
117
 
116
118
  ---
117
119
 
118
- > 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({
@@ -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;
@@ -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);
@@ -21374,20 +21406,20 @@ 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
21424
  var Edit = class {
21393
21425
  constructor(action, start) {
@@ -21580,13 +21612,12 @@ function getWindowsLineEndingCount(document, offset) {
21580
21612
  }
21581
21613
 
21582
21614
  // src/processService.ts
21583
- var import_child_process = __toModule(require("child_process"));
21584
- var iconv = __toModule(require_lib2());
21585
- var import_os2 = __toModule(require("os"));
21586
- 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());
21587
21619
 
21588
21620
  // src/async.ts
21589
- "use strict";
21590
21621
  var DeferredImpl = class {
21591
21622
  constructor(scope = null) {
21592
21623
  this.scope = scope;
@@ -21952,7 +21983,7 @@ var AutoPep8Formatter = class extends BaseFormatter {
21952
21983
  };
21953
21984
 
21954
21985
  // src/formatters/black.ts
21955
- var import_coc5 = __toModule(require("coc.nvim"));
21986
+ var import_coc5 = require("coc.nvim");
21956
21987
  var BlackFormatter = class extends BaseFormatter {
21957
21988
  constructor(pythonSettings, outputChannel) {
21958
21989
  super("black", pythonSettings, outputChannel);
@@ -22002,7 +22033,7 @@ var YapfFormatter = class extends BaseFormatter {
22002
22033
  };
22003
22034
 
22004
22035
  // src/formatters/darker.ts
22005
- var import_coc6 = __toModule(require("coc.nvim"));
22036
+ var import_coc6 = require("coc.nvim");
22006
22037
  var DarkerFormatter = class extends BaseFormatter {
22007
22038
  constructor(pythonSettings, outputChannel) {
22008
22039
  super("darker", pythonSettings, outputChannel);
@@ -22024,8 +22055,8 @@ var DarkerFormatter = class extends BaseFormatter {
22024
22055
  };
22025
22056
 
22026
22057
  // src/formatters/blackd.ts
22027
- var import_coc7 = __toModule(require("coc.nvim"));
22028
- var import_child_process2 = __toModule(require("child_process"));
22058
+ var import_coc7 = require("coc.nvim");
22059
+ var import_child_process2 = require("child_process");
22029
22060
  var BlackdFormatter = class extends BaseFormatter {
22030
22061
  constructor(pythonSettings, outputChannel) {
22031
22062
  super("blackd", pythonSettings, outputChannel);
@@ -22134,10 +22165,10 @@ var PythonFormattingEditProvider = class {
22134
22165
  };
22135
22166
 
22136
22167
  // src/isortProvider.ts
22137
- var import_coc9 = __toModule(require("coc.nvim"));
22138
- var import_fs_extra3 = __toModule(require_lib());
22139
- var import_md52 = __toModule(require_md5());
22140
- 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"));
22141
22172
  function getTempFileWithDocumentContents2(document) {
22142
22173
  return new Promise((resolve, reject) => {
22143
22174
  const fsPath = import_coc9.Uri.parse(document.uri).fsPath;
@@ -22192,13 +22223,13 @@ ${message}`);
22192
22223
  }
22193
22224
 
22194
22225
  // src/linterProvider.ts
22195
- var import_coc21 = __toModule(require("coc.nvim"));
22226
+ var import_coc21 = require("coc.nvim");
22196
22227
 
22197
22228
  // src/linters/lintingEngine.ts
22198
- var import_coc20 = __toModule(require("coc.nvim"));
22199
- var import_fs_extra5 = __toModule(require_lib());
22200
- var import_minimatch = __toModule(require_minimatch());
22201
- 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"));
22202
22233
 
22203
22234
  // src/types.ts
22204
22235
  var Product = /* @__PURE__ */ ((Product2) => {
@@ -22243,12 +22274,11 @@ var LinterErrors;
22243
22274
  })(LinterErrors || (LinterErrors = {}));
22244
22275
 
22245
22276
  // src/linters/bandit.ts
22246
- var import_coc11 = __toModule(require("coc.nvim"));
22277
+ var import_coc11 = require("coc.nvim");
22247
22278
 
22248
22279
  // src/linters/baseLinter.ts
22249
- var import_coc10 = __toModule(require("coc.nvim"));
22250
- var import_named_js_regexp = __toModule(require_named_js_regexp());
22251
- "use strict";
22280
+ var import_coc10 = require("coc.nvim");
22281
+ var import_named_js_regexp = __toESM(require_named_js_regexp());
22252
22282
  var REGEX = "(?<line>\\d+),(?<column>-?\\d+),(?<type>\\w+),(?<code>\\w+\\d+):(?<message>.*)\\r?(\\n|$)";
22253
22283
  function matchNamedRegEx(data, regex) {
22254
22284
  const compiledRegexp = (0, import_named_js_regexp.default)(regex, "g");
@@ -22297,13 +22327,13 @@ var BaseLinter = class {
22297
22327
  const severityName = categorySeverity[error];
22298
22328
  switch (severityName) {
22299
22329
  case "Error":
22300
- return LintMessageSeverity.Error;
22330
+ return 1 /* Error */;
22301
22331
  case "Hint":
22302
- return LintMessageSeverity.Hint;
22332
+ return 0 /* Hint */;
22303
22333
  case "Information":
22304
- return LintMessageSeverity.Information;
22334
+ return 3 /* Information */;
22305
22335
  case "Warning":
22306
- return LintMessageSeverity.Warning;
22336
+ return 2 /* Warning */;
22307
22337
  default: {
22308
22338
  if (LintMessageSeverity[severityName]) {
22309
22339
  return LintMessageSeverity[severityName];
@@ -22311,7 +22341,7 @@ var BaseLinter = class {
22311
22341
  }
22312
22342
  }
22313
22343
  }
22314
- return LintMessageSeverity.Information;
22344
+ return 3 /* Information */;
22315
22345
  }
22316
22346
  async run(args, document, cancellation, regEx = REGEX) {
22317
22347
  if (!this.info.isEnabled(import_coc10.Uri.parse(document.uri))) {
@@ -22364,11 +22394,10 @@ var BaseLinter = class {
22364
22394
  };
22365
22395
 
22366
22396
  // src/linters/bandit.ts
22367
- "use strict";
22368
22397
  var severityMapping = {
22369
- LOW: LintMessageSeverity.Information,
22370
- MEDIUM: LintMessageSeverity.Warning,
22371
- HIGH: LintMessageSeverity.Error
22398
+ LOW: 3 /* Information */,
22399
+ MEDIUM: 2 /* Warning */,
22400
+ HIGH: 1 /* Error */
22372
22401
  };
22373
22402
  var Bandit = class extends BaseLinter {
22374
22403
  constructor(info, outputChannel) {
@@ -22384,7 +22413,7 @@ var Bandit = class extends BaseLinter {
22384
22413
  };
22385
22414
 
22386
22415
  // src/linters/flake8.ts
22387
- var import_coc12 = __toModule(require("coc.nvim"));
22416
+ var import_coc12 = require("coc.nvim");
22388
22417
  var COLUMN_OFF_SET = 1;
22389
22418
  var Flake8 = class extends BaseLinter {
22390
22419
  constructor(info, outputChannel) {
@@ -22400,7 +22429,7 @@ var Flake8 = class extends BaseLinter {
22400
22429
  };
22401
22430
 
22402
22431
  // src/linters/linterInfo.ts
22403
- var path4 = __toModule(require("path"));
22432
+ var path4 = __toESM(require("path"));
22404
22433
  var LinterInfo = class {
22405
22434
  constructor(product, id, configService, configFileNames = []) {
22406
22435
  this.configService = configService;
@@ -22451,7 +22480,7 @@ var LinterInfo = class {
22451
22480
  };
22452
22481
 
22453
22482
  // src/linters/mypy.ts
22454
- var import_coc13 = __toModule(require("coc.nvim"));
22483
+ var import_coc13 = require("coc.nvim");
22455
22484
  var COLUMN_OFF_SET2 = 1;
22456
22485
  var REGEX2 = "(?<file>[^:]+):(?<line>\\d+)(:(?<column>\\d+))?: (?<type>\\w+): (?<message>.*)\\r?(\\n|$)";
22457
22486
  var MyPy = class extends BaseLinter {
@@ -22469,8 +22498,8 @@ var MyPy = class extends BaseLinter {
22469
22498
  };
22470
22499
 
22471
22500
  // src/linters/prospector.ts
22472
- var import_coc14 = __toModule(require("coc.nvim"));
22473
- var import_path3 = __toModule(require("path"));
22501
+ var import_coc14 = require("coc.nvim");
22502
+ var import_path3 = __toESM(require("path"));
22474
22503
  var Prospector = class extends BaseLinter {
22475
22504
  constructor(info, outputChannel) {
22476
22505
  super(info, outputChannel);
@@ -22503,7 +22532,7 @@ var Prospector = class extends BaseLinter {
22503
22532
  };
22504
22533
 
22505
22534
  // src/linters/pycodestyle.ts
22506
- var import_coc15 = __toModule(require("coc.nvim"));
22535
+ var import_coc15 = require("coc.nvim");
22507
22536
  var COLUMN_OFF_SET3 = 1;
22508
22537
  var PyCodeStyle = class extends BaseLinter {
22509
22538
  constructor(info, outputChannel) {
@@ -22519,8 +22548,8 @@ var PyCodeStyle = class extends BaseLinter {
22519
22548
  };
22520
22549
 
22521
22550
  // src/linters/pydocstyle.ts
22522
- var import_coc16 = __toModule(require("coc.nvim"));
22523
- var path6 = __toModule(require("path"));
22551
+ var import_coc16 = require("coc.nvim");
22552
+ var path6 = __toESM(require("path"));
22524
22553
  var PyDocStyle = class extends BaseLinter {
22525
22554
  constructor(info, outputChannel) {
22526
22555
  super(info, outputChannel);
@@ -22531,7 +22560,7 @@ var PyDocStyle = class extends BaseLinter {
22531
22560
  return [];
22532
22561
  const messages = await this.run([import_coc16.Uri.parse(document.uri).fsPath], document, cancellation);
22533
22562
  messages.forEach((msg) => {
22534
- msg.severity = LintMessageSeverity.Warning;
22563
+ msg.severity = 2 /* Warning */;
22535
22564
  });
22536
22565
  return messages;
22537
22566
  }
@@ -22584,7 +22613,7 @@ var PyDocStyle = class extends BaseLinter {
22584
22613
  };
22585
22614
 
22586
22615
  // src/linters/pylama.ts
22587
- var import_coc17 = __toModule(require("coc.nvim"));
22616
+ var import_coc17 = require("coc.nvim");
22588
22617
  var REGEX3 = "(?<file>.py):(?<line>\\d+):(?<column>\\d+): \\[(?<type>\\w+)\\] (?<code>\\w\\d+):? (?<message>.*)\\r?(\\n|$)";
22589
22618
  var COLUMN_OFF_SET4 = 1;
22590
22619
  var PyLama = class extends BaseLinter {
@@ -22594,14 +22623,14 @@ var PyLama = class extends BaseLinter {
22594
22623
  async runLinter(document, cancellation) {
22595
22624
  const messages = await this.run(["--format=parsable", import_coc17.Uri.parse(document.uri).fsPath], document, cancellation, REGEX3);
22596
22625
  messages.forEach((msg) => {
22597
- msg.severity = LintMessageSeverity.Warning;
22626
+ msg.severity = 2 /* Warning */;
22598
22627
  });
22599
22628
  return messages;
22600
22629
  }
22601
22630
  };
22602
22631
 
22603
22632
  // src/linters/pylint.ts
22604
- var import_coc18 = __toModule(require("coc.nvim"));
22633
+ var import_coc18 = require("coc.nvim");
22605
22634
  var REGEX4 = "(?<line>\\d+),(?<column>-?\\d+),(?<type>\\w+),(?<code>[\\w-]+):(?<message>.*)\\r?(\\n|$)";
22606
22635
  var Pylint = class extends BaseLinter {
22607
22636
  constructor(info, outputChannel) {
@@ -22619,9 +22648,9 @@ var Pylint = class extends BaseLinter {
22619
22648
  };
22620
22649
 
22621
22650
  // src/linters/pytype.ts
22622
- var import_coc19 = __toModule(require("coc.nvim"));
22623
- var import_fs_extra4 = __toModule(require_lib());
22624
- 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"));
22625
22654
  var pytypecfg = "pytype.cfg";
22626
22655
  var REGEX5 = '^File \\"(?<file>.*)\\", line (?<line>\\d+), in (<module>|\\w+): (?<message>.*)\\r?(\\n|$)';
22627
22656
  var pytypeErrors = [
@@ -22688,11 +22717,11 @@ var Pytype = class extends BaseLinter {
22688
22717
  });
22689
22718
  for (const msg of messages) {
22690
22719
  msg.type = "Hint";
22691
- msg.severity = LintMessageSeverity.Hint;
22720
+ msg.severity = 0 /* Hint */;
22692
22721
  const match = /\[(.*)\]/g.exec(msg.message);
22693
22722
  if (match && match.length >= 2) {
22694
22723
  if (pytypeErrors.includes(match[1])) {
22695
- msg.severity = LintMessageSeverity.Error;
22724
+ msg.severity = 1 /* Error */;
22696
22725
  }
22697
22726
  }
22698
22727
  }
@@ -22728,19 +22757,18 @@ var Pytype = class extends BaseLinter {
22728
22757
  };
22729
22758
 
22730
22759
  // src/linters/lintingEngine.ts
22731
- "use strict";
22732
22760
  var PYTHON = { language: "python" };
22733
22761
  var lintSeverityToVSSeverity = /* @__PURE__ */ new Map();
22734
- lintSeverityToVSSeverity.set(LintMessageSeverity.Error, import_coc20.DiagnosticSeverity.Error);
22735
- lintSeverityToVSSeverity.set(LintMessageSeverity.Hint, import_coc20.DiagnosticSeverity.Hint);
22736
- lintSeverityToVSSeverity.set(LintMessageSeverity.Information, import_coc20.DiagnosticSeverity.Information);
22737
- lintSeverityToVSSeverity.set(LintMessageSeverity.Warning, import_coc20.DiagnosticSeverity.Warning);
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);
22738
22766
  var DisabledLinter = class {
22739
22767
  constructor(configService) {
22740
22768
  this.configService = configService;
22741
22769
  }
22742
22770
  get info() {
22743
- return new LinterInfo(Product.pylint, "pylint", this.configService);
22771
+ return new LinterInfo(1 /* pylint */, "pylint", this.configService);
22744
22772
  }
22745
22773
  async lint() {
22746
22774
  return [];
@@ -22753,15 +22781,15 @@ var LintingEngine = class {
22753
22781
  this.diagnosticCollection = import_coc20.languages.createDiagnosticCollection("python");
22754
22782
  this.configService = PythonSettings.getInstance();
22755
22783
  this.linters = [
22756
- new LinterInfo(Product.bandit, "bandit", this.configService),
22757
- new LinterInfo(Product.flake8, "flake8", this.configService),
22758
- new LinterInfo(Product.pylint, "pylint", this.configService, [".pylintrc", "pylintrc"]),
22759
- new LinterInfo(Product.mypy, "mypy", this.configService),
22760
- new LinterInfo(Product.pycodestyle, "pycodestyle", this.configService),
22761
- new LinterInfo(Product.prospector, "prospector", this.configService),
22762
- new LinterInfo(Product.pydocstyle, "pydocstyle", this.configService),
22763
- new LinterInfo(Product.pylama, "pylama", this.configService),
22764
- 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)
22765
22793
  ];
22766
22794
  }
22767
22795
  get diagnostics() {
@@ -22885,23 +22913,23 @@ var LintingEngine = class {
22885
22913
  }
22886
22914
  const error = "Linter manager: Unknown linter";
22887
22915
  switch (info.product) {
22888
- case Product.bandit:
22916
+ case 8 /* bandit */:
22889
22917
  return new Bandit(info, outputChannel);
22890
- case Product.flake8:
22918
+ case 2 /* flake8 */:
22891
22919
  return new Flake8(info, outputChannel);
22892
- case Product.pylint:
22920
+ case 1 /* pylint */:
22893
22921
  return new Pylint(info, outputChannel);
22894
- case Product.mypy:
22922
+ case 7 /* mypy */:
22895
22923
  return new MyPy(info, outputChannel);
22896
- case Product.prospector:
22924
+ case 5 /* prospector */:
22897
22925
  return new Prospector(info, outputChannel);
22898
- case Product.pylama:
22926
+ case 4 /* pylama */:
22899
22927
  return new PyLama(info, outputChannel);
22900
- case Product.pydocstyle:
22928
+ case 6 /* pydocstyle */:
22901
22929
  return new PyDocStyle(info, outputChannel);
22902
- case Product.pycodestyle:
22930
+ case 3 /* pycodestyle */:
22903
22931
  return new PyCodeStyle(info, outputChannel);
22904
- case Product.pytype:
22932
+ case 9 /* pytype */:
22905
22933
  return new Pytype(info, outputChannel);
22906
22934
  default:
22907
22935
  break;
@@ -22961,11 +22989,11 @@ var LinterProvider = class {
22961
22989
  };
22962
22990
 
22963
22991
  // src/refactorProvider.ts
22964
- var import_coc23 = __toModule(require("coc.nvim"));
22992
+ var import_coc23 = require("coc.nvim");
22965
22993
 
22966
22994
  // src/refactorProxy.ts
22967
- var import_coc22 = __toModule(require("coc.nvim"));
22968
- var path9 = __toModule(require("path"));
22995
+ var import_coc22 = require("coc.nvim");
22996
+ var path9 = __toESM(require("path"));
22969
22997
  var RefactorProxy = class {
22970
22998
  constructor(extensionDir, pythonSettings, workspaceRoot) {
22971
22999
  this.pythonSettings = pythonSettings;
@@ -23296,7 +23324,7 @@ function toJSONObject(obj) {
23296
23324
  if (Array.isArray(obj)) {
23297
23325
  return obj.map(toJSONObject);
23298
23326
  } else if (typeof obj === "object") {
23299
- const res = Object.create(null);
23327
+ const res = /* @__PURE__ */ Object.create(null);
23300
23328
  for (const key in obj) {
23301
23329
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
23302
23330
  res[key] = toJSONObject(obj[key]);
@@ -23543,6 +23571,7 @@ var ImportCompletionProvider = class {
23543
23571
  return items;
23544
23572
  }
23545
23573
  };
23574
+ module.exports = __toCommonJS(src_exports);
23546
23575
  // Annotate the CommonJS export names for ESM import in node:
23547
23576
  0 && (module.exports = {
23548
23577
  activate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.194",
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",
@@ -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": {
@@ -1347,6 +1358,6 @@
1347
1358
  ]
1348
1359
  },
1349
1360
  "dependencies": {
1350
- "pyright": "^1.1.194"
1361
+ "pyright": "^1.1.206"
1351
1362
  }
1352
1363
  }
@@ -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": "",