[dotnet, inlays] support AFTER_LINE_END inlays in rider

GitOrigin-RevId: b31ef5562404c4540486accc7597b76fa0fd201c
This commit is contained in:
Nikolay Plyusnin
2024-06-17 21:57:02 +03:00
committed by intellij-monorepo-bot
parent 01a0db3047
commit 4aed217fd8

View File

@@ -126,22 +126,7 @@ class PresentationFactory(private val editor: Editor) : InlayPresentationFactory
}
@Contract(pure = true)
fun adjustToNextTextEqualWidth(base: InlayPresentation): InlayPresentation {
return DynamicInsetPresentation(base, object : InsetValueProvider {
fun getInset(roundUp: Boolean): Int {
val spaceWidth = EditorUtil.getPlainSpaceWidth(editor)
val additionalWidth = spaceWidth - base.width % spaceWidth
return if (roundUp) (additionalWidth + 1) / 2 else additionalWidth / 2
}
override val left: Int
get() = getInset(true)
override val right: Int
get() = getInset(false)
})
}
fun offsetFromTopForSmallText(base: InlayPresentation) = DynamicInsetPresentation(base, offsetFromTopProvider)
@Contract(pure = true)
override fun icon(icon: Icon): IconPresentation = IconPresentation(icon, editor.component)