-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Provide folding support #614
base: master
Are you sure you want to change the base?
Conversation
@Melandel how does this look to you? Will this provide the functionality you're imagining? And enough flexibility? |
There are some problems here that need to be addressed, as discussed with @Melandel in slack. Take this function signature: public void SomeMethod() { When this is folded (with the default Vim
This is fine. But if the function has an attribute, then: [Fact]
public void SomeTest() { becomes
which is not helpful. There are 2 ways to deal with this, that I can see:
The problem with 2. is that this is annoying to users who have custom All of this also applies to comments. We could potentially fold them all individually, but that is a bit silly for attributes which are only a single line:
I'm not quite sure which way to go at the moment, I'll try some things out and see. Feedback appreciated! |
bc33c92
to
aaae959
Compare
This feature seems very nice! Is it still being worked on? |
Ah, no not really 😅 I got stuck with how to manage fold text and somehow never got past it. Just over a year later though, I really should give this another look... |
I am watching attentively. |
Hey, I am still watching 👀 Please merge :) |
This PR adds command
:OmniSharpFold
to provide OmniSharp-roslyn backed folding, using a/v2/codestructure
call to find all ranges in the file, and then build folds based on these.Currently any range >=
&foldminlines
will have a fold created.The
/v2/codestructure
endpoint doesn't include comment blocks, but these can be easily found by checking the lines above structural elements.To do:
g:OmniSharp_fold_include_comments
variable (default to 1) and add comment-matching functionalityg:OmniSharp_fold_kinds
variable, default to['class', 'property', 'method']
, allowing users control over what they want folded.Closes #610