atom-fold-functions icon indicating copy to clipboard operation
atom-fold-functions copied to clipboard

Fold "type NAME struct {...}" on Golang

Open vsile opened this issue 4 years ago • 1 comments

Is there a way to fold Golang-struct

type user struct {
    Name string
}

🔻

type user struct {...}

vsile avatar Mar 13 '20 08:03 vsile

Hi, I believe you can in a couple steps:

  • Figure out the scopes on those lines. I do have a scopes command in the extension, but I have forgotten how to trigger it :D There are also some baked-in commands for it too but I think they only show the scope at the cursor.
  • And add them to your config for the extension... Here is a bit more on that: https://github.com/robballou/atom-fold-functions#configurable-scopes-new

Basically this extension works off the scopes defined in a language. The configurable scope thing lets you configure in case languages have different features or different ways of marking things. I hope this makes sense and helps. I'll leave this open in case there are any issues with setting this up.

robballou avatar Mar 13 '20 13:03 robballou