I`m looking for a way to create an inspection rule in Intellij that identifies when there are inline comments and moves them to their own line above.
Example: Find
someCode() // someComment
and replace with
// someComment
someCode()
I was able to find the correct regexp to find and replace:
Find: (.\S. )(//)(.\S.)
Replace: $2$3\n$1
But I can`t find a way to make a rule of it.
I have read the documentation on https://www.jetbrains.com/idea/help/creating-custom-inspections.html But can`t find any examples that uses regexp for search and replace.