Comments (5)
Thank you for pointing it out.
We will look at it soon.
from vscode-postfix-go.
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.
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.
Sorry for being late, I didn't notice the issue.
I will look into it.
from vscode-postfix-go.
This should be fixed in 0.0.12 which was just released.
Thank you for reporting.
from vscode-postfix-go.
Related Issues (10)
- hope support multi value
- hope support multi line
- Underscore problem
- Split `for` template into `for` and `forr`.
- New template: `.struct`
- New template: .interface
- 🆕Should add Switch statement in the postfix template
- New templates: .int32, .int64, .float32, .float64 HOT 5
- Add comment line in .struct template when struct name starts with Uppercase.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-postfix-go.