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.
Adds intentions to work with fusion paths.
Split path at delimiter at caret
Motivation: start with a first deep override and notice that an additional expression in that block is necessary. Breaking the path and wrapping it in braces is somehow super buggy..
Only one block will be created at a time. I was thinking about having some option or multiple intentions to break up either the current or all path segments. Could be improved, if someone has an idea how this should behave.
Merge path up into surrounding block
Pretty much the reverse to splitting the path. If the block contains multiple paths, the path at the cursor will be pulled out and added after the block. An empty block will be removed.
Group common fusion paths
Creates a new block for the common prefix (= the path before the caret at a path separator).
Unfortunately still a bit buggy with the amount of whitespace created. Also currently conflicts pretty hard with prototype instanciation (e.g. merge
array.key = ...
intoarray = Neos.Fusion:DataStructure
) as a new block is created and the original block is removed.Might be a relatively easy fix to look for a prefix-candidate that already is block candidate.
However in this case I currently create the PSI tree from a string because I couldn't get the newlines to be created at the correct positions.
There could be an argument whether this is the correct trigger for an action like this though: it affects more lines than the current one and I could imagine use-cases where I only want to merge this specific line into an existing block.
It could be possible to "collect" all other paths into a prefix block, however that might not exist.
Also, merging into a block might be a desired behavior of the normal split path intention. But it might be surprising, if it just does that.