tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
485 stars 38 forks source link

Long function calls inside Svelte expressions aren't wrapped #140

Closed ghost closed 1 year ago

tomblachut commented 4 years ago

Please update to 0.13.0

ghost commented 4 years ago

Update isn't available in the Plugin page of PhpStorm and even after trying to install 0.13.0 with the zip PhpStorm rejects it with "Plugin 'Svelte' is incompatible with this installation".

tomblachut commented 4 years ago

I guess you have version 2019. Sorry about that but I don't have capacity to maintain compatibility with older products. This is an evening side project

ghost commented 4 years ago

I updated now but it still doesn't seem to break long lines. Do I have to do something other than execute the action "Reformat Code"?

tomblachut commented 4 years ago

It should work, maybe there is a bug :) Please paste the code you want to format.

ghost commented 4 years ago

Of course. Here you go:

<table class="uk-table uk-table-small uk-table-divider">
    <tbody>
        <tr>
            <td>Stars</td>
            <td>{stats.player.achievements.bedwars_level}</td>
        </tr>
        <tr>
            <td>Wins</td>
            <td>{stats.player.achievements.bedwars_wins}</td>
        </tr>
        <tr>
            <td>Games Played</td>
            <td>{stats.player.stats.Bedwars.games_played_bedwars_1}</td>
        </tr>
        <tr>
            <td>Winstreak</td>
            <td>{Math.max(stats.player.stats.Bedwars.eight_one_winstreak, stats.player.stats.Bedwars.eight_two_winstreak, stats.player.stats.Bedwars.eight_two_ultimate_winstreak, stats.player.stats.Bedwars.four_three_winstreak, stats.player.stats.Bedwars.four_four_winstreak)}</td>
        </tr>
        <tr>
            <td>Games Played</td>
            <td>{stats.player.stats.Bedwars.games_played_bedwars_1}</td>
        </tr>
    </tbody>
</table>
tomblachut commented 4 years ago

image Well this is certainly weird.

For now you'll need to add newlines yourself or use Prettier. And to be honest this expression should be refactored to dedicated variable/function/component

tomblachut commented 1 year ago

Migrated to WEB-61846 Svelte: format long markup expressions