tmysik commented on code in PR #7423:
URL: https://github.com/apache/netbeans/pull/7423#discussion_r1625836739
##########
php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java:
##########
@@ -2175,7 +2193,12 @@ public void visit(SingleFieldDeclaration node) {
assert (parent instanceof FieldsDeclaration);
FieldsDeclaration fieldsDeclaration = (FieldsDeclaration)
path.get(1);
if (ts.token().id() == PHPTokenId.PHP_OPERATOR &&
TokenUtilities.textEquals("=", ts.token().text())) { //NOI18N
- int realNodeLength =
fieldsDeclaration.getModifierString().length() + " ".length() +
name.getEndOffset() - name.getStartOffset(); //NOI18N
+ // GH-7190
+ int fieldTypeLength = getTypeLength(fieldType);
+ if (fieldTypeLength != 0) {
+ fieldTypeLength += " ".length();
Review Comment:
As above, perhaps using a constant named e.g. `SPACE_LENGTH` could be a good
idea here.
--
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