Skip to content

try catch snippet error #555

Open
Open
@roshanlimbu

Description

@roshanlimbu

When using try catch, I get this error

Failed to parse snippet.
/usr/share/nvim/runtime/lua/vim/lsp/_snippet_grammar.lua:177: snippet parsing failed
php
try {
${1://code...}
} catch (${2:\Throwable} ${3:$th}) {
${4://throw $th;}
}

In the php.json this seems to be the problem

"Try Catch Block": {
"prefix": "try",
"body": [
"try {",
"\t${1://code...}",
"} catch (${2:\Throwable} ${3:\$th}) {",
"\t${4://throw \$th;}",
"}"
],
"description": "Try catch block"
}

I think this might work \

"Try Catch Block": {
"prefix": "try",
"body": [
"try {",
"\t${1:// code...}",
"} catch (${2:Throwable} ${3:$th}) {",
"\t${4:// throw $th;}",
"}"
],
"description": "Try catch block"
}

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