I think maybe some of it stems from 'ls' the command. If I saw something called py-ls instead of py-lsp, I may think it's a python based ls command. "Name Collision" as it were.
Anyways off to read the rest of the article...
It would also make sense to use path after it is defined, instead of sometimes using `$1` again.
But I'm confused by `cd`ing into `$path` and then checking paths that are prefixed by `$path`... I assume that is an error, and you won't run it like `script.sh ./work/project` and expect a path like `./work/project/work/project` or `./work/project/project` to exist. Can just `cd "$1"` and be done.
Mildly surprised the .venv/venv check isn't an elif as well.
#!/usr/bin/env bash
cd "$1"
if [ -d ./.venv ]; then
source ./.venv/bin/activate
elif [ -d ./venv ]; then
source ./venv/bin/activate
fi
exec pylsp --check-parent-process
josteink•1mo ago
It was so incredibly slow to respond, even on a M2 Max MBP, that it lowered my productivity by orders of magnitudes (and made Emacs laggy).
Maybe I did something wrong? I don’t know.
What I do know is that I tried pyright instead as a different LSP-server for Python and I haven’t looked back.
It’s a night and day difference. It’s snappy and everything works as expected, with venvs and mypy too.
kstrauser•1mo ago
I do hope "ruff server" will do for Python LSPs what ruff did for linting and formatting.
nerdponx•1mo ago
kstrauser•1mo ago
kristjansson•1mo ago
tiltowait•1mo ago
team_pyrefly•1mo ago
arccy•1mo ago
Hasnep•1mo ago