G-Rath / G-Rath/fold-call-blocks-plugin

Folding not triggering when carets in indentation of test block

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Java
Stars
8
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Currently folding only happens when the caret is within the block that will be folded (i.e `describe(''`, `it(''` and so on).

This means that if you have your caret on the intent of a block, folding won't be triggered.

See this gif for an example:

In particular, note where the caret is when the `//#region` tag folds, vs when folding takes place for the `describe` block.

![fold-test-blocks-plugin-i5](https://user-images.githubusercontent.com/3151613/58360616-e36db200-7edd-11e9-90c3-bf8342591a6f.gif)

Ideally we'd like to match the behaviour of other foldables as much as possible.

----

I suspect this behaviour actually might be a result of some "fold-up" logic, where IntelliJ looks for the next/closest element to fold when requested to fold, which for some reason our folds don't meet.

This folding happens with other foldables as well, such as class methods:

![fold-test-blocks-plugin-i5-2](https://user-images.githubusercontent.com/3151613/58603195-f8828080-82e3-11e9-80e1-aa04274998c7.gif)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.