vscode-lua icon indicating copy to clipboard operation
vscode-lua copied to clipboard

Snippets format?

Open Leadwerks opened this issue 4 years ago • 1 comments

I have a Lua snippet defined like this:

    "Entity:SetPosition": {
        "prefix": "Entity:SetPosition",
        "description": "Sets the position of an entity in 3-dimensional space, using local or global coordinates.",
        "body": [
            "SetPosition($x, $y, $z, $global)"
        ]
    },

If I start typing like this:

p:SetPo

It will show the function. When I select it, the colon is removed and I end up with this:

pSetPosition(x, y, z, global)

Instead of this:

p:SetPosition(x, y, z, global)

What is the correct way to define this? It works perfectly if the function uses a period instead of a semicolon.

Leadwerks avatar Jul 07 '20 11:07 Leadwerks

This seems to work:

    "DOES NOT MATTER": {
        "prefix": "Entity:SetPosition",
        "description": "Sets the position of an entity in 3-dimensional space, using local or global coordinates.",
        "body": [
            ":SetPosition($x, $y, $z)"
        ]
    }, 

Is there any information available on the details of the snippet format?

Leadwerks avatar Jul 07 '20 11:07 Leadwerks