It changes comment line style (from "# ..." to "// ...")
I setup VSCode to "format on save" using pretty-php and when I save it changes #region Twig to // region Twig and because of this I lose collapsible regions in VSCode. I couldn't find any relative pretty-php setting, and I don't want to change editor.foldingStrategy. Thanks.
PS: // #region Twig is also not working.
Thanks for reporting this.
Can you direct me towards a spec or project with this use of #-based tagging, or is this a standalone approach you're using in your own projects?
Thanks for the reply, and sorry for my ignorance on the background; it is a standalone approach that I try to use in my personal project.
-
Unsaved file, unfolded region
-
Unsaved file, folded region
-
Saved file, region has gone
Appendix A
Below is my .vscode/settings.json contents for the project;
{
"editor.formatOnSave": false,
"[php]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "lkrms.pretty-php"
},
"[twig]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "mblode.twig-language-2"
}
}
PS: For JavaScript and TypeScript // #region works in VSCode but for PHP it does not.
Ah, so you're using VS Code's #region markers for folding?
I didn't even know these were a thing!
It seems reasonable to me for pretty-php to ignore these when normalising comments. Will try to get an update out soon.
It wouldn't be a problem if we were able to change those aforementioned "defined markers", yet here we are now 🤷🏻.
PS: I was using those markers without knowing about them (simple SO answer did the trick for me in the case of JS/TS back then), thank you for letting me know that they exist ☺️
This has been fixed in v0.4.94, which should be available via VS Code's respective marketplaces in a few minutes :)
(Apologies for the delay due to difficult personal circumstances; I'm sure this issue has been a frustrating one for you in the meantime.)
Thank you for your effort, sorry for the circumstances. Hopefully they will gone away