I have built an angular1 application, which has thousands of methods in many many controllers, etc. During the development, I wasn't too careful when creating docs comments. I have spent the night fixing the format to be able to generate docs, again.
Now I get this error message: Don't know how to format @ngdoc: method
.
I have learned from other, similar questions, that this happens (or might happen), when the @methodOf
attribute is missing. The Error message does not clarify where this happens.
So I'd like to find all those ngdoc comments, which are not properly formatted, using the IDEs (PhPStorm) search function and a regular expression.
This the current Expression, that I have come up with:
\/\*\*\s*\n\s\*\s@ngdoc method\n(\s\*.*(?<!methodOf)\n)*\s\*\/
From these comments, I'd like it to find the second one, only:
/**
* @ngdoc method
* @name app.admin:AuditLogController#auditsWatch
* @methodOf app.admin:AuditLogController
*/
/**
* @ngdoc method
* @name app.admin:AuditLogController#auditsWatch
*/
/**
* @name app.admin:AuditLogController#auditsWatch
*/
Test it here: https://regex101.com/r/wfIiZJ/1
So basically I'd like it to find any comment, that starts off with
/**
and @ngdoc method
, ends with */
and does not have methodOf
somewhere in between.
The closest I have come, is this one:
\/\*\*\s\n*.*(?!methodOf)\n*.*\n\s\*\/
https://regex101.com/r/qpt8G7/1
I'll continue trying, but maybe someone has the solution and is willing to share. Any help here is greatly appreciated!