(Plugin) display one style, save another (or: display whitespace differently from what is actually saved)
I probably bungled the title, but here's what I'd love to be able to do:
$myTeamAligns => [
'arraysLikeThis' => 'and',
'it' => 'is',
'veryHardToRead' => 'forMe',
];
I love tabular information and I believe that code is written to be read by humans (otherwise we might as well write assembly). Anyway, my team disagrees and thinks, understandably, that not aligning array assignment is better for diffing/git blame -- and that it trumps legibility.
So what I'd love is if the code could LOOK like this to me in the editor:
$iPrefer => [
'to' => 'have',
'theCodeBe' => 'legibleLike',
'some' => 'thingInABook',
];
.. but without this affecting the style when I save the document.
Ideally, with some tweaks where the real (saved) whitespace would show when the cursor is on the line; where the display-only whitespace is shown with a different color or some underline style or the like.
I'm pretty sure that this is impossible out of the box in PHPStorm.
My question is: do you think it's possible to do this with a custom plugin?
Would it be worth my time to invest in trying to make such a plugin for myself?
请先登录再写评论。
Hi there,
https://youtrack.jetbrains.com/issue/IDEA-219203
I'm not JetBrains dev and do not know internals ... but if you want to implement this yourself... I think it should be quite an effort. Just using different Code Style when editing (when file is opened) and applying different one just before it gets saved is surely possible. Some moments to think about: