- Install LSP and LSP-intelephense from Package Control.
- Restart
- Then run
composer global require phpactor/phpactor - Then in LSP settings
"clients": {
"phpactor": {
"enabled": true,
"command": ["C:\\Users\\your_username_here\\AppData\\Roaming\\Composer\\vendor\\bin\\phpactor.bat", "language-server"],
"selector": "source.php"
}
}Note: Provide client settings didn't work for https://lsp.sublimetext.io/language_servers/#php
- Install
JsPrettierfrom package control - Run
npm install --global prettier - Preferences / Package Settings / JsPrettier / Settings user
{
"auto_format_on_save": true
}It will format frontend files
I tried using prettier php plugin, passed cli argument didn't work neither worked with prettier config file. Then I tried LSP format and it worked.
- Since you installed LSP, it comes with LSP format automatically
- Format on save will work only this way Preferences / Settings - Syntax Specific
{
"lsp_format_on_save": true
}User settings
{
"ignored_packages":
[
"Vintage",
],
"theme": "Spacegray Eighties.sublime-theme",
"color_scheme": "Base16 Eighties Dark.sublime-color-scheme",
"folder_exclude_patterns": ["node_modules", "vendor"],
"font_face": "JetBrains Mono",
"font_size": 10.5,
"line_height": 1.7,
"line_padding_top": 2,
"line_padding_bottom": 2,
"index_files": true
}Installed packages list
- A File Icon
- Emmet
- JsPrettier
- LSP
- LSP - intelephense
- PHP companion
- SideBarEnhancement
- SublimeLinter
- SublimeLinter - php
- Theme - Spacegray