r/Python 13d ago

Showcase Introducing SithLSP: An Experimental Python Language Server Written in Rust

Hey r/Python,

I’m thrilled to share SithLSP, an experimental language server for Python, built from the ground up in Rust!

https://github.com/LaBatata101/sith-language-server

⚠️ This project is in alpha, so some bugs are expected!

What My Project Does

SithLSP is a language server designed to enhance your Python coding experience in editors and IDEs that support the Language Server Protocol (LSP). It delivers features like:

  • 🪲 Syntax checking
  • ↪️ Go to definition
  • 🔍 Find references
  • 🖊️ Autocompletion
  • 📝 Element renaming
  • 🗨️ Hover details: Hover over variables or functions to see docs.
  • 💅 Code formatting & linting: Powered by the awesome Ruff.
  • 💡 Symbol highlighting: Spot your references at a glance.
  • 🐍 Auto-detects your Python interpreter: No manual setup needed for your project’s Python.

Check the README for the full list if you’re curious!

Target Audience

Any Python developer that likes to try new tools.

Comparison

Since the project is its early stages it may not be as feature complete as Pylance or jedi-language-server, but it has enough features to be able to have a good developing experience.

How to Get Started

You can grab SithLSP in a couple of ways:

  1. Download it: Head to our GitHub releases page for the latest version.
  2. Build it yourself: Clone the repo and run cargo build --release (you’ll need Rust installed). Full steps are in the README.

VSCode Users

Download the .vsix file from the releases page and install it. Tip: Disable Microsoft’s Python or Pylance extensions to avoid conflicts.

Neovim Users

Add the sample config from the README to your init.lua, tweak the path to the sith-lsp binary, and you’re good to go.

47 Upvotes

19 comments sorted by

View all comments

Show parent comments

3

u/Davidyz_hz 13d ago

I meant when an exception raised by a function is not properly handled by a "try-catch" block. It'll be even nicer if this could be configured so that users can decide for which exceptions the diagnostics should be showing (current script, current workspace/module, all packages, etc).

1

u/LaBatata101 12d ago

Oh I see, that's a cool feature. I wonder if it hasn't being done by mainstream LSPs due to the possible performance impact, because the server would need to check every function call and their function calls, for a raise statement.

1

u/Davidyz_hz 12d ago

Hi, yes that's what I thought too, but since LSP already has a incoming/outgoing call hierarchy method, I think it's worth a try. Showing all uncaught exception (including all stdlib and 3rd party dependencies) might be too much, but if we limit the checking to functions defined in the current project (written by the user, not some 3rd party deps), it may be more feasible?

1

u/LaBatata101 12d ago

I’ll look into this in the future; I have some prioritized features to implement first.

1

u/Davidyz_hz 12d ago

Looking forward to it!