forked from golang/tools
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/goxls/testdata: add overload unimported test
- Loading branch information
Showing
17 changed files
with
230 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package c | ||
|
||
func Add = ( | ||
func(a, b int) int { | ||
return a + b | ||
} | ||
func(a, b string) string { | ||
return a + b | ||
} | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
package c | ||
|
||
type Foo struct { | ||
} | ||
|
||
func (a *Foo) MulInt(b int) *Foo { //@mark(c_foo_mulInt,"MulInt") | ||
println "mulInt" | ||
return a | ||
} | ||
|
||
func (a *Foo) MulFoo(b *Foo) *Foo { //@mark(c_foo_mulFoo,"MulFoo") | ||
println "mulFoo" | ||
return a | ||
} | ||
|
||
func (Foo).Mul = ( | ||
(Foo).MulInt | ||
(Foo).MulFoo | ||
) |
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,14 @@ | ||
package c | ||
|
||
func MulInt(a, b int) int { //@mark(c_mulInt,"MulInt") | ||
return a * b | ||
} | ||
|
||
func MulFloat(a, b float64) float64 { //@mark(c_mulFloat,"MulFloat") | ||
return a * b | ||
} | ||
|
||
func Mul = ( | ||
MulInt | ||
MulFloat | ||
) |
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,33 @@ | ||
package d | ||
|
||
const GopPackage = true | ||
|
||
type Foo struct { | ||
} | ||
|
||
const Gopo_Foo_Mul = ".MulInt,.MulFoo" | ||
const Gopo_Mul = "MulInt,MulFloat" | ||
|
||
func Add__0(a int, b int) int { //@mark(d_add__0,"Add__0") | ||
return a + b | ||
} | ||
|
||
func Add__1(a string, b string) string { //@mark(d_add__1,"Add__1") | ||
return a + b | ||
} | ||
|
||
func (a *Foo) MulInt(b int) *Foo { //@mark(d_foo_mulInt,"MulInt") | ||
return a | ||
} | ||
|
||
func (a *Foo) MulFoo(b *Foo) *Foo { //@mark(d_foo_mulFoo,"MulFoo") | ||
return a | ||
} | ||
|
||
func MulInt(a int, b int) int { //@mark(d_mulInt,"MulInt") | ||
return a * b | ||
} | ||
|
||
func MulFloat(a float64, b float64) float64 { //@mark(d_mulFloat,"MulFloat") | ||
return a * b | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
gopls/internal/goxls/testdata/overload/overload_unimport.gop.in
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,24 @@ | ||
func _() { | ||
c.add //@unimported("add", c_add_unimported) | ||
c.mul //@unimported("mul", c_mul_unimported) | ||
c.mulInt //@unimported("mulInt", c_mulInt_unimported) | ||
c.MulInt //@unimported("MulInt", c_MulInt_unimported) | ||
} | ||
|
||
func _() { | ||
d.add //@unimported("add", d_add_unimported) | ||
d.mul //@unimported("mul", d_mul_unimported) | ||
d.mulInt //@unimported("mulInt", d_mulInt_unimported) | ||
d.MulInt //@unimported("MulInt", d_MulInt_unimported) | ||
} | ||
|
||
|
||
/* c.add */ //@item(c_add_unimported, "add", "Go+ overload func\n\nfunc (from \"golang.org/lsptests/overload/c\")", "func") | ||
/* c.mul */ //@item(c_mul_unimported, "mul", "Go+ overload func\n\nfunc (from \"golang.org/lsptests/overload/c\")", "func") | ||
/* c.mulInt */ //@item(c_mulInt_unimported, "mulInt", "Go+ alias func\n\nfunc (from \"golang.org/lsptests/overload/c\")", "func") | ||
/* c.MulInt */ //@item(c_MulInt_unimported, "MulInt", "func (from \"golang.org/lsptests/overload/c\")", "func") | ||
|
||
/* d.add */ //@item(d_add_unimported, "add", "Go+ overload func\n\nfunc (from \"golang.org/lsptests/overload/d\")", "func") | ||
/* d.mul */ //@item(d_mul_unimported, "mul", "Go+ overload func\n\nfunc (from \"golang.org/lsptests/overload/d\")", "func") | ||
/* d.mulInt */ //@item(d_mulInt_unimported, "mulInt", "Go+ alias func\n\nfunc (from \"golang.org/lsptests/overload/d\")", "func") | ||
/* d.MulInt */ //@item(d_MulInt_unimported, "MulInt", "func (from \"golang.org/lsptests/overload/d\")", "func") |
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 was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
gopls/internal/goxls/testdata/unimported/unimported.gop.in
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
gopls/internal/goxls/testdata/unimported/unimported_cand_type.gop
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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