diff --git a/CHANGELOG.md b/CHANGELOG.md index 306b0d7..c5ac520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### Fixed - Fixed linear marker preview +- Fixed line marker performance warning ## [0.2.7] - 2023-11-15 diff --git a/src/main/kotlin/dev/slint/ideaplugin/ide/lineMarkers/PreviewRunLineMarkerContributor.kt b/src/main/kotlin/dev/slint/ideaplugin/ide/lineMarkers/PreviewRunLineMarkerContributor.kt index 4909225..b4c3d78 100644 --- a/src/main/kotlin/dev/slint/ideaplugin/ide/lineMarkers/PreviewRunLineMarkerContributor.kt +++ b/src/main/kotlin/dev/slint/ideaplugin/ide/lineMarkers/PreviewRunLineMarkerContributor.kt @@ -9,9 +9,8 @@ import dev.slint.ideaplugin.lang.psi.SlintElementTypes.* class PreviewRunLineMarkerContributor : RunLineMarkerContributor() { override fun getInfo(element: PsiElement): Info? { return when (element.elementType) { - COMPONENT_DEFINITION -> { - val componentName = getComponentName(element) ?: return null - Info(PreviewComponentAction(componentName)) + COMPONENT -> { + Info(PreviewComponentAction("")) } else -> { @@ -19,12 +18,4 @@ class PreviewRunLineMarkerContributor : RunLineMarkerContributor() { } } } - - private fun getComponentName(element: PsiElement): String? { - val componentName = element.children.firstOrNull() ?: return null - if (componentName.elementType != COMPONENT_NAME) { - return null - } - return componentName.text - } }