jamalsenouci / sublimetext-syntaxfold

Sublime Text Plugin that provides a configurable command and popup for folding code based on syntax
MIT License
40 stars 6 forks source link

PHP heredocs #10

Closed v217 closed 9 years ago

v217 commented 9 years ago

Just an idea for improvement: Please support PHP heredocs.

jamalsenouci commented 9 years ago

I'm not familiar with php, what would need changing to support this

v217 commented 9 years ago

It's a way to escape arbitrary text. You have the same concept in the Unix Shell. Here an example:

cat << HEREDOC
arbitrary text not containing H-E-R-E-D-O-C
HEREDOC

or:

cat << OTHER_name
arbitrary text not containing herestring O-T-H-E-R-_-n-a-m-e
OTHER_name

The point is that you can redefine your quotes (in this case HEREDOC or OTHER_name) as needed.

jamalsenouci commented 9 years ago

You could define a marker in the config as follows: { "endMarker": "\<\<\<HEREDOC", "name": "test", "startMarker": "HEREDOC" } but it does require a specified string which may not be exactly what you want. I think supporting the general pattern would likely fit better within a php plugin.