coc-pyright 1.1.252 → 1.1.253

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 (3) hide show
  1. package/README.md +1 -0
  2. package/lib/index.js +24 -21
  3. package/package.json +7 -2
package/README.md CHANGED
@@ -67,6 +67,7 @@ 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.disableProgressNotifications | Disable the initialization and workdone progress notifications | false |
70
71
  | pyright.completion.importSupport | Enable `python-import` completion source support | true |
71
72
  | pyright.completion.snippetSupport | Enable completion snippets support | true |
72
73
  | pyright.organizeimports.provider | Organize imports provider, `pyright` or `isort` | pyright |
package/lib/index.js CHANGED
@@ -21946,7 +21946,7 @@ var BaseFormatter = class {
21946
21946
  }
21947
21947
  const edits = getTextEditsFromPatch(document.getText(), data);
21948
21948
  if (edits.length)
21949
- import_coc4.window.showMessage(`Formatted with ${this.Id}`);
21949
+ import_coc4.window.showInformationMessage(`Formatted with ${this.Id}`);
21950
21950
  return edits;
21951
21951
  }).catch((error) => {
21952
21952
  this.handleError(this.Id, error).catch(() => {
@@ -21968,7 +21968,7 @@ var BaseFormatter = class {
21968
21968
  if (isNotInstalledError(error)) {
21969
21969
  customError = `${customError}: ${this.Id} module is not installed.`;
21970
21970
  }
21971
- import_coc4.window.showMessage(customError, "warning");
21971
+ import_coc4.window.showWarningMessage(customError);
21972
21972
  }
21973
21973
  createTempFile(document) {
21974
21974
  return getTempFileWithDocumentContents(document);
@@ -22024,7 +22024,7 @@ var BlackFormatter = class extends BaseFormatter {
22024
22024
  if (formatSelection) {
22025
22025
  const errorMessage = async () => {
22026
22026
  this.outputChannel.appendLine('Black does not support the "Format Selection" command');
22027
- import_coc5.window.showMessage('Black does not support the "Format Selection" command', "error");
22027
+ import_coc5.window.showErrorMessage('Black does not support the "Format Selection" command');
22028
22028
  return [];
22029
22029
  };
22030
22030
  return errorMessage();
@@ -22287,16 +22287,16 @@ var PythonFormattingEditProvider = class {
22287
22287
  }
22288
22288
  async _provideEdits(document, options, token, range) {
22289
22289
  const provider = this.pythonSettings.formatting.provider;
22290
- const formater = this.formatters.get(provider);
22291
- if (!formater) {
22292
- import_coc8.window.showMessage(`No formatter is set. You need to set "python.formatting.provider" in your coc-settings.json`);
22290
+ const formatter = this.formatters.get(provider);
22291
+ if (!formatter) {
22292
+ import_coc8.window.showWarningMessage(`No formatter is set. You need to set "python.formatting.provider" in your coc-settings.json`);
22293
22293
  this.outputChannel.appendLine(`${"#".repeat(10)} Error: python.formatting.provider is ${provider}, which is not supported`);
22294
22294
  return [];
22295
22295
  }
22296
22296
  this.outputChannel.appendLine(`Using python from ${this.pythonSettings.pythonPath}
22297
22297
  `);
22298
- this.outputChannel.appendLine(`${"#".repeat(10)} active formattor: ${formater.Id}`);
22299
- return await formater.formatDocument(document, options, token, range);
22298
+ this.outputChannel.appendLine(`${"#".repeat(10)} active formattor: ${formatter.Id}`);
22299
+ return await formatter.formatDocument(document, options, token, range);
22300
22300
  }
22301
22301
  provideDocumentFormattingEdits(document, options, token) {
22302
22302
  return this._provideEdits(document, options, token);
@@ -22363,7 +22363,7 @@ async function sortImports(extensionRoot, outputChannel) {
22363
22363
  outputChannel.appendLine(`${"#".repeat(10)} isort Output ${"#".repeat(10)}`);
22364
22364
  outputChannel.appendLine(`Error from isort:
22365
22365
  ${message}`);
22366
- import_coc9.window.showMessage(`Failed to format import by isort`, "error");
22366
+ import_coc9.window.showErrorMessage(`Failed to format import by isort`);
22367
22367
  }
22368
22368
  }
22369
22369
 
@@ -23285,7 +23285,7 @@ async function checkDocument(doc) {
23285
23285
  return false;
23286
23286
  const modified = await doc.buffer.getOption("modified");
23287
23287
  if (modified != 0) {
23288
- import_coc23.window.showMessage("Buffer not saved, please save the buffer first!", "warning");
23288
+ import_coc23.window.showWarningMessage("Buffer not saved, please save the buffer first!");
23289
23289
  return false;
23290
23290
  }
23291
23291
  return true;
@@ -23308,7 +23308,7 @@ async function extractVariable(root, document, range, outputChannel) {
23308
23308
  const pythonToolsExecutionService = new PythonExecutionService();
23309
23309
  const rope = await pythonToolsExecutionService.isModuleInstalled("rope");
23310
23310
  if (!rope) {
23311
- import_coc23.window.showMessage(`Module rope not installed`, "warning");
23311
+ import_coc23.window.showWarningMessage(`Module rope not installed`);
23312
23312
  return;
23313
23313
  }
23314
23314
  const workspaceFolder = import_coc23.workspace.getWorkspaceFolder(doc.uri);
@@ -23331,7 +23331,7 @@ async function extractMethod(root, document, range, outputChannel) {
23331
23331
  const pythonToolsExecutionService = new PythonExecutionService();
23332
23332
  const rope = await pythonToolsExecutionService.isModuleInstalled("rope");
23333
23333
  if (!rope) {
23334
- import_coc23.window.showMessage(`Module rope not installed`, "warning");
23334
+ import_coc23.window.showWarningMessage(`Module rope not installed`);
23335
23335
  return;
23336
23336
  }
23337
23337
  const workspaceFolder = import_coc23.workspace.getWorkspaceFolder(doc.uri);
@@ -23354,7 +23354,7 @@ async function addImport(root, document, name, parent, outputChannel) {
23354
23354
  const pythonToolsExecutionService = new PythonExecutionService();
23355
23355
  const rope = await pythonToolsExecutionService.isModuleInstalled("rope");
23356
23356
  if (!rope) {
23357
- import_coc23.window.showMessage(`Module rope not installed`, "warning");
23357
+ import_coc23.window.showWarningMessage(`Module rope not installed`);
23358
23358
  return;
23359
23359
  }
23360
23360
  let parentModule = "";
@@ -23390,7 +23390,7 @@ async function applyImports(doc, resp, outputChannel) {
23390
23390
  outputChannel.appendLine(`Error in add import:
23391
23391
  ${errorMessage}`);
23392
23392
  outputChannel.appendLine("");
23393
- import_coc23.window.showMessage(`Cannot perform addImport using selected element(s).`, "error");
23393
+ import_coc23.window.showErrorMessage(`Cannot perform addImport using selected element(s).`);
23394
23394
  return await Promise.reject(error);
23395
23395
  }
23396
23396
  }
@@ -23440,7 +23440,7 @@ async function extractName(textEditor, newName, renameResponse, outputChannel) {
23440
23440
  outputChannel.appendLine(`Error in refactoring:
23441
23441
  ${errorMessage}`);
23442
23442
  outputChannel.appendLine("");
23443
- import_coc23.window.showMessage(`Cannot perform refactoring using selected element(s).`, "error");
23443
+ import_coc23.window.showErrorMessage(`Cannot perform refactoring using selected element(s).`);
23444
23444
  return await Promise.reject(error);
23445
23445
  }
23446
23446
  }
@@ -23565,11 +23565,11 @@ async function activate(context) {
23565
23565
  return;
23566
23566
  const state = import_coc24.extensions.getExtensionState("coc-python");
23567
23567
  if (state.toString() === "activated") {
23568
- import_coc24.window.showMessage(`coc-python is installed and activated, coc-pyright will be disabled`, "warning");
23568
+ import_coc24.window.showWarningMessage(`coc-python is installed and activated, coc-pyright will be disabled`);
23569
23569
  return;
23570
23570
  }
23571
23571
  if ((0, import_semver2.lt)(process.versions.node, "12.0.0")) {
23572
- import_coc24.window.showMessage(`Pyright needs Node.js v12+ to work, your Node.js is ${process.version}.`, "error");
23572
+ import_coc24.window.showErrorMessage(`Pyright needs Node.js v12+ to work, your Node.js is ${process.version}.`);
23573
23573
  return;
23574
23574
  }
23575
23575
  let module2 = pyrightCfg.get("server");
@@ -23579,7 +23579,7 @@ async function activate(context) {
23579
23579
  module2 = (0, import_path5.join)(context.extensionPath, "node_modules", "pyright", "langserver.index.js");
23580
23580
  }
23581
23581
  if (!(0, import_fs.existsSync)(module2)) {
23582
- import_coc24.window.showMessage(`Pyright langserver doesn't exist, please reinstall coc-pyright`, "error");
23582
+ import_coc24.window.showErrorMessage(`Pyright langserver doesn't exist, please reinstall coc-pyright`);
23583
23583
  return;
23584
23584
  }
23585
23585
  const runOptions = { execArgv: [`--max-old-space-size=${defaultHeapSize}`] };
@@ -23595,6 +23595,9 @@ async function activate(context) {
23595
23595
  if (pyrightCfg.get("disableDiagnostics")) {
23596
23596
  disabledFeatures.push("diagnostics");
23597
23597
  }
23598
+ const disableProgress = pyrightCfg.get("disableProgressNotifications");
23599
+ if (disableProgress)
23600
+ disabledFeatures.push("progress");
23598
23601
  const outputChannel = import_coc24.window.createOutputChannel("Pyright");
23599
23602
  const pythonSettings = PythonSettings.getInstance();
23600
23603
  outputChannel.appendLine(`Workspace: ${import_coc24.workspace.root}`);
@@ -23607,7 +23610,7 @@ async function activate(context) {
23607
23610
  },
23608
23611
  outputChannel,
23609
23612
  disabledFeatures,
23610
- progressOnInitialization: true,
23613
+ progressOnInitialization: !disableProgress,
23611
23614
  middleware: {
23612
23615
  workspace: {
23613
23616
  configuration
@@ -23651,7 +23654,7 @@ async function activate(context) {
23651
23654
  command = "pyright.createtypestub";
23652
23655
  disposable = import_coc24.commands.registerCommand(command, async (...args) => {
23653
23656
  if (!args.length) {
23654
- import_coc24.window.showMessage(`Module name is missing`, "warning");
23657
+ import_coc24.window.showWarningMessage(`Module name is missing`);
23655
23658
  return;
23656
23659
  }
23657
23660
  const doc = await import_coc24.workspace.document;
@@ -23692,7 +23695,7 @@ async function activate(context) {
23692
23695
  const pyrightPackage = JSON.parse((0, import_fs.readFileSync)(pyrightJSON, "utf8"));
23693
23696
  const cocPyrightJSON = (0, import_path5.join)(context.extensionPath, "package.json");
23694
23697
  const cocPyrightPackage = JSON.parse((0, import_fs.readFileSync)(cocPyrightJSON, "utf8"));
23695
- import_coc24.window.showMessage(`coc-pyright ${cocPyrightPackage.version} with Pyright ${pyrightPackage.version}`);
23698
+ import_coc24.window.showInformationMessage(`coc-pyright ${cocPyrightPackage.version} with Pyright ${pyrightPackage.version}`);
23696
23699
  });
23697
23700
  context.subscriptions.push(disposable);
23698
23701
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coc-pyright",
3
- "version": "1.1.252",
3
+ "version": "1.1.253",
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",
@@ -1327,6 +1327,11 @@
1327
1327
  "default": false,
1328
1328
  "description": "Disable diagnostics from Pyright"
1329
1329
  },
1330
+ "pyright.disableProgressNotifications": {
1331
+ "type": "boolean",
1332
+ "default": false,
1333
+ "description": "Disable the initialization and workdone progress notifications"
1334
+ },
1330
1335
  "pyright.completion.importSupport": {
1331
1336
  "type": "boolean",
1332
1337
  "default": true,
@@ -1403,6 +1408,6 @@
1403
1408
  ]
1404
1409
  },
1405
1410
  "dependencies": {
1406
- "pyright": "^1.1.251"
1411
+ "pyright": "^1.1.253"
1407
1412
  }
1408
1413
  }