Hasty Briefsbeta

Bilingual

Kate and Python Language Server

a year ago
  • #Python
  • #LSP
  • #Kate
  • Setting up Python language server (python-lsp-server) in Kate editor for virtual environments.
  • Using python-lsp-ruff plugin to integrate Ruff linter and formatter with the language server.
  • Creating a bash script (pylsp_in_env) to detect and activate virtual environments (.venv or venv) before running the language server.
  • Configuring Kate's LSP settings to use the custom script and enable Ruff.
  • Kate's %{Project:NativePath} argument provides the full path to the Python project.
  • Solution differs slightly from Kate's documentation by checking multiple virtual environment folder names.
  • Note: Poetry or other tools may require different setup.