Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

@yaegassy/coc-intelephense

yaegassy

intelephense (php language server) extension for coc.nvim

Installation CommandVim prompt
:CocInstall @yaegassy/coc-intelephense
GitHub owner
yaegassy
Version
v0.35.4
Requirements
coc ^0.0.80
License
MIT
Repository
GitHub
npm latest published 2026-06-21Registry checked 2026-08-23Registry summary

Published Package Summary

coc-intelephense

fork from a bmewburn/vscode-intelephense | PHP Intelephense and more feature.

intelephense (PHP language server) extension for coc.nvim. intelephense's various LSP features and this extension's additional features are available.

Install

CocInstall:

:CocInstall @yaegassy/coc-intelephense

scoped packages

vim-plug:

Plug 'yaegassy/coc-intelephense', {'do': 'yarn install --frozen-lockfile'}

Enabling the PREMIUM feature

Prepare a licence.txt file containing the licence key and place it in a designated location.

$ node -e "console.log(os.homedir() + '/intelephense/licence.txt')"
/Users/username/intelephense/licence.txt

[DEPRECATED]: Or set intelephense.licenceKey in "coc-settings.json"

{
  // ...snip
  "intelephense.licenceKey": "LICENCEKEYSAMPLE",
  // ...snip
}

For more information, please check this link.

[RECOMMENDED] Additional installation of "watchman"

In the intelephense used by coc-intelephense, it utilizes the workspace/didChangeWatchedFiles notification to watch files within the project.

In coc.nvim, it is recommended to install watchman in order to utilize this feature.

If you have difficulty installing watchman, you can use coc-intelephense without watchman, but you may not be able to immediately use intelephense's IntelliSense with the newly added files.

In this case, please execute the command to restart the language server.

  • :CocRestart

workspaceFolders

Depending on the project like mono repo or how Vim/Neovim is started, workspaceFolders may not be recognized correctly.

To make coc.nvim recognize workspaceFolders correctly, you can set b:coc_root_patterns in .vimrc/init.vim

Example:

  au FileType php let b:coc_root_patterns = ['.git', '.env', 'composer.json', 'artisan']

For more information, check this coc.nvim's wiki.

CodeLens

Feature:

Test file for "PHPUnit" or "Pest", allowing execution of a single test method. CodeLens appears at the top of the test method.

coc-settings.json:

By default, codeLens.enable is set to false, which disables it.

Change the setting to true to enable it.

{
  "codeLens.enable": true
}

If you want to use "Pest", change the intelephense.client.codelensProvider setting to pest (default: phpunit).

{
  "intelephense.client.codelensProvider": "pest"
}

Example key mapping (CodeLens related):

nmap <silent> gl <Plug>(coc-codelens-action)

Code Actions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)
xmap <silent> ga <Plug>(coc-codeaction-selected)
nmap <silent> <leader>a <Plug>(coc-codeaction-cursor)
nmap <silent> gA <Plug>(coc-codeaction)

Code Actions (Client side):

  • Open 'php.net' for 'xxxx' | DEMO
  • Add @intelephense-ignore-line | DEMO
  • Add @intelephense-ignore-next-line | DEMO
  • Insert PHP Getter | DEMO
  • Insert PHP Setter | DEMO
  • Insert PHP Getter & Setter | DEMO
  • Change Visibility | DEMO
  • Remove all unused imports for "use" statetment | DEMO

Code Actions (Server side):

  • use NAMESPACE\...\CLASS
  • Implement all abstract methods for '...'
  • Add PHPDoc for '...'
  • and more...
    • Other code actions provided by the intelephehse language server

Thanks

License

MIT


This extension is built with create-coc-extension

Read the complete README
  • intelephense (php language server) extension for coc.nvim
Activation Events
  • onLanguage:php
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.