From 05a987baac2a260540516b1e070171cca5125af0 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Fri, 15 Feb 2019 14:23:09 +0100 Subject: [PATCH] Defer package activation until shell env is loaded This PR defers package activation until the shell environment is loaded. This should speed up startup time of Atom and doesn't impact `ide-python` since we need to wait for the shell environment to be loaded anyway. See https://github.com/prettier/prettier-atom/pull/485 --- lib/main.js | 1 - package.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index 2d78b367..426f8c8c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -46,7 +46,6 @@ class PythonLanguageClient extends AutoLanguageClient { } async startServerProcess(projectPath) { - await new Promise(resolve => atom.whenShellEnvironmentLoaded(resolve)); const venvPath = (await detectPipEnv(projectPath)) || (await detectVirtualEnv(projectPath)); diff --git a/package.json b/package.json index a9c61da9..b77d7218 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,9 @@ "enhancedScopes": [ "source.python" ], + "activationHooks": [ + "core:loaded-shell-environment" + ], "configSchema": { "python": { "title": "Python Executable",