GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ruby_foldable_groups option by bootleq · Pull Request #272 · vim-ruby/vim-ruby

Conversation

@bootleq

@bootleq bootleq commented Sep 29, 2015

Copy link
Copy Markdown
Contributor

Implementation of my proposal at #258.

Usage of ruby_foldable_groups is written in doc (ft-ruby-syntax.txt).

Also prepared example files for checking (manually).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bootleq added 25 commits September 28, 2015 23:30
@bootleq
Describe ruby_foldable_groups option usage
953e741
@bootleq
Helper function for foldable groups
d4bd6f6
@bootleq
Add example file for syntax test
283a970
Only have manual test for the time being.
@bootleq
Complete example for %Q %W %! %x
9f93ca9
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.
@bootleq
Respect % foldable_groups option for %Q %W %! %x
3aadf43
@bootleq
Only accept 1 arg for percent_generator
9d890e7
@bootleq
Fix %Q syntax example
f6938f6
- Add back double quote coverage.
- Remove invalid `%W foo ` syntax.
@bootleq
Respect % foldable_groups option for %q %w %s
cea3244
@bootleq
Respect % foldable_groups option for %r
c9f66b5
@bootleq
Respect % foldable_groups option for %i %I
05acf35
@bootleq
Example file for verifying normal regex
f4f2f0a
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.
@bootleq
Another part of normal regex example
f23b02c
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.
@bootleq
Add / foldable_groups option for normal regexp
c12d0ff
@bootleq
Add string foldable_groups option
0407687
For multiline 'string' "string" and `shell command`.
@bootleq
Add : foldable_groups option for symbol region
1930020
@bootleq
Add << foldable_groups option for here document
3d30d88
It's hard to enumerate every case, so just separate to valid/invalid
section, see example file for detail.
@bootleq
Add def class module foldable_groups options
f6742e6
3 types share one example file, but can be config separately.
@bootleq
Add do begin case foldable_groups options
efa55ac
Put there simple blocks into one `blocks` example.
@bootleq
Add { and [ foldable_groups options
4c7c160
@bootleq
Respect if foldable_groups option
575fa5e
@bootleq
Add for foldable_groups option
abfd23f
For `for`, `while` and `for` loops.
@bootleq
Add # foldable_groups option for comment
8cf26a5
Known `=begin xxx` should be valid comment, but seems not detected well
when ruby_no_comment_fold is set.
@bootleq
Add __END__ foldable_groups option
7346399
@bootleq
Prepare to rearrange example files
70a75bc
Should remove `percent` level under 'etc/examples' directory.
@bootleq
Regenerate syntax examples
76907a5
@dkearns dkearns added the syntax label Oct 22, 2015
@dkearns

dkearns commented Oct 22, 2015

Copy link
Copy Markdown
Member

Thanks. I'm happy to merge this or something similar.

Does anyone have any objections?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dkearns dkearns self-assigned this Nov 7, 2015
@bruno-

bruno- commented Jan 30, 2016

Copy link
Copy Markdown

Hi,
I'm so glad I found this PR! I was looking for this feature for a long time, awesome work @bootleq

Here are the steps I did to test this locally:

  • cd to local vim-ruby plugin installation
  • $ git fetch origin pull/272/head:foldable to pull this PR
  • $ git checkout foldable

I've tried setting g:ruby_foldable_groups variable to a couple values and all things worked.

👍 for merging this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@janko

janko commented Feb 8, 2016

Copy link
Copy Markdown

It would be really awesome if this was part of vim-ruby, it really helps when reading code from other gems 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndrewRadev

AndrewRadev commented May 8, 2016

Copy link
Copy Markdown
Member

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.

bootleq reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bootleq added 3 commits May 14, 2016 12:40
@bootleq
Merge branch 'master' into foldable
7a2c2cb
* 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
@bootleq
Update example generator to follow master changes
6caa402
- Whitespace delimited `%` literal, a696da8
- Heredoc with `<<~` form, a28f8df
@bootleq
Delete generated syntax example files
8067516
Developer can generate these files if needed, follow instruction in
etc/example/generators.
@bootleq

bootleq commented May 23, 2016

Copy link
Copy Markdown
Contributor Author

Hi, @AndrewRadev, thank you very much for reviewing.
I've merged master and actually using this branch for days. I think it's ready to prepare merging.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndrewRadev

AndrewRadev commented May 25, 2016

Copy link
Copy Markdown
Member

👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndrewRadev
AndrewRadev merged commit c9f5523 into vim-ruby:master May 25, 2016
@bootleq
bootleq deleted the foldable branch May 28, 2016 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dkearns dkearns

Labels

syntax

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@bootleq @dkearns @bruno- @janko @AndrewRadev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.