Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Generate method stub #277

Closed
benoitdion opened this issue Apr 2, 2016 · 3 comments
Closed

Generate method stub #277

benoitdion opened this issue Apr 2, 2016 · 3 comments
Labels
separate-extension-candidate The feature is best served from a separate extesion,

Comments

@benoitdion
Copy link

Implement this old Visual Studio feature: https://msdn.microsoft.com/en-us/library/tcz8b6zc(v=vs.90).aspx

@lukehoban
Copy link
Contributor

Happy to accept a PR for this.

It should be possible to build this as a VS Code Code Action added to https://github.com/Microsoft/vscode-go/blob/master/src/goCodeAction.ts.

@ramya-rao-a
Copy link
Contributor

From @klaidliadon in #1620

It would be nice to have a "create function/method" command for functions/methods that are not yet defined.

For instance:

type a int64

type s struct{}

func main(){
    var err error
    if err = someFunc(a(1), s{}); err != nil {
        log.Fatal(err)
    }
}

Should create something like:

func someFunc(v1 a, v2 s){
   return nil
}

@ramya-rao-a
Copy link
Contributor

Closing this issue for the below reasons:

  • There hasn't been much interest in terms of upvotes of comments from the community
  • This would require the understanding of the types of input parameters. The Go extension is written in a way to avoid trying to parse and understand the AST. It relies on external Go tools to do the same and return results. Since there is no such tool available at the moment, we don't have a clear way to implement this feature

If there is such a Go tool, I would prefer this feature be implemented as a separate VS Code extension. This is because as VS Code and this extension has gained popularity, we have seen a gradual scope creep over the past year. Being a sole maintainer of this project, it is getting a little hard to support all incoming requests and maintaining the ever growing set of features.

Therefore, one criteria I am using now in the triaging process is whether the feature request would make sense as a separate extension. This current feature request appears to be so.

@ramya-rao-a ramya-rao-a added separate-extension-candidate The feature is best served from a separate extesion, and removed help wanted labels Aug 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
separate-extension-candidate The feature is best served from a separate extesion,
Projects
None yet
Development

No branches or pull requests

3 participants