-
Notifications
You must be signed in to change notification settings - Fork 645
Show const/var value in hovers/completions in all cases #2146
Comments
👹
Em Dom, 25 de nov de 2018 15:53, Segev Finer <[email protected]>
escreveu:
… It's quite useful to be able to see the value of a const/var in
hovers/completions. Using the default configuration you only get that for
consts and only on hover.
This depends on information that is returned from the tools themselves. So
implementing this will likely require extending the tools with the required
information.
Screenshot
[image: image]
<https://user-images.githubusercontent.com/24731903/48982350-0adbf180-f0ea-11e8-8e63-c682334579ba.png>
Status (ATM)
Using the default godef/go doc and gocode:
Hover Completion
Const ✔️ ❌
Var ❌ ❌ Sample Code
package main
import "fmt"
const foo = "foo"const Bar = "bar"
var baz = "baz"var Qux = "Qux"
func main() {
fmt.Println(foo, Bar, baz, Qux)
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2146>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apf3hDrCPE7AvITyFgILwC-t9LEtEvSfks5uytkXgaJpZM4Yx-9J>
.
|
That is very much true. I believe the reason it gets shown for constants is because the value is right there in the same line as the declaration which is what is returned by godef/godoc. I guess the reason the same was not done for variables is because the value of the variables can change and the static tools have no way of guaranteeing its value. Thats my guess. I would suggest to log an issue for godef/godoc to confirm this. For completions, I would suggest to log this feature request at https://github.com/mdempsky/gocode/issues and @stamblerre should be able to get back with her thoughts. Closing this issue in this repo as there isnt much we can do here to support these cases. |
for gocode: this should be very easily doable for constants, but not for variables. Feel free to file an issue at the link @ramya-rao-a provided, or if you're interested in contributing, send out a PR. |
It's quite useful to be able to see the value of a const/var in hovers/completions. Using the default configuration you only get that for consts and only on hover.
This depends on information that is returned from the tools themselves. So implementing this will likely require extending the tools with the required information.
Screenshot
Status (ATM)
Using the default
godef
/go doc
andgocode
:Sample Code
The text was updated successfully, but these errors were encountered: