@@ -20,13 +20,13 @@ class HoconPropertiesReferenceProvider extends PsiReferenceProvider {
20
20
if (! isEnabled(element.getProject)) PsiReference .EMPTY_ARRAY
21
21
else {
22
22
val res = for {
23
- lit <- element.opt.collectOnly[PsiLiteral ]
23
+ lit <- element.opt.collectOnly[PsiLiteralValue ]
24
24
strValue <- lit.getValue.opt.collectOnly[String ]
25
25
hpath <- HoconPsiElementFactory .createPath(strValue, PsiManager .getInstance(element.getProject)).opt
26
26
strPath <- hpath.fullStringPath
27
27
} yield {
28
- val text = lit .getText
29
- val fullRange = ElementManipulators .getValueTextRange(lit )
28
+ val text = element .getText
29
+ val fullRange = ElementManipulators .getValueTextRange(element )
30
30
31
31
def makeRefs (off : Int , keys : List [String ]): List [HoconPropertyReference ] = keys match {
32
32
case Nil => Nil
@@ -47,7 +47,7 @@ class HoconPropertiesReferenceProvider extends PsiReferenceProvider {
47
47
val nextRef = subRefs.headOption
48
48
val revIndex = nextRef.fold(0 )(_.reverseIndex + 1 )
49
49
val keyRange = new TextRange (off, endOffset)
50
- val ref = new HoconPropertyReference (strPath, revIndex, key, lit, keyRange)
50
+ val ref = new HoconPropertyReference (strPath, revIndex, key, element, lit, keyRange)
51
51
ref :: subRefs
52
52
}
53
53
@@ -61,16 +61,17 @@ class HoconPropertyReference(
61
61
fullPath : List [String ],
62
62
val reverseIndex : Int ,
63
63
key : String ,
64
- lit : PsiLiteral ,
64
+ element : PsiElement ,
65
+ lit : PsiLiteralValue ,
65
66
range : TextRange
66
67
) extends PsiReference {
67
68
def getCanonicalText : String = key
68
- def getElement : PsiElement = lit
69
+ def getElement : PsiElement = element
69
70
def getRangeInElement : TextRange = range
70
71
71
- def createContext : ToplevelCtx = lit .getContainingFile match {
72
+ def createContext : ToplevelCtx = element .getContainingFile match {
72
73
case hf : HoconPsiFile => ToplevelCtx (hf)
73
- case _ => ToplevelCtx (lit , ToplevelCtx .ApplicationResource )
74
+ case _ => ToplevelCtx (element , ToplevelCtx .ApplicationResource )
74
75
}
75
76
76
77
def resolve (): PsiElement = createContext
@@ -79,7 +80,7 @@ class HoconPropertyReference(
79
80
.map(_.hkey).orNull
80
81
81
82
override def getVariants : Array [AnyRef ] = {
82
- val toplevelCtx = ToplevelCtx (lit , ToplevelCtx .ApplicationResource )
83
+ val toplevelCtx = ToplevelCtx (element , ToplevelCtx .ApplicationResource )
83
84
val opts = ResOpts (reverse = true )
84
85
85
86
val variantFields = fullPath.dropRight(reverseIndex + 1 ) match {
0 commit comments