zed icon indicating copy to clipboard operation
zed copied to clipboard

Python autocompletion suggestions are not stable

Open JosephTLyons opened this issue 1 year ago • 2 comments

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

JosephTLyons avatar Mar 30 '24 07:03 JosephTLyons

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!

github-actions[bot] avatar Oct 01 '24 11:10 github-actions[bot]

I'm still able to reproduce this issue.

JosephTLyons avatar Oct 08 '24 17:10 JosephTLyons

@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.

aretrace avatar Jan 26 '25 02:01 aretrace

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

gamertyke avatar May 23 '25 20:05 gamertyke

I can still reproduce.

osiewicz avatar Sep 08 '25 16:09 osiewicz

It seems to me that the order of completions depends on the order of completion/resolve requests, which is.. well.. not deterministic.

osiewicz avatar Sep 08 '25 16:09 osiewicz

^ was wrong; the order of resolution is sorta deterministic. Pyright was just sending out different results on each completions call, which is yuck.

osiewicz avatar Sep 09 '25 15:09 osiewicz