Open sven-ahrens opened 2 years ago
@sven-ahrens Hi, can you check your format setting?
I have two blade formatter installed, either won't break the syntax
@sven-ahrens I noticed that your input tag does not close properly
@sven-ahrens I noticed that your input tag does not close properly
Hey, first of all: Thank you so much for replying.
You are right, my example is missing the closing tag but in my "real" code it doesn't. I checked that right now.
and it turns into:
Also I've selected your formatter:
I'm not sure if it breaks because of the force-expand-multiline
but I've made an easier example outside of my project and this is leading to the same result:
<div>
<label></label>
<input type="radio" name="test" value="1" @checked($test->works()) />
</div>
<div>
<label></label>
<input
type="radio"
name="test"
value="1"
@checked($test-
>works()) />
</div>
@sven-ahrens How about change force-expand-multiline
to force-aligned
. This may fit your needs.
@sven-ahrens How about change
force-expand-multiline
toforce-aligned
. This may fit your needs.
I'm coming from Vue background and I'm used to have them exactly like in my example.
I tried your version out and yes this works but it seems like it's a bug then, isnt it?
The formatter will break when having force-expand-multiline
activated
@sven-ahrens Blade formatter is build based on HTML formatter. However, php syntax is not treat the same way as html.
Since the new directive @check() comes out, it is not like simple key-value attributes that recognized by HTML formatter.
I think that's why it treat php syntax ->
the part >
as close tag.
Description
In my blade file I've multiple
@checked
directives that include a php variable accessing a method.When I format this, it turns into:
Expected behaviour
I'd assume that it does not break the object operator and keeps it on the same line.
So instead of this:
I'd expect this: