Skip to content

Commit fe33098

Browse files
committed
Support to KtCollectionLiteralExpression inlay hint
1 parent 52b8af3 commit fe33098

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## [Unreleased]
66

7+
### Added
8+
- Support to KtCollectionLiteralExpression inlay hint
9+
710
## [1.0.3] - 2024-08-12
811

912
### Changed

src/main/kotlin/io/github/andrelmv/plugin/inlay/InlayStringInterpolationHintCollector.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyze
88
import org.jetbrains.kotlin.idea.intentions.loopToCallChain.isConstant
99
import org.jetbrains.kotlin.idea.structuralsearch.visitor.KotlinRecursiveElementVisitor
1010
import org.jetbrains.kotlin.psi.KtBinaryExpression
11+
import org.jetbrains.kotlin.psi.KtCollectionLiteralExpression
1112
import org.jetbrains.kotlin.psi.KtExpression
1213
import org.jetbrains.kotlin.psi.KtNameReferenceExpression
1314
import org.jetbrains.kotlin.psi.KtNamedFunction
@@ -65,10 +66,10 @@ class InlayStringInterpolationHintCollector(
6566

6667
private fun PsiElement.isKtNameReferenceExpression(): Boolean {
6768
return this is KtNameReferenceExpression
68-
&& ((this.context is KtValueArgument && this.isConstant())
69+
&& ((this.context is KtCollectionLiteralExpression && this.isConstant())
70+
|| (this.context is KtValueArgument && this.isConstant())
6971
|| this.context is KtNamedFunction
7072
|| this.context is KtBinaryExpression)
71-
7273
}
7374

7475
private fun PsiElement.isKtStringTemplateExpression(): Boolean {

0 commit comments

Comments
 (0)