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



##########
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:
       Quoted-string syntax disallows `\"` IMHO. However, the pattern is used 
to parse NB built-in templates (using only "simple" quoted-strings).




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