Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Include examples in hover tooltips #335

Open
nicksnyder opened this issue Oct 29, 2018 · 0 comments
Open

Include examples in hover tooltips #335

nicksnyder opened this issue Oct 29, 2018 · 0 comments

Comments

@nicksnyder
Copy link
Contributor

It would be neat if the go language server included at least one example (when available) in the hover tooltip for a symbol.

To a first approximation, the example part of the result of godoc -ex <package> <symbol> (e.g. godoc -ex io MultiReader)

Example:
    r1 := strings.NewReader("first reader ")
    r2 := strings.NewReader("second reader ")
    r3 := strings.NewReader("third reader\n")
    r := io.MultiReader(r1, r2, r3)

    if _, err := io.Copy(os.Stdout, r); err != nil {
        log.Fatal(err)
    }

    // Output:
    // first reader second reader third reader
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant