Support optional return of error if #19
Labels
No labels
bug
dev
documentation
duplicate
enhancement
good first issue
help wanted
improvement
invalid
question
testing
wontfix
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/no-go.nvim#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Via recent issue #7 comment, I think it's useful to provide an option via user config to allow the block without
return. Please consider to add this feature in coming release. ThanksJust FYI, I will be taking this week off maintaining this plugin due to thanksgiving in the US. I am planning to get to this though!
@longthanhtran
What do you think it should say/do when this happens? It has to be different then when there is a return, since it does have the return for the arrow, or the var name to use. Let me know
I think the behaviour should stay the same, as the
if err != nilblock contains the error handling logic for case like middleware pattern for net/http. The whole idea is to collapse the block when skimming through the file.If anything more than that, it would be more useful to have additional +n before the (current) inverted arrow (n line in the block just like import block) but this would increase the complexity.
@longthanhtran
Sorry for not getting around to this. This has been on my mind for a while. I have the query written out but i still dont understand what exactly you mean. Could you give me something like this:
Original text:
What I want the plugin to collapse this into:
With the logic you would like.
What confuses me about your request is that the inverted arrow represents the return. But you dont want the return to be in this query! So, in my strong opinion, there should be no arrow in this change. let me know! Ill try to get to this once you response.
Ah, I got your concern now, so in case the
if err != nil ..block comes withoutreturnthen there is no inverted arrow. Yes, this is correct.Cool, what do you think about this:
So this:
eol_seperatorwill become:
What do you think? This is actually more complex that I initially though.
I think the block should be collaped as single line (even better with number of line in replacement of the inverted arrow) so the logic will stay the same with just one configuration property without too many case no matter how many lines in the block.