Skip to content

Commit 5ba23ee

Browse files
committed
Await Atom's shell environement load
1 parent 0ace883 commit 5ba23ee

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

lib/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const cp = require("child_process");
2-
const shellEnv = require("shell-env");
32
const { shell } = require("electron");
43
const { AutoLanguageClient } = require("atom-languageclient");
54

@@ -29,11 +28,10 @@ class PythonLanguageClient extends AutoLanguageClient {
2928
}
3029

3130
async startServerProcess(projectPath) {
32-
// For some reason Atom only detects the correct env if started from the command line on Mac.
33-
const env = process.platform === "darwin" ? await shellEnv() : process.env;
31+
await new Promise(resolve => atom.whenShellEnvironmentLoaded(resolve));
32+
3433
const childProcess = cp.spawn(atom.config.get("ide-python.pylsPath"), {
35-
cwd: projectPath,
36-
env: env
34+
cwd: projectPath
3735
});
3836
childProcess.on("error", err =>
3937
atom.notifications.addError(

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"atom": ">=1.21.0 <2.0.0"
1818
},
1919
"dependencies": {
20-
"atom-languageclient": "^0.6.4",
21-
"shell-env": "^0.3.0"
20+
"atom-languageclient": "^0.6.4"
2221
},
2322
"enhancedScopes": [
2423
"source.python"

0 commit comments

Comments
 (0)