Sublime Forum

Getting intelephense to see *.latte files as PHP


A simple question: I have LSP-Intelephense installed and working just fine for PHP files (that have *.php extensions). I’m using Latte for templating on a project and I’d very much like intelephense to do all its stuff on *.latte files. Those files have the scope source.latte.

How do I tell Sublime that LSP-Intelephense should fire up when I open a *.latte file?

That’s all I want to know. I’m not interested in learning about the deep internals of possibly documented-or-possibly-not documented incantations that require standing on your left foot unless it’s an even-numbered day in a leap year according a Hobbit calendar system written about in some fan-fic story somewhere.

I’m becoming increasingly annoyed with Sublime. I know there’s this weird “we’re not happy 'til you’re not happy” ethic in its user-hostile settings system, but I’m on the verge of just giving up and moving over to the memory hog that is VS-Code. There are hours – days – I’m not ever getting back.



You can open the package settings by running Preferences: LSP-intelephense Settings from the Command Palette and add ”selector”: “source.php | source.latte”. I don’t know whether intelephense actually understands latte files.



First, and foremost, your advice worked perfectly and I thank you very, very much. Intelephense understands .latte files well enough for the formatter to operate, which was what I was mainly going for. There’s a working language definition that handles everything else (completion/syntax highlighting).

Thank you again. I really don’t want to leave Sublime because most days it just works and I feel comfortable using it. My takeaway from this is ask for help sooner. And thank you for letting my temper tantrum pass without comment.

1 Like