I am looking for a way to create an inspection rule in Intellij that identifies when they are inline comments and moves it to its own line above.
Example: Find:
someCode () // someComment
and replace with:
// someCommetn Somecode () .
I managed to find the correct regular expression for searching and replacing: Find: (. \ S.) (//) (. \ S.) Replace: $ 2 $ 3 \ n $ 1
But I canβt find a way to do this.
I read the documentation at
https://www.jetbrains.com/idea/help/creating-custom-inspections.html
but cannot find examples that use regexp to search and replace.
source
share