Closed npezza93 closed 6 years ago
Block parameters and surrounding pipes are grouped as one node and cannot be separately styled.
With TreeSitter on:
<div class="line cursor-line" style="" data-screen-row="47"> <span class=""> <span class="syntax--entity syntax--name syntax--function">imablock</span> <span class="syntax--keyword syntax--control">do</span> |param1, param2| </span> </div>
With TreeSitter off:
<div class="line cursor-line" style="" data-screen-row="47"> <span class=""> <span class="syntax--source syntax--ruby"> imablock <span class="syntax--keyword syntax--control syntax--start-block syntax--ruby">do</span> <span class="syntax--punctuation syntax--separator syntax--variable syntax--ruby">|</span> <span class="syntax--variable syntax--other syntax--block syntax--ruby">param1</span> <span class="syntax--punctuation syntax--separator syntax--object syntax--ruby">,</span> <span class="syntax--variable syntax--other syntax--block syntax--ruby">param2</span> <span class="syntax--punctuation syntax--separator syntax--variable syntax--ruby">|</span> </span> </span> </div>
Now with TreeSitter on I can how this styling might be the default because it is almost the exact same as a normal method definition:
<div class="line cursor-line" style="" data-screen-row="44"> <span class=""> <span class="syntax--keyword syntax--control">def</span> <span class="syntax--entity syntax--name syntax--function">imablock</span> <span class="syntax--punctuation syntax--definition syntax--parameters">(</span> param1, param2 <span class="syntax--punctuation syntax--definition syntax--parameters">)</span> </span> </div>
But in a method definition the parenthesis are wrapped in their own element. So
Thanks!
Expected behavior: To be able to style block parameters Actual behavior: Can no longer styling block parameters Reproduces how often: 100%
1.34.0-nightly2
Thanks for these report @npezza93 - just noting I can reproduce what you describe with 1.34.0-nightly0 on macOS 10.12.6, we'll ask the team to take a look.
Prerequisites
Description
Block parameters and surrounding pipes are grouped as one node and cannot be separately styled.
With TreeSitter on:
With TreeSitter off:
Now with TreeSitter on I can how this styling might be the default because it is almost the exact same as a normal method definition:
But in a method definition the parenthesis are wrapped in their own element. So
Thanks!
Steps to Reproduce
Expected behavior: To be able to style block parameters Actual behavior: Can no longer styling block parameters Reproduces how often: 100%
Versions
1.34.0-nightly2