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

No docstring popup in codecompletion is provided when immediatly calling a returned nested fuction #1990

Closed
DeltaRazero opened this issue Oct 27, 2021 · 3 comments
Assignees
Labels
bug Something isn't working P2

Comments

@DeltaRazero
Copy link

Environment data

  • VSCode Version: 1.61.0-insider
  • Commit: c9e8266ee24f34107ff52d836a4e8f533afb93c5
  • Language Server version: v2021.10.2
  • OS and version: Windows 7 (Windows_NT x64 6.1.7601)
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.7

Expected behaviour

When defining a nested function that will be returned to the user, a docstring popup is provided in the code editor/completion when directly calling the returned function after calling top level function.

Actual behaviour

When defining a nested function that will be returned to the user, NO docstring popup is provided in the code editor/completion when directly calling the returned function after calling top level function.

(See code snippet example underneath)
actual behaviour

But if you do it like this it works:
image
image

Code Snippet / Additional information

def foo(template_var: int):
    """Some function description.

    Parameters
    ----------
    template_var : int
        Some template variable.
    """

    def bar(input_var: int) -> int:
        """Some templated function description.

        Parameters
        ----------
        input_var : int
            Some input variable.

        Returns
        -------
        int
            Output value.
        """
        return template_var + input_var

    return bar


# Yields no docstring popup
foo(5)(5)

# But if you store the result into a var...
a = foo(5)
# it does show up
a(5)
@jakebailey
Copy link
Member

@bschnurr This sounds related to the change made to fix #1677.

@judej judej added bug Something isn't working needs investigation Could be an issue - needs investigation labels Oct 28, 2021
@github-actions github-actions bot removed the triage label Oct 28, 2021
@DeltaRazero
Copy link
Author

Any update on this issue yet?

@judej judej removed the bug Something isn't working label Jun 9, 2022
@bschnurr bschnurr added bug Something isn't working P2 and removed needs investigation Could be an issue - needs investigation labels Jun 9, 2022
@bschnurr
Copy link
Member

This issue has been fixed in version 2022.7.31, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2
Projects
None yet
Development

No branches or pull requests

4 participants