Hi, I would like to write a rule where my class mu...
# ktlint
d
Hi, I would like to write a rule where my class must have a type parameter with 2 type constraints, i.e. I need
where A: X, A: Y
does anyone know how I can find this information out from the PSI? There seems to be zero documentation on the PSI?
s
If you write the code you want to lint for and then run
ktlint printAST
on the file it will print out all the nodes
p
Also have a look at the rules that are already defined in KtLint. Personally, I like to avoid psi as long as I can manage using AST only.
d
I used the intellij psi explorer
that helped a lot
p
Cool. Do you mean https://www.jetbrains.com/help/idea/psi-viewer.html or something else?