Hover does not show pathlib.Path.read_text docstring

Aperta
#5,568 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@1-DARK ci sta già lavorando.

Dal 7/11/2026.

  • #5575 di @1-DARK — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

language-server
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

Lingua principale
Rust
Stelle
7.2k
Fork
578
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di facebook/pyrefly

Tutte le issue di facebook/pyrefly

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.