@@ -128,12 +128,12 @@ final class PcInlineValueProvider(
128
128
end for
129
129
end defAndRefs
130
130
131
- private def stripIndentPrefix (rhs : String , refIndent : String , defIndent : String ): String =
131
+ private def stripIndentPrefix (rhs : String , refIndent : String , defIndent : String , hasNextLineAfterEqualsSign : Boolean ): String =
132
132
val rhsLines = rhs.split(" \n " ).toList
133
133
rhsLines match
134
134
case h :: Nil => rhs
135
135
case h :: t =>
136
- val header = if h.startsWith( " { " ) then h else " \n " ++ refIndent ++ " " ++ h
136
+ val header = if ! hasNextLineAfterEqualsSign then h else " \n " ++ refIndent ++ " " ++ h
137
137
header ++ t.map(refIndent ++ _.stripPrefix(defIndent)).mkString(" \n " , " \n " , " " )
138
138
case Nil => rhs
139
139
@@ -255,14 +255,17 @@ final class PcInlineValueProvider(
255
255
case _ => false
256
256
}
257
257
.map(_.fullNameBackticked)
258
+ val hasNextLineAfterEqualsSign =
259
+ definition.tree.sourcePos.startLine != definition.tree.rhs.sourcePos.startLine
258
260
if conflictingSymbols.isEmpty then
259
261
Right (
260
262
Reference (
261
263
occurrence.pos.toLsp,
262
264
stripIndentPrefix(
263
265
extendWithSurroundingParens(definition.tree.rhs.sourcePos),
264
266
occurrence.tree.startPos.startColumnIndentPadding,
265
- definition.tree.startPos.startColumnIndentPadding
267
+ definition.tree.startPos.startColumnIndentPadding,
268
+ hasNextLineAfterEqualsSign
266
269
),
267
270
occurrence.parent.map(p =>
268
271
RangeOffset (p.sourcePos.start, p.sourcePos.end)
0 commit comments