Skip to content

Reference Counting #2194

Open

Description

@asukaminato0721

Describe the Bug

For some languages ​​, we have references mentioned above of class/function with the number of references that the object is used.

But for Python, I can't find it. This could be a good feature for Python.

microsoft/pylance-release#6660

Image

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

  1. added
    language-serverIssues specific to our IDE integration rather than type checking
    on Jan 22, 2026
  2. yangdanny97 commented on Jan 22, 2026

    @yangdanny97
    Collaborator

    This seems like a neat feeature!

    If we did this, we would need to make sure it doesn't block other features from working while it's being calculated in the background. Find-references is expensive and won't work until we finish indexing the codebase. The current implementation is designed to run in the background, but I worry about performance if we reuse it directly & proactively do find-references for all functions in your currently open file.

    Tracking references in the state & updating it during rechecks might make lookups faster, but it would also increase baseline memory usage (unclear by how much) so there's a tradeoff.

  3. added
    needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.
    on Jan 22, 2026
  4. yangdanny97 commented on Mar 17, 2026

    @yangdanny97
    Collaborator

    Maybe a cheaper thing to start with could be doing this only for functions/classes marked @deprecated?

  5. yangdanny97 commented on Mar 18, 2026

    @yangdanny97
    Collaborator

    @samwgoldman mentioned that we can retain the references information as we index the codebase, and we can skip showing these codelenses while indexing is happening. so maybe worth attempting

  6. removed
    needs-discussionAn issue where it's not clear whether there is a bug or we are behaving as expected.
    on Mar 18, 2026
  7. yinkaaiwu commented on Jun 17, 2026

    @yinkaaiwu

    Nice! I've been looking for this feature. When will it be available in the VSCode extension?

  8. asukaminato0721 commented on Jun 24, 2026

    @asukaminato0721
    CollaboratorAuthor

    #claim

  9. github-actions commented on Jun 24, 2026

    @github-actions

    @asukaminato0721 you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉

  10. github-actions commented on Oct 31, 2026

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

Metadata

Metadata

Labels

language-serverIssues specific to our IDE integration rather than type checking

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions