JaroslavTulach commented on a change in pull request #3169:
URL: https://github.com/apache/netbeans/pull/3169#discussion_r710044112



##########
File path: 
ide/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateCompletionProvider.java
##########
@@ -89,8 +89,9 @@ private static boolean isAbbrevDisabled(JTextComponent 
component) {
     public static class Collector implements CompletionCollector {
 
         private static final String SELECTED_TEXT_VAR = 
"${0:$TM_SELECTED_TEXT}";
-        private static final Pattern SNIPPET_VAR_PATTERN = 
Pattern.compile("\\$\\{\\s*([-\\w]++)([^}]*)?}");
-        private static final Pattern SNIPPET_HINT_PATTERN = 
Pattern.compile("([-\\w]++)(?:\\s*=\\s*(\\\"([^\\\"]*)\\\"|\\S*))?");
+        private static final Pattern SNIPPET_VAR_PATTERN = 
Pattern.compile("\\$\\{\\s*([-\\w]++)((?:\\s*[-\\w]++(?:\\s*=\\s*(?:\\\"[^\\\"]*\\\"|[-\\w]++))?)*\\s*)?}");

Review comment:
       I didn't bother to decipher. But having few tests showing what the 
pattern matches and what it rejects wouldn't hurt future readers.




-- 
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

Reply via email to