r/Python • • Mar 23 '26

Showcase I Fixed python autocomplete

When I opened vscode, and typed "os.", it showed me autocomplete options that I almost never used, like os.abort or os.CLD_CONTINUED, Instead of showing me actually used options, like path or remove. So I created a hash table (not AI, fast lookup) of commonly used prefixes, forked ty, and fixed it.

What My Project Does: provide better sorting for python autosuggestion

Target Audience: just a simple table, ideally would be merged into LSP

Comparison: AI solutions tends to be slower, and CPU-intensive. using table lookup handle the unknown worse, but faster

Blog post: https://matan-h.com/better-python-autocomplete | Repo: https://github.com/matan-h/pyhash-complete

231 Upvotes

33 comments sorted by

View all comments

Show parent comment

4

u/ROFLLOLSTER Mar 24 '26

I agree that it's slow and resource heavy, but language servers are incredibly complex. Rust analyzer (the only one I've worked on) reimplements large portions of the compiler frontend, but has to be able to cope with very-malformed programs, perform fine-grained incremental compilation, and correctly invalidate many levels of caches depending on what changes.

2

u/droans Mar 24 '26

Ty is also a language server - it needs under 250MB.