Skip to content

phpcbf, not working in Zed #440

Description

@kallookoo

Verified on latest main

  • I have confirmed this bug still occurs when built from the latest main branch.

PHPantom version / commit

phpantom_lsp 06a6417

Installation method

Built from source

Operating system

macOS aarch64 (Apple Silicon)

Editor

Zed

Bug description

Basically it doesn't work, phpcs reports errors, phpcbf generates temporary file, nothing else.

Steps to reproduce

  1. Open PHP project with Zed
  2. Configure the phpcs/phpcbf (standard) in .phpantom.toml (phpantom_lsp init)
  3. Restart the server in Zed
  4. Edit/Save the file

Error output or panic trace


.phpantom.toml

#:schema https://github.com/PHPantom-dev/phpantom_lsp/raw/main/config-schema.json

# PHPantom configuration: only add settings you want to override.
# Editors with TOML schema support (Zed, VS Code + Even Better TOML, Neovim)
# provide autocomplete and hover documentation for all available options.
# Full reference: https://phpantom-dev.github.io/phpantom_lsp/configuration/

[phpcs]
command = "/Users/sergio/.config/composer/vendor/bin/phpcs"
standard = "WordPress"

[formatting]
phpcbf = "/Users/sergio/.config/composer/vendor/bin/phpcbf"

Additional context

The phpcs is in global scope; composer global require --dev kallookoo/phpcs-rules
The phpcs-rules include the phpcs and WordPress rules.
The Zed settings.json settings:

  "languages": {
    "PHP": {
      "language_servers": [
        "phpantom",
        "!intelephense",
        "!phpactor",
        "!phptools",
        "...",
      ],
      "formatter": "language_server",
      "format_on_save": "on",
    },
  },
  "lsp": {
    "phpantom": {
      "binary": {
        "path": "/Users/sergio/.cargo/bin/phpantom_lsp",
        "ignore_system_version": false
      },
    },
  }

The phpantom is installed via; cargo install --git https://github.com/PHPantom-dev/phpantom_lsp --branch main phpantom_lsp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions