Writing my own syntax-aware custom folding plugin looks like a bit more 
work than I have time for right now, but I'm glad the feature exists.

I think I'm working out what would need to be supported in Go, and what 
would need to be supported in editors to do what I'm imagining.

For instance, some kind of 'reverse macro' / 'unmacro' / 'folding macro' 
definition syntax would need to be a Golang thing:
```
checkFoldUnmacro(rets, wrappedErr)
matches:
if err != nil {
  return rets, wrappedErr
}
foldsTo:
check wrappedErr
```

But then that golang 'folding macro' feature would hook into really 
simple/generic custom folding APIs for different editors.

On Friday, 19 July 2019 14:48:24 UTC+10, Florin Pățan wrote:
>
> I don't know how this works for vscode, but for GoLand you can write your 
> own syntax-aware custom folding plugin, see this plugin as an example of 
> how to do it: 
> https://plugins.jetbrains.com/plugin/9320-advanced-java-folding
>
> This doesn't mean we are not open to new ideas on how to improve the error 
> handling display to all users by default and we are happy to listen on your 
> opinions/needs.
>
> On Friday, July 19, 2019 at 5:58:19 AM UTC+3, kez....@gmail.com wrote:
>>
>> Thanks! I haven't heard of GoLand before.
>>
>> Looks like the One Line Returns feature is like an 80% solution, I would 
>> toggle that on all the time.
>>
>> I'm not sold on completely hiding the error line like you want, but I'll 
>> definitely start a thread with that GoLand dev about how hard it would be 
>> to make the folding slightly more generic.
>>
>> On Friday, 19 July 2019 10:18:52 UTC+10, Mike Schinkel wrote:
>>>
>>> Are there any editors that support some kind of customisable collapsing 
>>>> behaviour? Where the above code could be collapsed to something like:
>>>>
>>>
>>> Might be worth reading, commenting on and/or possibly upvoting this 
>>> feature proposal for GoLand?
>>>
>>> https://youtrack.jetbrains.com/issue/GO-7747
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fae72228-52e0-4a70-8ed8-74d17b09287b%40googlegroups.com.

Reply via email to