Skip to content

workspace/symbol does not return attributes defined in __init__ #4688

Description

@AdrianSosic

Describe the Bug

Not sure if this is a bug or intended behavior, but VS Code's workspace symbol search (#, or Ctrl+T) does not return any attributes defined in init, regardless of prefix, when using the Pyrefly extension.

This worked with Pylance before switching to Pyrefly.

Minimal reproduction

class Example:
    def __init__(self) -> None:
        self._private_member = 1

    def _private_method(self) -> None:
        pass

    def public_method(self) -> None:
        pass

Expected behavior

Workspace symbol search should return _private_member and _private_method, as it did with Pylance.

Actual behavior

The public symbol appears, but the underscore-prefixed members do not.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

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

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions