Giter Club home page Giter Club logo

Comments (5)

HamzaAnis avatar HamzaAnis commented on September 17, 2024

Thank you for pointing it out.
We will look at it soon.

from vscode-postfix-go.

HamzaAnis avatar HamzaAnis commented on September 17, 2024

Can you please recreate this bug and add more details in you issue? Because it working fine without any trailing period.

from vscode-postfix-go.

JoeyBoolean avatar JoeyBoolean commented on September 17, 2024

Thank you for this extension btw. Its really great!
Here is the json for the custom template

{
    "name": "handleerr",
    "when": [
      "function-call"
    ],
    "description": "Creates an Internal Error",
    "body": "${1:val}, err := {{expr}}\nif err != nil {\n\tsvc.logger.Print(err)\n\treturn ${2:response}, toolbox.InternalError(err)\n}"
  }

This is what the go code looks like before the postfix call

func (svc *service) CreateAccessToken(
	ctx context.Context,
	access AccessToken,
) (AccessToken, error) {

	svc.fixedLengthSession(ctx, access.user, validTo)

}

This is how I'm calling the postfix snippet

func (svc *service) CreateAccessToken(
	ctx context.Context,
	access AccessToken,
) (AccessToken, error) {

	svc.fixedLengthSession(ctx, access.user, validTo).handleerr

}

And this is what it changes to

func (svc *service) CreateAccessToken(
	ctx context.Context,
	access AccessToken,
) (AccessToken, error) {

val, err := svc.fixedLengthSession(ctx, access.user, validTo).
if err != nil {
	svc.logger.Print(err)
	return response, toolbox.InternalError(err)
}

}

The period at the end of this line should not be there

val, err := svc.fixedLengthSession(ctx, access.user, validTo).

I suspect its line 36 in the postfixCompletionProvider

.map(t => t.buildCompletionItem(code, position, line.text.substring(dotIdx, position.character)))

The suffix is the substring starting at the dotidx going to the position character. Not sure if maybe it needs to start at dotidx+1. That seems to fix my issue but I'm not sure if that would cause problems elsewhere.

from vscode-postfix-go.

yokoe avatar yokoe commented on September 17, 2024

Sorry for being late, I didn't notice the issue.
I will look into it.

from vscode-postfix-go.

yokoe avatar yokoe commented on September 17, 2024

This should be fixed in 0.0.12 which was just released.
Thank you for reporting.

from vscode-postfix-go.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.