Skip to content

PHP Tools for Neovim#

PHP Tools for Neovim is provided as a language server (LSP).

Requirements#

Install with Mason#

mason.nvim installs the devsense-php-ls package from the Mason registry. The package provides the devsense-php-ls executable.

  1. Install the server:
    :MasonInstall devsense-php-ls
    
  2. Enable "phptools" config in your init.lua:
    vim.lsp.enable('phptools')
    

Optional: mason-lspconfig maps the nvim-lspconfig name phptools to the devsense-php-ls package. Add it to ensure_installed to install the server. Installed servers are enabled automatically:

require('mason-lspconfig').setup({
    ensure_installed = { 'phptools' },
})

The license key in Registration still applies.

Installation#

Install the server manually:

  1. Use Neovim Language Server Quickstart Config:

    nvim-lspconfig

  2. Make sure the Language Server is installed.

    npm i devsense-php-ls -g
    
  3. Enable "phptools" config in your init.lua:
    vim.lsp.enable('phptools')
    

Configuration#

Open ./lsp/phptools.lua and update init_options section. Valid configuration keys are: - ['0'] = '<YOUR_LICENSE_KEY>' or license key offline signature - any setting listed at the configuration

Registration#

Get any license key (both Visual Studio and Visual Studio Code are accepted) on our purchase page.

Insert <YOUR_LICENSE_KEY> in the "init_options" above to enable additional premium features including code actions and starred suggestions.

The same license key applies when the server is installed with Mason.