mbien commented on code in PR #9054:
URL: https://github.com/apache/netbeans/pull/9054#discussion_r2577038674


##########
php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java:
##########
@@ -271,6 +279,42 @@ private void processPHPTags(Map<String, List<OffsetRange>> 
folds, Document docum
         }
     }
 
+    private void processNowdoc(Map<String, List<OffsetRange>> folds, Document 
document) {
+        if (document instanceof BaseDocument) {
+            BaseDocument doc = (BaseDocument) document;
+            doc.readLock();
+            try {
+                TokenSequence<PHPTokenId> ts = 
LexUtilities.getPHPTokenSequence(doc, 0);
+                if (ts == null) {
+                    return;
+                }
+                ts.move(0);
+                int startOffset = -1;
+                int endOffset = -1;
+                while (ts.moveNext()) {
+                    Token<PHPTokenId> token = ts.token();
+                    if (token != null) {
+                        PHPTokenId id = token.id();
+                        switch (id) {
+                            case PHP_NOWDOC_TAG_START:
+                                startOffset = ts.offset();
+                                break;

Review Comment:
   could use the arrow switch variant if you want. NB might be able to convert 
to it automatically if the hint shows up



##########
php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java:
##########
@@ -271,6 +279,42 @@ private void processPHPTags(Map<String, List<OffsetRange>> 
folds, Document docum
         }
     }
 
+    private void processNowdoc(Map<String, List<OffsetRange>> folds, Document 
document) {
+        if (document instanceof BaseDocument) {
+            BaseDocument doc = (BaseDocument) document;

Review Comment:
   feel free to use Java 17 features. The whole php cluster was bumped to 
javac.release=17.
   ```java
   if (document instanceof BaseDocument doc) {
   ```



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