2023-04-10
Say what you will about code style and all but I wanted K&R.
In VSCode this is trivial, edit the config, add a line and done. In BBEdit, not so quick!
Once you have intelliphense set up properly in BBEdit - see this page and search for “php”: https://www.barebones.com/support/bbedit/lsp-notes.html
Got to ~/Library/Application Support/BBEdit/
You should see a folder Language Server
, in there you’ll find probably something for intelliphense such as storage.
See if there is a Configuration
folder or create it. In there, create a php.json or whatever you’d like to call it, to hold your intelliphense config.
So the file is ~/Library/Application Support/BBEdit/Language Servers/Configuration/php.json
Here is my final json
{
"initializationOptions":
{
},
"workspaceConfigurations":
{
"*":
{
"intelephense":
{
"format": {"braces": "k&r"}
}
}
}
}
Change the k&r
to your preferred format. I’ve used this emacs reference to find the settings name:
https://emacs-lsp.github.io/lsp-mode/page/lsp-intelephense/#lsp-intelephense-format-braces
Save it, restart BBEdit.
Languages
and at the bottom in Language-specific settings:
+
, select PHP in HTML
Server
tabConfiguration
: pick your json name, e.g. php
Restart BBEdit and the next time you format code, your braces should be as you intended!
HTH.