-
Notifications
You must be signed in to change notification settings - Fork 292
Add ruby_foldable_groups option #272
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
Conversation
Only have manual test for the time being.
Found some existing problems when using space as delimiter: - `%Q foo\ \\\ bar ` is not detected as string. - They can't go across lines, so folding is not needed.
- Add back double quote coverage. - Remove invalid `%W foo ` syntax.
Aim to test this line: https://github.com/vim-ruby/vim-ruby/blob/8775819/syntax/ruby.vim#L124 Case of ternary operation (8c1c484) doesn't fold with below format: ```ruby / foo \/ \\\/ bar /s ``` so test `?` `:` separately.
Aim to test this line: https://github.com/vim-ruby/vim-ruby/blob/8775819/syntax/ruby.vim#L125 Not sure the purpose, just write case to reproduce the regex.
For multiline 'string' "string" and `shell command`.
It's hard to enumerate every case, so just separate to valid/invalid section, see example file for detail.
3 types share one example file, but can be config separately.
Put there simple blocks into one `blocks` example.
For `for`, `while` and `for` loops.
Known `=begin xxx` should be valid comment, but seems not detected well when ruby_no_comment_fold is set.
Should remove `percent` level under 'etc/examples' directory.
|
Thanks. I'm happy to merge this or something similar. Does anyone have any objections? |
|
Hi, Here are the steps I did to test this locally:
I've tried setting 👍 for merging this |
|
It would be really awesome if this was part of vim-ruby, it really helps when reading code from other gems 👍 |
|
I'm sorry for taking so long to get around to this PR. I appreciate your work, @bootleq, and I definitely appreciate you going to extra mile to document it as well. I don't like the duplication with the syntax regions, but I guess it's the best way to implement it, and it's definitely a useful feature. I notice there's a few files that generate example ruby files. Those are fine, I guess, but it seems like you've also committed the generated files? Could you remove those from the PR? As long as there are instructions on how to generate them, there's no point in having them in the repository. You'd also need to merge master. It would probably be a conflict in the syntax definitions, I'm afraid. Once you do that, and take care of those example files, I'll go ahead and merge this. |
* master: Match much more complicated structures in block's arguments in a very simple way. Fix issue with `end`s in multiline ERB output Add support for Ruby 2.3 heredoc <<~ syntax Add support for RSpec 3.4 to compiler Improve rubyMultilineComment performance Fix whitespace delimited percent 'strings' Don't add second .rb to filenames Match RSpec failures with index greater than 9 Account for new safe navigation operator Highlight character literals in Range literals Highlight Rational and Complex literals Highlight all of the unary methods. Don't highlight `.?c` as a "character" literal. Set browsefilter for gui_gtk Remove ruby_spellcheck_strings related duplication Conflicts: syntax/ruby.vim
Developer can generate these files if needed, follow instruction in etc/example/generators.
|
Hi, @AndrewRadev, thank you very much for reviewing. |
|
👍 |
Implementation of my proposal at #258.
Usage of
ruby_foldable_groupsis written in doc (ft-ruby-syntax.txt).Also prepared example files for checking (manually).