Community
Participate
Working Groups
In certain circumstances (see bug 41302), it could be interesting to know whether a source position is inside a comment or not. We currently have two solutions to offer this kind of information: 1) Directly from scanner (ie. IScanner and/or PublicScanner) 2) Using DOM AST Comment nodes (ie. DefaultCommentMapper through CompilationUnit public access methods...)
Of course using solution 1) and modifying IScanner interface would break existing clients of this interface...
Created attachment 16808 [details] Solution 1) changes without modifying IScanner Add getLastCommentEnd() to Scanner and PublicScanner in JDT/Core land. Modify CommentAnalyser.checkEnd(IScanner,int) as follow: private boolean checkEnd(IScanner scanner, int position) { return scanner.getCurrentTokenStartPosition() <= position && position < ((PublicScanner)scanner).getLastCommentEnd(); } These changes fix bug 41302 and avoid to modify IScanner not to break existing clients but sounds like a hack... I have to figure out what could be solution 2)....
I'll see if this is feasible for M6. Otherwise defer to next release
Unfortunately, defer post 3.1
Reopen as LATER is deprecated...
WONTFIX as I cannot reproduced bug 41302 with latest 3.3 RC4...