vscode-php-intellisense/README.md

2.9 KiB

PHP IntelliSense

⚠ Work In Progress

Latest Release Installs Rating Build Status Dependency Status Gitter

Advanced PHP IntelliSense for Visual Studio Code. In opposite to the included PHP IntelliSense and other PHP extensions, this uses an AST to parse the source code instead of relying on naive regular expression parsing.

Features

Find all symbols

Find all symbols demo

Column-accurate error reporting

Error reporting demo

Todo

  • Autocompletion
  • Rename
  • Goto definition
  • Format document
  • Hover
  • Signature help
  • Follow composer autoloading

Contributing

This is just the VS Code extension that spawns the actual language server. The language server itself is implemented purely in PHP in its own repository, all features need to be implemented there and all issues should be reported there.

Build and Run From Source

Clone whole repository and in root directory execute:

composer install 
npm install
npm run compile
code .

The last command will open the folder in VS Code. Hit F5 to launch an Extension Development Host with the extension. For working on the language server, the easiest way is to replace the language server installation from composer in vendor/felixfbecker/language-server with a symlink to your local clone.

Debug

XDebug needs to be configured for remote debugging. Check if ini file contains necessary parameters:

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost

Configure VS Code

TODO

Configure PDT

Download Eclipse package with PHP support (PHP EPP)

  • Start PDT
  • Import extension project with File -> Open Project from File System
  • Set breakpoint in PHP language server source code