Skip to content

x/tools/gopls: feature request: support more postfix snippets for primitive type #73367

Open
@xieyuschen

Description

@xieyuschen

Feature I want

Gopls has provided some postfix snippet, for example:

Image

I believe we can add more useful postfix snippets:

  1. []byte!: help to convert a string to a slice of bytes.
  2. string!: help to convert a slices of bytes to a string.
  3. T!: help to convert a type from another, the postfix will generate |(variable) for users to input a type they want. | is the cursor position. Further more, we may provide some primitive type if the variable is a primitive(float, int, uint, etc...).
  4. itoa!: help to convert an int to string
  5. more cases...

Indeed we can provide a lot of helpful postfix snippets, not only the cases I mentioned above. Please kindly let me know your opinions about it. @adonovan @findleyr
I want to contribute these small features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions