Open vadim-on-github opened 6 years ago
this would be great for PHP as well certainly when writing large object libraries. Assuming it is nothing more than adding an extension, could someone enlighten me where to do this?
I'm using Atom 1.30.0, and this plugin worked fine in my PHP project.
I'm using Atom 1.30.0 x64 with custom-folds 1.9.5 and it doesn't offer collapsing of <editor-fold ... marked areas.
Works fine for me using Atom 1.30.0 on a PHP file. Does Atom recognize your file as PHP?
If you're still having issues, can you post an example file that I can test with?
@bsegraves yes, it certainly does
@bsegraves ouuu, i did just notice that it works with a different kind of comment in a PHP file lol definitely would be great if it worked with both :)
lol, glad to hear it.
By the way, you can go into the settings and change the prefix to be whatever you want.
@bsegraves so what I thought might've been a bug turned into a feature request. Do you think you'd want to make it into a new feature in the future (to be able to fold with different kinds of comments in the same file)?
Unless I'm misunderstanding, it's already there! Check the settings:
@bsegraves yeah, i'm pretty sure you're misunderstanding :)
It is currently not possible to make a custom foldable region inside the <?php
and ?>
tags. You can only make them outside of them as illustrated in the picture of my comment
I guess this is a current workaround:
I just think it's a bit cumbersome to be breaking out of the <?php
and ?>
tags every time a code fold is needed :)
Ah, I get what it now. Interesting - the plugin is based on the language's syntax for comments. I'm not really sure why the comments within the php block, though clearly identified by the syntax color as comments, aren't picked up by the plugin as such.
@bsegraves very interesting indeed :) With PHP files having 2 possible languages in 1 file, who knows which language the plugin will pick. Would be great if it picked up both and worked with both. But anyways, glad you understand now. Cheers!
So, yes, no, it doesn't work
On 14 September 2018 at 06:31, Vadim H notifications@github.com wrote:
12 https://github.com/bsegraves/custom-folds/issues/12 thus becomes
related :)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bsegraves/custom-folds/issues/42#issuecomment-421227868, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiZeO6F-rUAV-Gu3iDz8lKDx_VK5-KWks5uazEkgaJpZM4WMiBU .
@bsegraves would you like to reopen this issue?
Yep, makes sense.
It's also not working on pure php files. If I save this as fold.php
I don't get folding:
<?php
// <editor-fold>
echo 'foo';
// </editor-fold>
Note 1: The file is recognized as PHP in Atom's status bar.
Note 2: There's no ?>
here, cause today's best practice is to omit it.
However, the following is working for the folding - but it's not valid PHP syntax!!
<?php
<!-- <editor-fold>
echo 'foo';
<!-- </editor-fold>
So there's certainly the wrong comment detection mechanism at work.
This is clearly a bug to me. You should fix it in any case - even if you can't find a solution for the two-languages-in-one-file problem, since today it's more common to have pure php files than <?php
blocks inside html files.
Works like a charm in JS files though. Thanks for the great plugin!