<I'm writing a detekt rule>, and I'm trying to get...
# ktlint
e
I'm writing a detekt rule, and I'm trying to get autocorrect working with it, but
indentSize
always ends up being 2. Is there an easy way to get the correct
indentSize
or does it have to be calculated each time based on the
PsiElement/ASTNode
and where it's positioned in the file?
I'm defaulting to
2
for now so that my tests pass
r
the one that you’re trying to retrieve via
getUserData
comes actually from what you’ve set in
.editorconfig
and indeed it’s constant. If you are looking for how to get the current indent of a line, you can use our extension or if you need the indent of a node here’s how Kotlin does it
and then you just
.length
on the returned string
e
Thanks!