Skip to content

LSP (Zed): Auto-import completions incomplete for symbols with common prefix #1398

Closed

Description

@mahuw

Describe the Bug

Summary

Completion filtering doesn't update when typing continues - shows only initially fetched results.

Description

When multiple classes start with the same prefix, Pyrefly's auto-import completions only show the results that were fetched first and don't continue fetching as more characters are typed.

MRE:

  1. Setup environment:
uv init --bare
uv add --dev pyrefly  
uvx pyrefly init

install pyrefly extension

  1. Create files with code

a.py:

class UsersManager:
    pass

b.py:

class UsersController:
    pass
    
# start typing UsersM here
  1. Start typing UsersM in b.py
  2. Only UsersController appears
  3. The UsersManager from a.py doesn't show up
Screen recording

Zed (what is actually) (appears only after manual trigger as write and delete backspace):

pyrefly.bug.mov

VS Code (what is expected):

VSCode.exptected.mov
LSP log

log.log

Original issue: zed-industries/zed#39945 (semi-fixed)

Related commit: aa33ce3

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

Zed: v0.209.6 (Zed)
OS: macOS 26.0.1
Memory: 16 GiB
Architecture: aarch64

Activity

  1. kinto0 commented on Oct 27, 2025

    @kinto0
    Contributor

    @lolpack recently made a change to this. do you know which version of zed your changes were in?

  2. mahuw commented on Oct 27, 2025

    @mahuw
    Author

    @kinto0, it was v0.208.4

  3. lolpack commented on Oct 28, 2025

    @lolpack
    Contributor

    @baab7 thanks for reporting this. I tested in Pylance and I see that the autocomplete import is not available, but it does give the option to import it via quickfix. That seems reasonable. I'll see if I can get to it this week.

    Image
  4. lolpack commented on Oct 28, 2025

    @lolpack
    Contributor

    @baab7 I tested this again and I do see the auto import available, but it's not as obvious because we don't show the yellow underline. Right now we only show the red underline, and that's if you have type checking enabled (either a setting in your config or a pyrefly.toml file/[tool.pyrefly] in pyproject.toml).

    Image Image
  5. mahuw commented on Oct 28, 2025

    @mahuw
    Author

    @lolpack, just to clarify - do you see the auto-import completions while actively typing, or only when manually checking completions (because that's what it looks like from your screenshots)?

    Because in my testing (videos attached), it works as expected in VSCode exactly while typing, but doesn't work in Zed.

    I confirm it does work, but not while typing

  6. added theissue type on Nov 4, 2025
  7. yangdanny97 commented on Nov 4, 2025

    @yangdanny97
    Collaborator

    Perhaps a good next step is to get the LSP trace logs for the repro in both zed & VsCode, and compare them to see if there's a request that the zed client is omitting that we need to update the completion results. @kinto0 are you able to provide instructions for how to do this?

  8. kinto0 commented on Nov 6, 2025

    @kinto0
    Contributor

    Perhaps a good next step is to get the LSP trace logs for the repro in both zed & VsCode, and compare them to see if there's a request that the zed client is omitting that we need to update the completion results. @kinto0 are you able to provide instructions for how to do this?

    I've never used zed so I'm not sure about how it works there. but in vscode, LSP trace is shown in the output panel under the pyrefly dropdown when Pyrefly > trace > server is set to verbose

  9. mahuw commented on Nov 6, 2025

    @mahuw
    Author

    @kinto0, @yangdanny97,

    Perhaps a good next step is to get the LSP trace logs for the repro in both zed & VsCode

    I've never used zed so I'm not sure about how it works there

    Zed log is already attached in the first message. But not VSCode

  10. self-assigned this
    on Nov 8, 2025
  11. 7 remaining items

  12. kinto0 commented on Dec 4, 2025

    @kinto0
    Contributor

    sorry about the delay - big backlog and we've taken some time off for the holidays. I hope we can get to it soon. removing assignees in case someone else can pick it up

  13. added this to the V1 Release milestone on Dec 4, 2025
  14. AryanBagade commented on Dec 13, 2025

    @AryanBagade
    Contributor

    will look into this issue!

  15. added
    language-serverIssues specific to our IDE integration rather than type checking
    and removed on Dec 15, 2025
  16. github-actions commented on Dec 30, 2025

    @github-actions

    This issue has someone assigned, but has not had recent activity for more than 2 weeks.

    If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

    Thank you for your contributions!

  17. AryanBagade commented on Dec 30, 2025

    @AryanBagade
    Contributor

    will create a pr for this by tomorrow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomerslanguage-serverIssues specific to our IDE integration rather than type checking

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions