File tree Expand file tree Collapse file tree
src/main/kotlin/com/github/tempest/framework/views/injection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ class PHPLanguageInjector : MultiHostInjector {
4949 }
5050 }
5151
52+ val tagsMap = mapOf (
53+ " {!!" to " !!}" ,
54+ " {{" to " }}" ,
55+ )
5256 private fun injectIntoText (
5357 element : PsiLanguageInjectionHost ,
5458 registrar : MultiHostRegistrar
@@ -58,8 +62,8 @@ class PHPLanguageInjector : MultiHostInjector {
5862 .apply { if (size < 2 ) return }
5963
6064// println("children: $children")
61- val openTag = children.firstOrNull() ?.psi ? : return
62- val closeTag = children.lastOrNull() ?.psi
65+ val openTag = children.find { it.text == " {!! " || it.text == " {{ " } ?.psi ? : return
66+ val closeTag = children.find { it.text == tagsMap[openTag.text] } ?.psi
6367
6468// println("openTag: ${openTag.text}, closeTag: ${closeTag?.text}")
6569 if ((openTag.text == " {!!" && closeTag?.text == " !!}" ) || (openTag.text == " {{" && closeTag?.text == " }}" )) {
You can’t perform that action at this time.
0 commit comments