[SOLVED] Find usages with "search for text occurrences" does not find occurrences in comments

Answered

PhpStorm 2018.3.5
Build #PS-183.5912.26, built on March 7, 2019
JRE: 1.8.0_152-release-1343-b28 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Example:

Usage search for "MyConstant" would not return the comment position even when executed with the enabled "search for text occurrences" option:

class MyClass {
/**
* @CUSTOM_ANNOTATION: ClassWithConstant::MyConstant
*/
private $property;
}

class ClassWithConstant {
const MyConstant = 1;
}
3 comments

Please use @uses ClassWithConstant::MyConstant annotation instead: https://youtrack.jetbrains.com/issue/WI-23177

0

Thanks, works fine. I have to add @uses as an additional annotation tho, because @CUSTOM_ANNOTATION was just a placeholder for some custom annotations we use for parsing class properties by reflection and therefore can't be removed.

0

Cool, thanks for letting me know.

0

Please sign in to leave a comment.