Skip to content

Render callable protocols in hover as the signature of __call__ rather than by name #2832

@asukaminato0721

Description

@asukaminato0721

Describe the Bug

now on hover parametrize only shows

(attribute) __call__: _ParametrizeMarkDecorator
Go to [_ParametrizeMarkDecorator](vscode-file://vscode-app/opt/visual-studio-code-insiders/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
    @pytest.mark.parametrize(
        ("role", "status"),
        [
            (TenantAccountRole.OWNER, 200),
            (TenantAccountRole.ADMIN, 200),
            (TenantAccountRole.EDITOR, 200),
            (TenantAccountRole.NORMAL, 403),
            (TenantAccountRole.DATASET_OPERATOR, 403),
        ],
    )

then go to the type definition

    class _ParametrizeMarkDecorator(MarkDecorator):
        def __call__(  # type: ignore[override]
            self,
            argnames: str | Sequence[str],
            argvalues: Iterable[ParameterSet | Sequence[object] | object],
            *,
            indirect: bool | Sequence[str] = ...,
            ids: Iterable[None | str | float | int | bool]
            | Callable[[Any], object | None]
            | None = ...,
            scope: _ScopeName | None = ...,
        ) -> MarkDecorator: ...

So I think it should show the __call__ definition.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverIssues specific to our IDE integration rather than type checking
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions