Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add package name to Hover/Mouseover information #1085

Closed
sparrc opened this issue Jul 12, 2017 · 6 comments
Closed

Add package name to Hover/Mouseover information #1085

sparrc opened this issue Jul 12, 2017 · 6 comments

Comments

@sparrc
Copy link

sparrc commented Jul 12, 2017

Is it possible to add the package name to the mouseover type definition?

For example, if you had a script that looked like this:

package main

import (
	"bytes"
)

func main() {
	var b bytes.Buffer
	b.WriteString("Hello World")
	p(&b)
}

func p(buf *bytes.Buffer) {
	println(buf.String())
}

When I hover buf within the p() function, I see buf *Buffer.

But I would like to see buf *bytes.Buffer

@ramya-rao-a
Copy link
Contributor

@sparrc The Go extension itself doesn't get the hover info. We use go tools for this. The options you have is to use godef, gogedoc or the go language server

None of the options give the package information.

I suggest you log a feature request in any or all of these repos

@zmb3
Copy link
Contributor

zmb3 commented Jul 20, 2017

@ramya-rao-a gogetdoc includes the pkg field in it's JSON output now, so you could conceivably add it to the tooltip

@ramya-rao-a
Copy link
Contributor

@zmb3 Sweet.

Re-opening the issue to absorb changes from gogetdoc.

PRs welcome :)

@sparrc
Copy link
Author

sparrc commented Jul 21, 2017

.

@doxxx
Copy link
Contributor

doxxx commented May 12, 2018

I am unable to reproduce this with gogetdoc configured as the doc tool. When I hover over buf in the example, I see this:

image

It appears the tooltip is showing the declarationLine returned by gogetdoc. Is this correct?

@ramya-rao-a
Copy link
Contributor

Yes, looks like whats requested in this issue is already being shown when using gogetdoc.
Thanks @doxxx!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 28, 2018
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

4 participants