structure search and replace kotlin script constraint

Answered

hi,

is there any way to use script constraint in kotlin structural search? i haven't seen any example using it for kotlin and the github page doesn't mention it either.

by the way, any advice on references use cases? i haven't used them yet and IIRC there weren't any examples for kotlin either.

0
1 comment
Hello Daniel!

1. There is a mention regarding examples for script constraints in IntelliJ IDEA doc: https://www.jetbrains.com/help/idea/search-templates.html#script_constraints
"You can check the syntax of script constraints that are used in the following existing templates:
• sample method invocation with a constant parameter
• classes
• classes with parameterless constructors
• static fields that are not final   
• interface that is not implemented or extended 
• fields/variables read    
• fields/variables with given name template updated".

Can you please take a look at these examples?

2. You can search for references using build-in templates.
You can take a look at one of the examples here: KTIJ-365 (https://youtrack.jetbrains.com/issue/KTIJ-365/Find-references-with-without-a-qualifier)

If you have some more questions, then it is better to create a ticket to YouTrack: https://youtrack.jetbrains.com/newIssue?project=KTIJ&summary=SSR:&draftId=25-5062304

Thank you for understanding!

--
Anton Mefodichev, Kotlin Support, JetBrains
0

Please sign in to leave a comment.