zed
zed copied to clipboard
Python autocompletion suggestions are not stable
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
In the video below, I'm running the editor: show completions action, over and over. You can tell the completion order changes each time. This is a bit disorienting in actual practice. Other languages, such as Rust, seem to have a stable autocompletion order.
The fix employed to correct this bug might be useful to know:
- https://github.com/zed-industries/zed/issues/5810
PR:
- https://github.com/zed-industries/zed/pull/1903
Environment
Zed: v0.130.0 (Zed Nightly) OS: macOS 14.3.1 Memory: 64 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
https://github.com/zed-industries/zed/assets/19867440/5d2a4aea-c4d8-463c-8b7d-fc53a8b19062
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
No response
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in 10 days. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!
I'm still able to reproduce this issue.
@JosephTLyons @maxbrunsfeld @pchalasani I use basedpyright, but autocomplete suggestions and their ordering are still not where they need to be. This has impacted my productivity to the point I switch back and forth between zed and vscode at times. The main reason I haven’t fully left zed for Python development is its integrated AI edit suggestions, which are very convenient.
That said, given the other Python issues in zed (like with pylsp), I genuinely believe the team should prioritize improving Python support. While I understand there are other areas of focus, Python is one of the most widely used programming languages globally. With zed’s impressive performance compared to other popular editors, better Python support could make it an easy choice for developers who want a lightweight editor for quick script edits, rather than spinning up a full IDE or a slower, Electron-based editor.
However, the current state of Python support in zed, including incomplete autocomplete functionality, makes it hard for me to recommend zed for Python, despite my personal preference for it.
I've been crawling all over the internet trying to find out what the expected behavior for Python is out of the box, but I have no autocomplete suggestions for setting variables, or calling functions etc... is this the expected behavior? Zed's site makes it seem like this should all work without any additional extensions or settings etc
I can still reproduce.
It seems to me that the order of completions depends on the order of completion/resolve requests, which is.. well.. not deterministic.
^ was wrong; the order of resolution is sorta deterministic. Pyright was just sending out different results on each completions call, which is yuck.