diff options
author | Mole Shang <[email protected]> | 2023-04-22 19:19:12 +0800 |
---|---|---|
committer | Mole Shang <[email protected]> | 2023-04-22 19:19:12 +0800 |
commit | 4b547fab01f4fa1b24791de81e17dd0ba8c1b21c (patch) | |
tree | 61567926d25e7c8c7403ef033c14f80f0c64f44f | |
parent | 2a4c3b70832316362a37a5e8734563cbfbc0de04 (diff) | |
download | dotfiles-4b547fab01f4fa1b24791de81e17dd0ba8c1b21c.tar.gz dotfiles-4b547fab01f4fa1b24791de81e17dd0ba8c1b21c.tar.bz2 dotfiles-4b547fab01f4fa1b24791de81e17dd0ba8c1b21c.zip |
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
-rw-r--r-- | scripts/pylsp_in_venv | 12 |
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 |