summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/pylsp_in_venv12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/pylsp_in_venv b/scripts/pylsp_in_venv
new file mode 100644
index 0000000..feedcc7
--- /dev/null
+++ b/scripts/pylsp_in_venv
@@ -0,0 +1,12 @@
+#!/bin/bash
+VENV_RELATIVE_PATH="venv"
+
+cd $1
+# run the server (python-lsp-server) within the virtualenv
+# (i.e. with virtualenv variables setup)
+# so source the virtualenv
+if [ -d "$VENV_RELATIVE_PATH" ]; then
+ source "$VENV_RELATIVE_PATH/bin/activate"
+fi
+# server mileage or arguments may vary
+exec pylsp --check-parent-process