zed icon indicating copy to clipboard operation
zed copied to clipboard

Custom plugin throws "Have not found plugin path for prettier-plugin-twig-melody"

Open gopeter opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

I'm currently writing an extension to support Twig files. Code highlighting works and now I'm trying to add Twig formatting with Prettier. So I've added this to my extension config:

prettier_parser_name = "melody"
prettier_plugins = ["prettier-plugin-twig-melody"]

The plugin is installed locally in my project but I still get this error in my Zed log:

2024-04-12T15:17:00+02:00 [ERROR] Have not found plugin path for "prettier-plugin-twig-melody" inside "/Users/peter_oesteritz/Sites/Workspace/DEBD/DEBD/docket-web/node_modules"
2024-04-12T15:17:00+02:00 [ERROR] crates/editor/src/editor.rs:8306: prettier at "/Users/peter_oesteritz/Sites/Workspace/DEBD/DEBD/docket-web" failed to format buffer

Caused by:
    0: prettier format request
    1: error during message '{"jsonrpc":"2.0","id":4,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[],"parser":"melody","filepath":"/Users/peter_oesteritz/Sites/Workspace/DEBD/DEBD/docket-web/foo.twig","prettierOptions":null}}}' handling: ConfigError: Couldn't resolve parser "melody".

image

Environment

Zed: v0.130.6 (Zed) OS: macOS 14.3.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

gopeter avatar Apr 12 '24 13:04 gopeter

cc @maxdeviant

JosephTLyons avatar Apr 15 '24 17:04 JosephTLyons

this is also still happening for me with the xml, and sql extensions

sweetppro avatar Jun 30 '24 03:06 sweetppro