Skip to content

PHP: Added folding for heredoc and nowdoc#9054

Merged
matthiasblaesing merged 1 commit into
apache:masterfrom
troizet:folding_heredoc_nowdoc
Dec 5, 2025
Merged

PHP: Added folding for heredoc and nowdoc#9054
matthiasblaesing merged 1 commit into
apache:masterfrom
troizet:folding_heredoc_nowdoc

Conversation

@troizet
Copy link
Copy Markdown
Collaborator

@troizet troizet commented Dec 1, 2025

In this PR:

  • Added folding for heredoc and nowdoc
  • Fixed test FoldingTest
  • Added new tests in FoldingTest

Example:

<?php

echo <<<HEREDOC
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
HEREDOC;


echo <<<'NOWDOC'
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
NOWDOC;

Before:
before

After:
after

after_collapsed

@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label Dec 1, 2025
@troizet troizet requested review from junichi11 and tmysik December 1, 2025 05:48
@mbien mbien added the Editor label Dec 1, 2025
Comment thread php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java Outdated
Comment thread php/php.editor/src/org/netbeans/modules/php/editor/csl/FoldingScanner.java Outdated
@mbien mbien added this to the NB29 milestone Dec 1, 2025
@troizet troizet force-pushed the folding_heredoc_nowdoc branch from a2fae5b to a09d1e5 Compare December 1, 2025 14:03
@troizet
Copy link
Copy Markdown
Collaborator Author

troizet commented Dec 1, 2025

@mbien Thanks for the tip. I've made the corrections.

Copy link
Copy Markdown
Member

@tmysik tmysik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work.

@matthiasblaesing
Copy link
Copy Markdown
Contributor

@troizet the git commit message should have the structure:

  • first line is summary of the changes
  • empty line
  • detailed info about the changes (if necessary)

Would you mind updating to something along the lines of this?

Added folding for heredoc and nowdoc

Additionally:
- Fixed test FoldingTest
- Added new tests in FoldingTest

Additionaly:
- Fixed test FoldingTest
- Added new tests in FoldingTest
@troizet troizet force-pushed the folding_heredoc_nowdoc branch from a09d1e5 to c4fc922 Compare December 4, 2025 02:13
@troizet
Copy link
Copy Markdown
Collaborator Author

troizet commented Dec 4, 2025

@matthiasblaesing Updated the commit message.

@matthiasblaesing
Copy link
Copy Markdown
Contributor

@troizet thanks for your work!

@matthiasblaesing matthiasblaesing merged commit 190f8f3 into apache:master Dec 5, 2025
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Editor PHP [ci] enable extra PHP tests (php/php.editor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants