phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Bug: JavaScript code written in .php files cannot be folded correctly

Open AliceSync opened this issue 1 year ago • 2 comments

test code:

<script>
    function a() {

    }
    function b() {

    }
    function c() {

    }
</script>

correct: in .html display:

<script>...
</script>

In the past, I didn't encounter this issue with other extensions, and I think it's highly likely that the extension is overriding vscode's built-in HTML parsing. This issue needs to be fixed urgently, as it causes a lot of content inside script tags to not fold properly. In cases where there is a significant amount of JavaScript code, it can make development inconvenient.

AliceSync avatar Oct 22 '23 02:10 AliceSync

Thank you for pointing this out. I'm afraid we've never supported this and we will have to do it in the next updates.

ref. https://community.devsense.com/d/1745-folding-in-within-the-script-is-disabled

Miloslav avatar Oct 24 '23 09:10 Miloslav

Thank you for pointing this out. I'm afraid we've never supported this and we will have to do it in the next updates.

ref. https://community.devsense.com/d/1745-folding-in-within-the-script-is-disabled

I think you can consider letting VSCode's HTML parsing handle it instead of having your extension solve everything. In fact, the extension I used previously did it this way, and it worked well.

AliceSync avatar Oct 24 '23 10:10 AliceSync