You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/lsp/source: show both the original declaration and the value of constants in hover
This change improves the hover information for constants by showing
both the original declaration and the value. The value is displayed
as an inline comment. If the original declaration and the value are
the same, there will be no inline comment.
Examples:
```go
const duration time.Duration = 15*time.Minute + 10*time.Second // 15m10s
const octal untyped int = 0o777 // 511
const expr untyped int = 2 << (0b111&0b101 - 2) // 16
const boolean untyped bool = (55 - 3) == (26 * 2) // true
const dec untyped int = 500
```
Other changes:
- Calls to `objectString` that format methods or variables have been
replaced with `types.ObjectString`.
- The logic of inferred signature formatting has been extracted from
`objectString` to a new function `inferredSignatureString`.
- Remove unused function `extractFieldList`.
- Port `gopls/internal/lsp/testdata/godef/a/g.go` to the new marker
tests.
- Fix `-min_go` constraint for marker tests by replacing hardcoded
`1.18` with an actual flag value.
Fixesgolang/go#47453
Change-Id: Ib9012dae8554a3b646c3059d2f8967e425974fbf
GitHub-Last-Rev: 8cc75a7
GitHub-Pull-Request: #432
Reviewed-on: https://go-review.googlesource.com/c/tools/+/480695
Run-TryBot: Robert Findley <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
gopls-CI: kokoro <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
0 commit comments