Skip to content

Commit 65e3656

Browse files
committed
feat: make string be external references host
1 parent 1e30936 commit 65e3656

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/kotlin/com/github/xepozz/php_opcodes_language/language/parser/PHPOp.bnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ parameter ::= IDENTIFIER
6767

6868
string_literal ::= TEXT
6969
{
70-
implements=["com.intellij.psi.PsiLanguageInjectionHost"]
70+
implements=["com.intellij.psi.PsiLanguageInjectionHost" "com.intellij.psi.PsiLiteralValue"]
7171
extends="com.github.xepozz.php_opcodes_language.language.psi.impl.PHPOpStringLiteralBaseImpl"
7272
}
7373

@@ -84,4 +84,4 @@ live_range_statements ::= (live_range_statement | EOL)*
8484

8585
live_range_statement ::= NUMBER COLON live_range_range LPAREN live_type RPAREN
8686
live_range_range ::= NUMBER DASH NUMBER
87-
live_type::= IDENTIFIER (SLASH IDENTIFIER)?
87+
live_type::= IDENTIFIER (SLASH IDENTIFIER)?

src/main/kotlin/com/github/xepozz/php_opcodes_language/language/psi/impl/PHPOpStringLiteralBaseImpl.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.intellij.lang.ASTNode
77
import com.intellij.psi.LiteralTextEscaper
88
import com.intellij.psi.PsiLanguageInjectionHost
99

10-
abstract class PHPOpStringLiteralBaseImpl : PHPOpStringLiteral, PHPOpElementImpl, PsiLanguageInjectionHost {
10+
abstract class PHPOpStringLiteralBaseImpl : PHPOpStringLiteral, PHPOpElementImpl {
1111
constructor(node: ASTNode) : super(node)
1212

1313
override fun getPresentation() = PresentationData(text, null, getIcon(0), null)
@@ -22,4 +22,6 @@ abstract class PHPOpStringLiteralBaseImpl : PHPOpStringLiteral, PHPOpElementImpl
2222
}
2323

2424
override fun createLiteralTextEscaper() = LiteralTextEscaper.createSimple(this)
25+
26+
override fun getValue(): String = text
2527
}

0 commit comments

Comments
 (0)