Skip to content

Any way to add custom operators? #607

@psychicteeth

Description

@psychicteeth

你好,
Is there any way to add custom operators to my local project that can be picked up by EmmyLua? I am working on the Playdate console and they've added +=, -=, etc which are picked up quite reasonably as errors by EmmyLua.

Working in VS Code with Sumneko lua you can add a file .luarc.json which adds these symbols e.g.

{
    "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
    "diagnostics.globals": ["import"],
    "diagnostics.severity": {
        "duplicate-set-field": "Hint"
    },
    "format.defaultConfig": {
        "indent_style": "space",
        "indent_size": "4"
    },
    "runtime.builtin": {
        "io": "disable",
        "os": "disable",
        "package": "disable"
    },
    "runtime.nonstandardSymbol": ["+=", "-=", "*=", "/=", "//=", "%=", "<<=", ">>=", "&=", "|=", "^="],
    "runtime.version": "Lua 5.4",
    "workspace.library": [
        "../../GitHub/playdate-luacats"
    ]
}

Is this possible in EmmyLua?

谢谢
Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions