-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp: hover over linkname directives.
Enables hover on the second argument in go:linkname directives. Make findLinkname a bit more generic so it can support both (goto) definition and hover. Updates golang/go#57312 Change-Id: I9ac7cfceb62dada69bf7fced1ac03877947bb615 Reviewed-on: https://go-review.googlesource.com/c/tools/+/479695 gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
4 changed files
with
138 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
This test check hover on the 2nd argument in go:linkname directives. | ||
-- go.mod -- | ||
module mod.com | ||
|
||
-- upper/upper.go -- | ||
package upper | ||
|
||
import ( | ||
_ "unsafe" | ||
_ "mod.com/lower" | ||
) | ||
|
||
//go:linkname foo mod.com/lower.bar //@hover("mod.com/lower.bar", "mod.com/lower.bar", bar) | ||
func foo() string | ||
|
||
-- lower/lower.go -- | ||
package lower | ||
|
||
// bar does foo. | ||
func bar() string { | ||
return "foo by bar" | ||
} | ||
|
||
-- @bar/hover.md -- | ||
```go | ||
func bar() string | ||
``` | ||
|
||
bar does foo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters