p0358 / notepadpp-CodeStats

Notepad++ plugin for Code::Stats (https://codestats.net)
Other
38 stars 21 forks source link

.phtml files are detected as plain text #19

Closed dariodor closed 1 year ago

dariodor commented 4 years ago

Similar to other issues, PHP .phtml extension files are detected as plain text.

p0358 commented 4 years ago

I thought I replied to this issue with the bot, but apparently it didn't work.

Should .phtml be detected as PHP or HTML?

dariodor commented 4 years ago

Hi, as PHP.

dariodor commented 4 years ago

It would be best PHP inside <?php ?> tags and HTML outside.

sample here: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml

p0358 commented 1 year ago

As of https://github.com/p0358/notepadpp-CodeStats/commit/5809418c99750e110e2ad77fe9b884bd11c44d6b .phtml was added with mapping to PHP.

It would be best PHP inside <?php ?> tags and HTML outside.

Sadly this will not be possible in Notepad++ as it only does "dumb" syntax highlighting without deep enough language understanding, and the plugin interface is limited, so this would be extremely challenging to develop. I think vscode has some support for nested languages like this, of other editors, but I also don't know how that's exposed to plugin interface, though to my knowledge its Code::Stats extension doesn't support such thing either.