Is it possible to get PHP intellisense in latte files in VSCode?

bernhard
Member | 51
+
0
-

I'm using VSCode with the PHP Intelephense Extension: https://marketplace.visualstudio.com/items?…

That works great for PHP files, but in my latte files I get no helpful hints… So for example if I had a $block variable being a Foo object having methods bar() and baz() I'd like to get suggestions for ->bar() and for ->baz() as soon as I type $block->… in my latte file.

Something like this: https://i.imgur.com/i9Zf4HB.png

Is that possible somehow?

Thx in advance!

Last edited by bernhard (2022-09-09 16:02)

Rick Strafy
Nette Blogger | 81
+
0
-

Only in PHPStorm.

bernhard
Member | 51
+
0
-

Thx for your answer!

How does that work or look like in PHPStorm? Maybe there's a way to port it to VSCode?

Rick Strafy
Nette Blogger | 81
+
0
-

I think there is no simple way to port it, most developers are using PHPStorm, I was searching the blog (it's pain these days, because someone got obsessed with image generators and ruined all image thumbnails) and I found this article https://blog.nette.org/…-type-system#… that can help you in phpstorm, it works quite well when you use templateType – for example https://github.com/…efault.latte#L1

Last edited by Rick Strafy (2022-09-09 16:21)

materix
Backer | 83
+
0
-

This plugin is awesome: https://mesour-intellij-plugins.github.io/latte.html.

You might consider switching to PHPStorm instead of VSCode.