-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(go_indexer): add --emit_ref_call_over_identifier flag (#5692)
- Loading branch information
1 parent
61bc651
commit 8cd5f34
Showing
5 changed files
with
83 additions
and
2 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
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,50 @@ | ||
// Package fun tests basic function call references. | ||
// - @fun defines/binding Pkg | ||
package fun | ||
|
||
//- @"\"os/exec\"" ref/imports OSExec | ||
import "os/exec" | ||
|
||
//- Pkg.node/kind package | ||
//- Init childof Pkg | ||
//- Init.node/kind function | ||
|
||
// - @F defines/binding Fun = vname("func F", "test", _, "fun", "go") | ||
func F() int { return 0 } | ||
|
||
type T struct{} | ||
|
||
// - @M defines/binding Meth=vname("method T.M", "test", _, "fun", "go") | ||
func (p *T) M() {} | ||
|
||
// - @F ref Fun | ||
// - TCall=@F ref/call Fun | ||
// - TCall childof Init | ||
var _ = F() | ||
|
||
// - @init defines/binding InitFunc = vname("func init#1", "test", _, "fun", "go") | ||
func init() { | ||
//- @F ref Fun | ||
//- FCall=@F ref/call Fun | ||
//- FCall childof InitFunc | ||
F() | ||
|
||
var t T | ||
|
||
//- @M ref Meth | ||
//- MCall=@M ref/call Meth | ||
//- MCall childof InitFunc | ||
t.M() | ||
} | ||
|
||
func imported() { | ||
//- @cmd defines/binding Cmd | ||
//- @exec ref OSExec | ||
//- @Command ref _ExecCommand | ||
cmd := exec.Command("pwd") | ||
|
||
//- @cmd ref Cmd | ||
//- @Run ref CmdRun=vname("method Cmd.Run","golang.org","","os/exec","go") | ||
//- @Run ref/call CmdRun | ||
cmd.Run() | ||
} |
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