Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const cp = require("child_process");
const shellEnv = require("shell-env");
const { shell } = require("electron");
const { AutoLanguageClient } = require("atom-languageclient");

Expand Down Expand Up @@ -29,11 +28,10 @@ class PythonLanguageClient extends AutoLanguageClient {
}

async startServerProcess(projectPath) {
// For some reason Atom only detects the correct env if started from the command line on Mac.
const env = process.platform === "darwin" ? await shellEnv() : process.env;
await new Promise(resolve => atom.whenShellEnvironmentLoaded(resolve));

const childProcess = cp.spawn(atom.config.get("ide-python.pylsPath"), {
cwd: projectPath,
env: env
cwd: projectPath
});
childProcess.on("error", err =>
atom.notifications.addError(
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"atom": ">=1.21.0 <2.0.0"
},
"dependencies": {
"atom-languageclient": "^0.6.4",
"shell-env": "^0.3.0"
"atom-languageclient": "^0.6.4"
},
"enhancedScopes": [
"source.python"
Expand Down