You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "troizet (via GitHub)" <gi...@apache.org> on 2023/04/06 15:12:52 UTC

[GitHub] [netbeans] troizet commented on a diff in pull request #5779: [GH-5355] PHP: Corrects the display of the guessed return type for a function or method in the documentation

troizet commented on code in PR #5779:
URL: https://github.com/apache/netbeans/pull/5779#discussion_r1159938724


##########
php/php.editor/src/org/netbeans/modules/php/editor/completion/DocRenderer.java:
##########
@@ -608,9 +608,12 @@ private String composeType(Collection<TypeResolver> types, Type.Kind typeKind) {
                 if (type.isResolved()) {
                     QualifiedName typeName = type.getTypeName(true);
                     if (typeName != null) {
-                        if (sb.length() > 0
-                                && (typeKind == Type.Kind.UNION || typeKind == Type.Kind.INTERSECTION)) {
-                            sb.append(" ").append(typeKind.getSign()).append(" "); // NOI18N
+                        if (sb.length() > 0) {
+                                if (typeKind == Type.Kind.INTERSECTION) {
+                                    sb.append(" ").append(typeKind.getSign()).append(" "); // NOI18N
+                                } else {
+                                    sb.append(" ").append(Type.Kind.UNION.getSign()).append(" "); // NOI18N

Review Comment:
   My assumption is that if more than one type is specified and it is clearly not an intersection, it is always a union. Or is it not so?
   Similar logic in NavigatorScanner:
   https://github.com/apache/netbeans/blob/0bcc927866938e6c7f57e1bfe8f852e983b3072f/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java#L425-L446



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