Description
Generating PHPDoc annotations for PHP functions fails with E5108: snippet parsing failed when using the nvim snippet engine.
Steps to Reproduce
- Configure neogen with
snippet_engine = "nvim"
- Create a PHP function:
function test($data, $message) {
return $data;
}
- Run
:Neogen on the function
- 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
Description
Generating PHPDoc annotations for PHP functions fails with
E5108: snippet parsing failedwhen using thenvimsnippet engine.Steps to Reproduce
snippet_engine = "nvim":Neogenon the functionE5108: Error executing lua: .../vim/lsp/_snippet_grammar.lua:178: snippet parsing failedExpected 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:\$for literal dollar signs (not$$)nvimandminiengines use LSP spec$$escapingThe current implementation escapes ALL
$to$$, which is incompatible with LSP-compliant engines.Environment
nvimReferences