matthiasblaesing commented on PR #8834: URL: https://github.com/apache/netbeans/pull/8834#issuecomment-3433456816
Outside this PR was the comment: > https://github.com/apache/netbeans/commit/c77d09eda1927adb41107a9eee49fd1fcc504cfd use correct return (null for no match) >> I chose this {-1,-1} because I didn't want to change the color of '<' or '>' characters. So I checked the Netbeans sources and I found out that there is {-1,-1} used for an invalid span (it works, but I'm not 100% sure if it is correct). Because null here is used when an opening or a closing element doesn't exist. Ok, I understand. That needs a comment though if kept. The correct solution would be to return `null` from `findOrigin` for the cases where you would return `{-1,-1}` from `findMatches`. Cite from `findOrigin`: > Returns: > The starting and ending offset of the original area or null if the matcher can't detect the origin area within the lookahead distance. If null is returned the infrastructure will never call the findMatches method on this instance. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
