Intellij idea: how to create a custom regular expression validation rule

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.

+4
source share

Source: https://habr.com/ru/post/1607639/


All Articles