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

Snippet improvement suggestions #1920

Closed
@alecthomas

Description

Hello,

First off, let me just say that coming from Sublime Text, I am loving vscode and vscode-go. They're clean, functional, maintained, professional products.

I have a couple of suggestions for snippets which I think would improve the common use case, based on similar functionality in GoSublime:

  1. For "iferr", it seems like the 99% common case is to "return err", but the snippet does not have this and instead highlights "return" for replacement. I found the following to be much more convenient:

    if err ${1:!=} nil {
      return ${2:}err
    }
  2. A set of "method" snippets could be dynamically generated from the existing types in the package. That is, if a type type Foo <...> exists, dynamically add a snippet of the form func (f *Foo) ${1:method}(${2}) ${3} { ${4} }

Anyway, thanks for listening and all the best,
Alec

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions