[BUG] php-lsp plugin (intelephense) ignores intelephense.config.json / project-level settings for environment.includePaths

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Aug 3, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

The bundled php-lsp plugin's intelephense LSP client appears to declare the standard LSP workspace.configuration capability. This causes intelephense to source all of its configuration from the client via workspace/configuration requests, and to never fall back to reading intelephense.config.json from the workspace root - even though that file is a legitimate, documented intelephense config mechanism.

The practical effect: there is currently no supported way to set intelephense.environment.includePaths (or any other intelephense setting) for a project opened in Claude Code. This makes intelephense unusable for any PHP codebase that isn't a single self-contained root - e.g. legacy multi-app deployments where sibling directories define shared functions/classes outside the current working directory. Every function/class defined outside the CWD is permanently flagged "Undefined function/class," with no way to fix it short of restructuring the project.

Root cause (traced in intelephense's own source)

In the installed intelephense npm package (lib/intelephense.js), the initialize/config-load logic is:

if (ie("workspace.configuration", false)) {
  // pull config from the client via workspace/configuration request
} else {
  // fall back to reading <workspaceFolder>/intelephense.config.json from disk
}

This same branch runs both on server init and on every onDidChangeConfiguration. If the client capability is present (which is standard for most modern LSP clients), the file-based config path is dead code from the server's perspective - it's never reached.

What Should Happen?

The intelephense LSP preferences should be able to be configured either from claude settings files or from the intelephense fallback config file; as things stand right now, no configuration appears be possible.

Error Messages/Logs

Steps to Reproduce

  1. Open a PHP project in Claude Code where some functions/classes used by the project are defined in a directory outside the project root (e.g. a sibling directory on disk).
  2. Add intelephense.config.json to the project root:

``json
{
"intelephense": {
"environment": {
"includePaths": ["../sibling-dir"]
}
}
}
``

  1. Restart Claude Code fully (to guarantee a fresh intelephense process - killing the process alone doesn't clear stale plugin-layer connection state).
  2. Use the LSP tool (hover, workspaceSymbol, goToDefinition) or observe inline diagnostics on a call to a function defined in the sibling directory.

Expected: the function resolves; no "Undefined function" diagnostic.
Actual: diagnostic persists (Undefined function 'X'. [P1010] (intelephense)), and workspaceSymbol returns no results for symbols defined outside the CWD - even though the config file is correctly placed, formatted, and predates the fresh server process.

I also tried, with the same negative result, two other places one might expect to configure this:

  • A "plugins": { "php-lsp@...": { "settings": { "intelephense": {...} } } } block in .claude/settings.json - no documented or functional effect.
  • .vscode/settings.json with intelephense.environment.includePaths - Claude Code doesn't read this file at all.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.220 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Suggested fix

Either:

  • Have the php-lsp plugin's LSP client actually respond meaningfully to intelephense's workspace/configuration requests, sourcing values from a supported project-level settings surface (e.g. .claude/settings.json under a documented key), or
  • Have the client simply not declare workspace.configuration, so intelephense falls back to its own native intelephense.config.json file-based config (which already works correctly once reached).

Either way, there should be some supported way to set intelephense.environment.includePaths per project.

Environment

  • Claude Code CLI, plugin: php-lsp (official)
  • intelephense version: 1.18.5
  • macOS (Darwin), Node via nvm

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗