-
Notifications
You must be signed in to change notification settings - Fork 380
/
RsMethodCall.kt
31 lines (23 loc) · 1.2 KB
/
RsMethodCall.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Use of this source code is governed by the MIT license that can be
* found in the LICENSE file.
*/
package org.rust.lang.core.psi.ext
import com.intellij.lang.ASTNode
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import org.rust.lang.core.psi.RsExpr
import org.rust.lang.core.psi.RsLifetime
import org.rust.lang.core.psi.RsMethodCall
import org.rust.lang.core.psi.RsTypeReference
import org.rust.lang.core.resolve.ref.RsMethodCallReferenceImpl
import org.rust.lang.core.resolve.ref.RsReference
val RsMethodCall.lifetimeArguments: List<RsLifetime> get() = typeArgumentList?.lifetimeList.orEmpty()
val RsMethodCall.typeArguments: List<RsTypeReference> get() = typeArgumentList?.typeReferenceList.orEmpty()
val RsMethodCall.constArguments: List<RsExpr> get() = typeArgumentList?.exprList.orEmpty()
val RsMethodCall.textRangeWithoutValueArguments: TextRange
get() = TextRange(startOffset, typeArgumentList?.endOffset ?: identifier.endOffset)
abstract class RsMethodCallImplMixin(node: ASTNode) : RsElementImpl(node), RsMethodCall {
override val referenceNameElement: PsiElement get() = identifier
override fun getReference(): RsReference = RsMethodCallReferenceImpl(this)
}