Turn Sublime Text into An Awesome IDE for Laravel / PHP with LSP and Intelephense
I like Sublime Text. I really do. I like how fast it is, how versatile it is, and overall I have a very good experience with it.
Despite how popular VS Code has become recently, I find it just a little slow to my liking. Then there is also PHPStorm which is feature-packed, but a little heavy to my liking.
So what if we can add some IDE features to an ultra-fast editor? That would be great isn’t it? Well that’s totally possible!
- Go to your Terminal app and install
npm -g i intelephense.
- Open the command palette in Sublime Text and run
Package Control: Install Package, then select
LSP-intelephenseto install both packages.
- Enable the server by running
LSP: Enable Language Serverin command palette. Then choose
lsp-intelephensefrom the menu.
- Go to
LSP > Servers > LSP-intelephenseunder
Package Settings, copy and paste the following json into your settings file to setup LSP and Intelephense:
"scopes": ["source.php", "embedding.php"],
Now restart your Sublime Text and you are all done! You should now be able to autocomplete accurately.