-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Current Behavior
In intelephense.py, vendor directories are hardcoded to be ignored:
def is_ignored_dirname(self, dirname: str) -> bool:
# For PHP projects, we should ignore:
# - vendor: third-party dependencies managed by Composer
# - node_modules: if the project has JavaScript components
# - cache: commonly used for caching
return super().is_ignored_dirname(dirname) or dirname in ["node_modules", "vendor", "cache"]The Problem
This creates a contradiction with Serena's core value proposition:
Serena's instructions say: "Don't read entire files - use symbolic tools like find_symbol to explore code efficiently"
But in practice: When working with third-party libraries, I'm forced to read entire vendor files because find_symbol doesn't work on them.
Concrete example:
- I'm using
brick/date-timeand need to understand howZonedDateTime::parse()works find_symbolwithdepth: 1returns empty for vendor classes- I have to fall back to reading the entire
ZonedDateTime.phpfile (700+ lines) - This defeats Serena's purpose of efficient code exploration
Why This Matters for PHP Projects
-
Third-party library exploration is crucial - Understanding external APIs is often MORE important than understanding your own code (which you wrote)
-
Current workarounds don't work:
- Setting
ignore_all_files_in_gitignore: falsein.serena/project.ymlhas no effect - The hardcoded exclusion overrides configuration
- Setting
-
The LLM gets stuck: Claude Code receives instructions to "use symbolic tools, don't read files" but then can't use those tools on vendor code, creating confusion
Proposed Solution
Make this configurable via ls_specific_settings in .serena/project.yml:
ls_specific_settings:
php:
indexVendorDirectory: true # default: falseOr alternatively as a project-level setting:
index_vendor_directories: true # default: falsePerformance Tradeoff
Yes, indexing would be slower with vendor included. However:
- PHP developers are accustomed to slow indexing (PHPStorm: ~10 minutes)
- This should be opt-in for teams that need it
- The performance cost is worth it for proper third-party API exploration
- Indexing happens once; exploration happens continuously
Testing Notes
I've locally patched line 39 to remove "vendor" from the exclusion list and can confirm:
- Vendor indexing works correctly
find_symbolsuccessfully returns methods from vendor classes- No issues with Intelephense handling vendor files
Would be happy to test any proposed implementation!