Files
Daniel AdámekandDanielADK f3afe69ca2 feat(php): PHP language level for Intelephense (#1264)
Intelephense checked PHP code against its default 8.5, whatever version the project targets. Settings › Languages & Frameworks › PHP gets a PHP language level, Auto (default: composer.json config.platform.php, else the lowest version require.php allows) or 5.6–8.5, sent as environment.phpVersion; nothing is sent without a requirement. Intelephense applies the version only to documents it parses after reading its configuration, so servers that opt in (resync-on-configuration, Intelephense only) get their open documents again right after workspace/configuration is answered (new jsonrpc Handler::after_response), and Intelephense keeps one index per level because it fixes the built-in functions when it indexes. A change to a root or workspace member composer.json reconfigures the servers.

Co-authored-by: DanielADK <18214958+DanielADK@users.noreply.github.com>
2026-11-05 00:04:01 +08:00

33 lines
1.0 KiB
TOML

id = "php"
name = "PHP"
extensions = ["php", "phtml", "php3", "php4", "php5", "phps", "phpt"]
first-line = "^(<\\?php|#!.*\\bphp\\b)"
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "PHP"
tree-sitter = "php"
[[language-servers]]
name = "intelephense"
command = "intelephense"
args = ["--stdio"]
root-markers = ["composer.json", ".phpactor.json", "index.php"]
install-hint = "npm i -g intelephense"
# Intelephense applies the PHP version only to documents it parses after reading it.
resync-on-configuration = true
[[language-servers]]
name = "phpactor"
# Alternative: used only when the server above is not installed.
fallback = true
command = "phpactor"
args = ["language-server"]
root-markers = ["composer.json", ".phpactor.json"]
install-hint = "Install phpactor (https://phpactor.readthedocs.io/en/master/usage/standalone.html)"
[debugger]
adapter = "php-debug"
command = "php-debug-adapter"
install-hint = "Install vscode-php-debug (Xdebug) as `php-debug-adapter` (e.g. via mason.nvim) and enable Xdebug"