Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylance function return type inlay hints do not work on closures #6809

Open
randori-ddejohn opened this issue Jan 2, 2025 · 0 comments
Open
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@randori-ddejohn
Copy link

Environment data

  • Pylance version: v2024.7.1
  • OS and version: Windows 11
  • Python version (& distribution if applicable, e.g. Anaconda): clean install of Python 3.11

Code Snippet

def simple_closure(a: int):
    def doubler():
        return a * 2
    return doubler

Repro Steps

  1. configure Pylance extension in settings.json with "python.analysis.inlayHints.functionReturnTypes": true,
  2. open a new file
  3. paste the code
  4. double click the inlay type hint

Expected behavior

The type hint should import Callable and fill in the type hint

Actual behavior

As you can see, double clicking to insert the type hint adds it as a comment. Repeatedly double-clicking keeps appending a new comment onto the end of the line.

default.C__Users_8J3434897_Desktop_test.py.2025-01-02.11-58-41.mp4

Logs

No logs to show.

@rchiodo rchiodo added the needs repro Issue has not been reproduced yet label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants