go-langserver icon indicating copy to clipboard operation
go-langserver copied to clipboard

Include examples in hover tooltips

Open nicksnyder opened this issue 7 years ago • 0 comments

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

nicksnyder avatar Oct 29 '18 22:10 nicksnyder