Skip to content

Commit 784dafb

Browse files
committed
Improve error message
1 parent 0d64dcf commit 784dafb

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lib/main.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const cp = require("child_process");
2+
const { shell } = require("electron");
23
const { AutoLanguageClient } = require("atom-languageclient");
34

45
class PythonLanguageClient extends AutoLanguageClient {
@@ -18,7 +19,23 @@ class PythonLanguageClient extends AutoLanguageClient {
1819
childProcess.on("error", err =>
1920
atom.notifications.addError(
2021
"Unable to start the Python language server.",
21-
{ dismissable: true }
22+
{
23+
dismissable: true,
24+
buttons: [
25+
{
26+
text: "Install Instructions",
27+
onDidClick: () =>
28+
atom.workspace.open("atom://config/packages/ide-python")
29+
},
30+
{
31+
text: "Download Python",
32+
onDidClick: () =>
33+
shell.openExternal("https://www.python.org/downloads/")
34+
}
35+
],
36+
description:
37+
"This can occur if you do not have Python installed or if it is not in your path.\n\n Make sure to install `pyls` by running:\n```\npip install python-language-server\n```"
38+
}
2239
)
2340
);
2441
return childProcess;

0 commit comments

Comments
 (0)