vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

suggest postfix .interface and .meth for a struct in same package

Open loveyandex opened this issue 2 years ago • 4 comments

please add them any go programmer really want it

we need this two posfix auto complete intellisenc

1.Mystruct.interface postfix suggestion

suppose we have this code

const ( SMS = 1 Email = 2 )

type Notification struct { To string Message string }

type Notifier interface { SendNotification(Notification) string }

type SMSNotification struct{}

func (n SMSNotification) SendNotification(notification Notification) string { return "" }

when i type SMSNotification.interface, extension should suggest Notifier interface then user select it extension should write signature of methods of Notifier for SMSNotification struct just like that: func (smsn *SMSNotification) SendNotification(notification Notification) string { panic("not impl yet") }

2.Mystruct.meth postfix suggestion

second neccessary feature is method impl suggestion for an struct automatically suppose i decide add a new method to SmsNotification so when i type SmsNotification.meth , extention should write new method signature with letting us for auto complement the Name of method, inputs of method and output types of method step by step : just like that func (sn *SmsNotification) newNameOfMEthod(inputs TypeNew) (OutputType){ panic("not impl yet") }

hint:pointer sign* should be default because most of times pointer needed

thanks for your attention these two feature is the fundamental of Golang struture and without it the go-vscode is not meaning a go lang extension :)) always be alive and updated

loveyandex avatar Feb 05 '23 06:02 loveyandex

@suzmue issue text updated (feature 2:mystruct.meth)

loveyandex avatar Feb 16 '23 05:02 loveyandex

plz tell something @suzmue @mattetti @mislav

loveyandex avatar Feb 24 '23 09:02 loveyandex

why not impl it

this is most need for gophers

loveyandex avatar May 11 '24 12:05 loveyandex

@suzmue

loveyandex avatar May 11 '24 12:05 loveyandex