From 4b547fab01f4fa1b24791de81e17dd0ba8c1b21c Mon Sep 17 00:00:00 2001
From: Mole Shang <135e2@135e2.dev>
Date: Sat, 22 Apr 2023 19:19:12 +0800
Subject: pylsp_in_venv: new, 20230422

A simple script for pylsp venv support.

Ref: https://docs.kde.org/stable5/en/kate/kate/kate-application-plugin-lspclient.html
---
 scripts/pylsp_in_venv | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 scripts/pylsp_in_venv

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
-- 
cgit v1.2.3