bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

Heredoc code folding working on free, but not Premium #2885

Open johnny-solargard opened 4 months ago

johnny-solargard commented 4 months ago

Describe the bug I would like to use code folding on Heredoc blocks and purchased the Premium version which states support for Heredoc code folding.

Unfortunately, it's not working and strangely enough, it works on the free version, but NOT the Premium version.

To Reproduce Open VS code with Intelephense Premium installed and create a Heredoc block in PHP, folding does not work

Expected behavior I would expect code folding to only work on the Premium version.

Screenshots

prem-disabled

prem-enabled

Platform and version OS: Windows 10 Intelephense version: 1.10.4

bmewburn commented 4 months ago

The first is using the built in vscode indent folding that can be controlled with editor.foldingStrategy . What's the reasoning behind placing html in a heredoc rather than just placing it directly in the file? Is there some advantage to this?

johnny-solargard commented 4 months ago

Yes, this particular form field is used in multiple views in the application. I wanted a simple way to reuse it without trying to integrate a templating engine or create a form function/class.

Could you help me understand how to get Heredoc code folding to work when Premium is enabled? Right now, I have to disable Premium features for it to work.

Thanks for your help!

bmewburn commented 4 months ago

Set editor.foldingStrategy to indentation for now until this can be implemented in the intelephense folding provider. Alternatively just move your html out of the heredoc and put it directly in the file. I don't understand the reasoning for putting a chunk of html in a heredoc only to immediately echo it out.

johnny-solargard commented 4 months ago

That worked perfectly. Thanks Ben!