IntellijAlpine icon indicating copy to clipboard operation
IntellijAlpine copied to clipboard

x-for with two params doesn't work

Open dpetrovaliev opened this issue 3 years ago • 2 comments

Looks like v-for with two params case isn't handled. Plugin version: v0.4.2

Screenshot: Screenshot 2021-08-30 at 17 53 07

dpetrovaliev avatar Aug 30 '21 14:08 dpetrovaliev

Yeah. This is a known issue. I'm not sure when a fix will be possible—right now I'm essentially using the IntelliJ javascript parser for Alpine directives, but because x-for implements custom syntax that's not valid javascript. The only solution would be to implement a custom parser, which is a pretty big thing to take on :/

inxilpro avatar Aug 30 '21 19:08 inxilpro

@inxilpro Hi from the WebStorm team. Thank you for the great plugin!

About the issue, I don't think that it requires re-writing a parser from scratch. You can inject a custom JS language extension that can extend the JS syntax a bit. I did something like this for Riot.js (see parser).

So, you need to implement the chain: AlpineJSLanguage -> AplineJSParsingDefinition -> AlpineJSLanguageParser

anstarovoyt avatar Oct 19 '21 09:10 anstarovoyt