coc-pyright 1.1.189 → 1.1.190
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/lib/index.js +30 -11
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -22064,7 +22064,11 @@ var BlackdFormatter = class extends BaseFormatter {
|
|
|
22064
22064
|
import_coc7.window.showErrorMessage("blackd request error");
|
|
22065
22065
|
this.outputChannel.appendLine("");
|
|
22066
22066
|
this.outputChannel.appendLine(`${"#".repeat(10)} blackd request error:`);
|
|
22067
|
-
|
|
22067
|
+
if (typeof e === "string") {
|
|
22068
|
+
this.outputChannel.appendLine(e);
|
|
22069
|
+
} else if (e instanceof Error) {
|
|
22070
|
+
this.outputChannel.appendLine(e.message);
|
|
22071
|
+
}
|
|
22068
22072
|
return [];
|
|
22069
22073
|
}
|
|
22070
22074
|
}
|
|
@@ -22180,7 +22184,12 @@ async function sortImports(extensionRoot, outputChannel) {
|
|
|
22180
22184
|
const edits = getTextEditsFromPatch(doc.getDocumentContent(), patch);
|
|
22181
22185
|
await doc.applyEdits(edits);
|
|
22182
22186
|
} catch (err) {
|
|
22183
|
-
|
|
22187
|
+
let message = "";
|
|
22188
|
+
if (typeof err === "string") {
|
|
22189
|
+
message = err;
|
|
22190
|
+
} else if (err instanceof Error) {
|
|
22191
|
+
message = err.message;
|
|
22192
|
+
}
|
|
22184
22193
|
outputChannel.appendLine(`${"#".repeat(10)} isort Output ${"#".repeat(10)}`);
|
|
22185
22194
|
outputChannel.appendLine(`Error from isort:
|
|
22186
22195
|
${message}`);
|
|
@@ -22328,7 +22337,9 @@ var BaseLinter = class {
|
|
|
22328
22337
|
return await this.parseMessages(result.stdout, document, cancellation, regEx);
|
|
22329
22338
|
} catch (error) {
|
|
22330
22339
|
this.outputChannel.appendLine(`Linting with ${this.info.id} failed:`);
|
|
22331
|
-
|
|
22340
|
+
if (error instanceof Error) {
|
|
22341
|
+
this.outputChannel.appendLine(error.message.toString());
|
|
22342
|
+
}
|
|
22332
22343
|
return [];
|
|
22333
22344
|
}
|
|
22334
22345
|
}
|
|
@@ -22344,10 +22355,14 @@ var BaseLinter = class {
|
|
|
22344
22355
|
break;
|
|
22345
22356
|
}
|
|
22346
22357
|
}
|
|
22347
|
-
} catch (
|
|
22358
|
+
} catch (err) {
|
|
22348
22359
|
this.outputChannel.appendLine(`${"#".repeat(10)} Linter ${this.info.id} failed to parse the line:`);
|
|
22349
22360
|
this.outputChannel.appendLine(line);
|
|
22350
|
-
|
|
22361
|
+
if (typeof err === "string") {
|
|
22362
|
+
this.outputChannel.appendLine(err);
|
|
22363
|
+
} else if (err instanceof Error) {
|
|
22364
|
+
this.outputChannel.appendLine(err.message);
|
|
22365
|
+
}
|
|
22351
22366
|
}
|
|
22352
22367
|
}
|
|
22353
22368
|
return messages;
|
|
@@ -22561,9 +22576,13 @@ var PyDocStyle = class extends BaseLinter {
|
|
|
22561
22576
|
type: "",
|
|
22562
22577
|
provider: this.info.id
|
|
22563
22578
|
};
|
|
22564
|
-
} catch (
|
|
22579
|
+
} catch (err) {
|
|
22565
22580
|
this.outputChannel.appendLine(`Failed to parse pydocstyle line '${line}'`);
|
|
22566
|
-
|
|
22581
|
+
if (typeof err === "string") {
|
|
22582
|
+
this.outputChannel.appendLine(err);
|
|
22583
|
+
} else if (err instanceof Error) {
|
|
22584
|
+
this.outputChannel.appendLine(err.message);
|
|
22585
|
+
}
|
|
22567
22586
|
return;
|
|
22568
22587
|
}
|
|
22569
22588
|
}).filter((item) => item !== void 0).map((item) => item);
|
|
@@ -23197,7 +23216,7 @@ async function applyImports(doc, resp, outputChannel) {
|
|
|
23197
23216
|
if (typeof error === "string") {
|
|
23198
23217
|
errorMessage = error;
|
|
23199
23218
|
}
|
|
23200
|
-
if (
|
|
23219
|
+
if (error instanceof Error) {
|
|
23201
23220
|
errorMessage = error.message;
|
|
23202
23221
|
}
|
|
23203
23222
|
outputChannel.appendLine(`${"#".repeat(10)}Rope Output${"#".repeat(10)}`);
|
|
@@ -23247,7 +23266,7 @@ async function extractName(textEditor, newName, renameResponse, outputChannel) {
|
|
|
23247
23266
|
if (typeof error === "string") {
|
|
23248
23267
|
errorMessage = error;
|
|
23249
23268
|
}
|
|
23250
|
-
if (
|
|
23269
|
+
if (error instanceof Error) {
|
|
23251
23270
|
errorMessage = error.message;
|
|
23252
23271
|
}
|
|
23253
23272
|
outputChannel.appendLine(`${"#".repeat(10)}Refactor Output${"#".repeat(10)}`);
|
|
@@ -23436,7 +23455,7 @@ async function activate(context) {
|
|
|
23436
23455
|
const codeActionProvider = new PythonCodeActionProvider();
|
|
23437
23456
|
context.subscriptions.push(import_coc24.languages.registerCodeActionProvider(documentSelector, codeActionProvider, "Pyright"));
|
|
23438
23457
|
const provider = new ImportCompletionProvider();
|
|
23439
|
-
context.subscriptions.push(import_coc24.languages.registerCompletionItemProvider("python-import", "PY", "python", provider, [" "]));
|
|
23458
|
+
context.subscriptions.push(import_coc24.languages.registerCompletionItemProvider("python-import", "PY", ["python"], provider, [" "]));
|
|
23440
23459
|
const textEditorCommands = ["pyright.organizeimports", "pyright.addoptionalforparam"];
|
|
23441
23460
|
textEditorCommands.forEach((commandName) => {
|
|
23442
23461
|
context.subscriptions.push(import_coc24.commands.registerCommand(commandName, async (offset) => {
|
|
@@ -23522,7 +23541,7 @@ var ImportCompletionProvider = class {
|
|
|
23522
23541
|
return [];
|
|
23523
23542
|
const items = [];
|
|
23524
23543
|
for (const o of result.items) {
|
|
23525
|
-
items.push({ label: o.word, sortText: o.sortText });
|
|
23544
|
+
items.push({ label: o.word, sortText: o.sortText, kind: import_coc24.CompletionItemKind.Module, filterText: o.filterText });
|
|
23526
23545
|
}
|
|
23527
23546
|
return items;
|
|
23528
23547
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-pyright",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.190",
|
|
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,7 +39,7 @@
|
|
|
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": "
|
|
42
|
+
"@types/node": "12.12",
|
|
43
43
|
"@types/semver": "^7.3.9",
|
|
44
44
|
"@types/which": "^2.0.0",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
@@ -1342,6 +1342,6 @@
|
|
|
1342
1342
|
]
|
|
1343
1343
|
},
|
|
1344
1344
|
"dependencies": {
|
|
1345
|
-
"pyright": "^1.1.
|
|
1345
|
+
"pyright": "^1.1.190"
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|