You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/03/29 04:28:34 UTC

[GitHub] [netbeans] MegJayan opened a new pull request #3884: Add validation for external snippets

MegJayan opened a new pull request #3884:
URL: https://github.com/apache/netbeans/pull/3884


   Add validation for external snippets


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lbownik commented on a change in pull request #3884: Add validation for external snippets

Posted by GitBox <gi...@apache.org>.
lbownik commented on a change in pull request #3884:
URL: https://github.com/apache/netbeans/pull/3884#discussion_r837853692



##########
File path: java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
##########
@@ -1280,6 +1281,19 @@ private StringBuilder inlineTags(List<? extends DocTree> tags, TreePath docPath,
                 case TEXT:
                     TextTree ttag = (TextTree)tag;
                     sb.append(ttag.getBody());
+					break;
+				default:
+                    if (tag.getKind().toString().equals("SNIPPET")) {
+                        sb.append("<pre>"); //NOI18N
+                        sb.append("<code>"); //NOI18N
+                        List<DocTree> attributes = TreeShims.getSnippetDocTreeAttributes(tag);

Review comment:
       "attributes" seems unused




-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lbownik commented on a change in pull request #3884: Add validation for external snippets

Posted by GitBox <gi...@apache.org>.
lbownik commented on a change in pull request #3884:
URL: https://github.com/apache/netbeans/pull/3884#discussion_r837852599



##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/TreeShims.java
##########
@@ -227,6 +229,33 @@ public static ExpressionTree getGuardedExpression(Tree node) {
             throw TreeShims.<RuntimeException>throwAny(ex);
         }
     }
+	
+	public static List<DocTree> getSnippetDocTreeAttributes(DocTree node) {
+        try {
+            Class gpt = Class.forName("com.sun.source.doctree.SnippetTree"); //NOI18N
+            return isJDKVersionRelease18_Or_Above()
+                    ? (List<DocTree>)gpt.getDeclaredMethod("getAttributes").invoke(node)  //NOI18N
+                    : null;

Review comment:
       wouldn't returning empty list be more apropriate?




-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] vieiro commented on a change in pull request #3884: Add validation for external snippets

Posted by GitBox <gi...@apache.org>.
vieiro commented on a change in pull request #3884:
URL: https://github.com/apache/netbeans/pull/3884#discussion_r840880827



##########
File path: java/java.editor/test/unit/data/goldenfiles/org/netbeans/modules/editor/java/GoToSupportTest/javadocsnippet_HighlightAndReplace_cornercase.pass
##########
@@ -0,0 +1,5 @@
+<html><body><font size='+0'><b><a href='*0'>test.&#x200B;Test</a></b></font><pre>public void <b>testHighlightAndReplace_cornercase</b>()</pre><p><pre><code>  public static void \bmain\b(String... args) {	

Review comment:
       This file is missing a license header.




-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists