Skip to content

[Bug] Generating PHPDoc annotations for PHP functions fails with E5108: snippet parsing failed #229

@Alexandros-Pallis

Description

@Alexandros-Pallis

Description

Generating PHPDoc annotations for PHP functions fails with E5108: snippet parsing failed when using the nvim snippet engine.

Steps to Reproduce

  1. Configure neogen with snippet_engine = "nvim"
  2. Create a PHP function:
function test($data, $message) {
    return $data;
}
  1. Run :Neogen on the function
  2. Error: E5108: Error executing lua: .../vim/lsp/_snippet_grammar.lua:178: snippet parsing failed

Expected Behavior

PHPDoc comment should be generated successfully.

Actual Behavior

Snippet parsing fails because neogen generates invalid LSP snippet syntax:

Root Cause

Commit aeea21f added $$ escaping for PHP variables, but:

  • LSP snippet spec requires \$ for literal dollar signs (not $$)
  • The nvim and mini engines use LSP spec
  • LuaSnip and others use $$ escaping

The current implementation escapes ALL $ to $$, which is incompatible with LSP-compliant engines.

Environment

  • Neogen: d7f9461 (latest)
  • Neovim: v0.11.5
  • Snippet engine: nvim
  • Language: PHP

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions