tomblachut / svelte-intellij

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

inject Svelte in attribute value #38

Closed unlocomqx closed 5 years ago

unlocomqx commented 5 years ago

I moved the injection from LanguageInjection to the MultiHostInjector I also used only SvelteLanguage for the injection to let SvelteCodeInjectionVisitor do the rest I couldn't do the same for attribute names, it seems unsupported as far as I tested

tomblachut commented 5 years ago

I couldn't do the same for attribute names

You mean shorthand props like <Foo {name}>?

unlocomqx commented 5 years ago

Yeah <Foo {name}> and also use:function transition:fade etc I checked other similar plugins, no one seems to do it, not even angular directives Attribute name is not a valid injection host as far as I understood

tomblachut commented 5 years ago

Okay I finally figured out #50 which gives me better outlook on the next steps. I think that this PR needs to be closed (but let's leave it open for now).

Inside that PR there's a comment with a roadmap and since you put significant amount of work into this plugin I thought this might interest you.

unlocomqx commented 5 years ago

Brilliant! I'd be glad if I contributed even with a good idea :smile: I'll close this PR because the multi injector was removed. A simpler way to do this could be by using <languageInjector

tomblachut commented 5 years ago

I think it's better to lazily parse attribute value

unlocomqx commented 5 years ago

Yes, I just saw the comment in #50 Cheers!