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

Hover support for custom symbols (variables, constants, functions) #42

Open
iFrozenPhoenix opened this issue Sep 7, 2022 · 2 comments

Comments

@iFrozenPhoenix
Copy link

Hover Support for custom symbols would be great, e.g. in the following snippet I would like to hover main and say_hello and get the docstring and function definution, like for builtin symbols.

"""
say something
"""
def say_hello(what):
    print("hello", what)

"""
main func
"""
def main():
    say_hello("name")

main()
@nicksieger
Copy link
Member

nicksieger commented Sep 7, 2022

I think this works already -- in Python, and consequently, Starlark, the docstrings go after the declared thing. Try again with

def say_hello(what):
    """
    say something
    """
    print("hello", what)

def main():
    """
    main func
    """
    say_hello("name")

@iFrozenPhoenix
Copy link
Author

@nicksieger you're right concerning the docstring. Obviously I'm too much in Go and Typescript :-).
So the only improvement here were if the symbol definition could also be provided in the hover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants