-
-
Notifications
You must be signed in to change notification settings - Fork 155
[Feature request] Generate constructor function #609
Copy link
Copy link
Open
Description
Hi, I use go.nvim for my daily golang stuff for personal projects. I love this project.
Is there any plans to add command for generating constructor (NewXxx) from struct?
go.nvim already has GoFillStruct, GoImpl, GoAddTag — so GoCtor (GoConstructor/Goctor/GoConstr...) feels like it shuold be there too, no?
Basically what I mean:
Cursor on struct:
type User struct {
name string
age int
email string
}:GoCtor would generate smth like:
func NewUser(name string, age int, email string) *User {
return &User{
name: name,
age: age,
email: email,
}
}How it could work maybe:
- Parse struct fields via treesitter (same way
GoAddTagdoes it)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels