-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add curly-brace code folding #162
base: master
Are you sure you want to change the base?
Conversation
Thanks for contributing! Be aware that the integration checks have failed. You should be able to test those on your side using |
After moving it into the dictionary, I'm seeing some interesting new folding issues that I didn't see before, so some debug work is needed. My apologies if this PR lingers for a while on my side, but once I have everything working again, I'll correct the pull tree and work on the failing integration tests. I also have a 2nd change I will submit to add support for folding of // comment blocks. I think it should be a new entry
|
Take into account that the syntax order is relevant, and may explain the folding issues. You were defining it after block, which made it have priority over it. Now it will have less priority. I would avoid the use of |
75a6607
to
4b036ca
Compare
The branch has been updated with the requested change. This meant implementing a new "match_skip" option for the dictionary. I am expecting the failing tests for indent.sv since this changes the folding behavior for 'all'. Will resolve those next. |
There is a conflict between the new
The
Reordering curly and assign in the fold-order list does not appear to change the results. |
I think I already have a patch to end assign also with comma, but that alone will not solve this problem. |
I think ending assign at a comma still could also cause an issue with curly folding for the following case due to use of curly in concatenation. In this case the beginning curly gets consumed by the assign fold.
For now I've removed assign from my list of folds so I can make sure that curly has no conflicts with any other fold types. |
This implements a new
curly
option for verilog_syntax_fold_lst to allow code-folding of all the curly brace constructs in SV (enum, constraint, coverpoint, dist, inside) but also for large multi-line concatenations.I did briefly start to separate this out into
curly
andcurly_nested
but discovered that I couldn't see a behavior difference betweenblock
andblock_nested
anymore (vim 8.1). I'm seeing multiple levels of begin/end nesting when usingblock
. I personally always use nesting, so I haven't pursuedcurly_nested
further until I understand the expected behavior.My code base is holding up well with this, but it needs testing under varied coding styles.