Comments (4)
@mattiab-axis Thanks for bringing this to my attention and providing an example for me to use. I have never used Golang before so that is extremely helpful. I have released version 1.1.0 which should address this problem.
from vscode-inline-parameters.
Thank you, methods seems to work like they should now!
I noticed another oddity, which seems to occur when you call a function from another package which takes an interface as a parameter. I don't know if you want to continue in this issue or create another one, but I'll give a repro here. Unfortunately since it requires two packages it needs a little more setup.
anotherpackage/anotherpackage.go
package anotherpackage
type Struct struct{}
func (a Struct) Method(s string) string {
return s
}
func Function(s string) string {
return s
}
type Interface interface {
Method(string) string
}
func FunctionWithInterfaceParameter(a Interface, s string) string {
return a.Method(s)
}
example.go
package main
import "example/anotherpackage"
func main() {
anotherpackage.Function("test") // Correct.
a := anotherpackage.Struct{}
a.Method("test") // Correct.
anotherpackage.FunctionWithInterfaceParameter(a, "test") // First param is correct. Second should be "s:" but is "Interface:" (the type name of the first param).
}
Then either run go mod init example
or create a go.mod
with this content (if you're running Go 1.18 that is):
module example
go 1.18
from vscode-inline-parameters.
ok, I looked into that problem. Looks like it is a bug because I messed up the regex to parse the variadic parameters. I have published version 1.1.1 that should fix that bug.
from vscode-inline-parameters.
Awesome, thanks a lot! I'll close the task.
from vscode-inline-parameters.
Related Issues (15)
- Golang: missing parameter hint on variable function call. HOT 2
- How to make the background color transparent
- The last one is outside the bracket (golang) HOT 5
- Extension causes high cpu load HOT 2
- vscodium support HOT 2
- Are any way to remove background on the inline name parameters ? HOT 2
- Python: single letter parameters aren't handled HOT 2
- PHP: wrong inlay hints HOT 5
- Golang support plan? HOT 2
- Python inline parameters won't work for Python<3.6 HOT 8
- JS/TS support HOT 2
- Inline parameters don't show when there is a space in the file path HOT 20
- How to modify the background color HOT 2
- Java: parameter hints duplication HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-inline-parameters.