Skip to content

Add support for custom PHP stubs in the LSP #285

Description

@0smr

Description

Hi, I'm working on a WordPress theme, but I couldn't find a way to add WordPress/WooCommerce stubs so the LSP can detect WordPress/WooCommerce functions.

This feature seems to be missing from phpantom, and it would be very useful to add.

  • Zed editor
  • phpantom_lsp v0.8.0

Use case

I'm currently using Sage, a starter theme with a Laravel-based stack.

Previously, I used phptools and intelephense.
phptools had predefined WordPress stubs that could be enabled in Zed with:

{"settings.lsp.phptools.initialization_options.php.stubs": ["*", "wordpress"]}

intelephense also supported including PHP files, which let me add the WordPress stubs directly.

Proposed solution

No response

Alternatives considered

No response

Code example

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions