File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
src/main/kotlin/com/github/xepozz/php_opcodes_language Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ enum class Opcodes() {
44 INIT_NS_FCALL_BY_NAME ,
55 INIT_FCALL ,
66 INIT_FCALL_BY_NAME ,
7+ FRAMELESS_ICALL_0 ,
8+ FRAMELESS_ICALL_1 ,
9+ FRAMELESS_ICALL_2 ,
10+ FRAMELESS_ICALL_3 ,
711 NEW ,
812 FETCH_CLASS_CONSTANT ,
913 FETCH_STATIC_PROP_R ,
Original file line number Diff line number Diff line change @@ -204,6 +204,39 @@ class PHPOpReferenceContributor : PsiReferenceContributor() {
204204 }
205205 )
206206
207+ registrar.registerReferenceProvider(
208+ PlatformPatterns .psiElement(PHPOpParameter ::class .java)
209+ .withParent(
210+ PlatformPatterns .psiElement(PHPOpParenExpr ::class .java)
211+ .withParent(
212+ PlatformPatterns .psiElement(PHPOpArgument ::class .java)
213+ .withParent(
214+ PlatformPatterns .psiElement(PHPOpInstruction ::class .java)
215+ .withName(
216+ * arrayOf(
217+ Opcodes .FRAMELESS_ICALL_0 ,
218+ Opcodes .FRAMELESS_ICALL_1 ,
219+ Opcodes .FRAMELESS_ICALL_2 ,
220+ Opcodes .FRAMELESS_ICALL_3 ,
221+ )
222+ .map { it.name }
223+ .toTypedArray(),
224+ )
225+ )
226+ )
227+ ),
228+ object : PsiReferenceProvider () {
229+ override fun getReferencesByElement (
230+ element : PsiElement ,
231+ context : ProcessingContext
232+ ): Array <out PsiReference > {
233+ println (" PHPOpTypes.IDENTIFIER: ${element.text} " )
234+ val functionName = element.text
235+ return arrayOf(PhpFunctionNameReference (element, functionName))
236+ }
237+ }
238+ )
239+
207240 registrar.registerReferenceProvider(
208241 PlatformPatterns .psiElement(PHPOpStringLiteral ::class .java)
209242 .withParent(
You can’t perform that action at this time.
0 commit comments