Skip to content

Hover does not show pathlib.Path.read_text docstring #5568

Open

Description

@khavronin-artem

Describe the Bug

Hovering over pathlib.Path.read_text shows its signature but no docstring, although the docstring is available at runtime through help() and __doc__.

Minimal reproduction

from pathlib import Path

Path(".").read_text()  # Hover over read_text

Compare with:

print(Path.read_text.__doc__)
help(Path.read_text)

The runtime documentation includes:

Open the file in text mode, read it, and close the file.

Expected behavior

Hover should include the method's docstring alongside its signature.

Actual behavior

Hover includes the method signature but no description.

This was also reproduced by sending a textDocument/hover request directly to pyrefly lsp, independently of the editor. The response contains the signature and navigation links, but no docstring.

In that reproduction, textDocument/definition resolves to Pyrefly's bundled pathlib/__init__.pyi.

Environment

  • Editor: VSCodium
  • Pyrefly: 1.4.0
  • Python: CPython 3.13.14
  • OS: Linux

Related issue

Possibly related to #1090, which addressed retrieving implementation docstrings for attributes resolved through .pyi files.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

  1. added theissue type on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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