{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Emmyrc", "type": "object", "properties": { "$schema": { "type": [ "string", "null" ] }, "codeAction": { "$ref": "#/$defs/EmmyrcCodeAction", "default": { "insertSpace": null } }, "codeLens": { "$ref": "#/$defs/EmmyrcCodeLens", "default": { "enable": true } }, "completion": { "$ref": "#/$defs/EmmyrcCompletion", "default": { "autoRequire": true, "autoRequireFunction": "require", "autoRequireNamingConvention": "keep", "autoRequireSeparator": ".", "baseFunctionIncludesName": true, "callSnippet": false, "enable": true, "postfix": "@" } }, "diagnostics": { "$ref": "#/$defs/EmmyrcDiagnostic", "default": { "diagnosticInterval": 500, "disable": [], "enable": true, "enables": [], "globals": [], "globalsRegex": [], "severity": {} } }, "doc": { "$ref": "#/$defs/EmmyrcDoc", "default": { "knownTags": [], "privateName": [], "syntax": "md" } }, "documentColor": { "$ref": "#/$defs/EmmyrcDocumentColor", "default": { "enable": true } }, "format": { "$ref": "#/$defs/EmmyrcReformat", "default": { "externalTool": null, "externalToolRangeFormat": null, "useDiff": false } }, "hint": { "$ref": "#/$defs/EmmyrcInlayHint", "default": { "enable": true, "enumParamHint": false, "indexHint": true, "localHint": true, "metaCallHint": true, "overrideHint": true, "paramHint": true } }, "hover": { "$ref": "#/$defs/EmmyrcHover", "default": { "customDetail": null, "enable": true } }, "inlineValues": { "$ref": "#/$defs/EmmyrcInlineValues", "default": { "enable": true } }, "references": { "$ref": "#/$defs/EmmyrcReference", "default": { "enable": true, "fuzzySearch": true, "shortStringSearch": false } }, "resource": { "$ref": "#/$defs/EmmyrcResource", "default": { "paths": [] } }, "runtime": { "$ref": "#/$defs/EmmyrcRuntime", "default": { "extensions": [], "frameworkVersions": [], "nonstandardSymbol": [], "requireLikeFunction": [], "requirePattern": [], "special": {}, "version": "LuaLatest" } }, "semanticTokens": { "$ref": "#/$defs/EmmyrcSemanticToken", "default": { "enable": true, "renderDocumentationMarkup": true } }, "signature": { "$ref": "#/$defs/EmmyrcSignature", "default": { "detailSignatureHelper": true } }, "strict": { "$ref": "#/$defs/EmmyrcStrict", "default": { "arrayIndex": true, "docBaseConstMatchBaseType": true, "metaOverrideFileDefine": true, "requirePath": false, "typeCall": false } }, "workspace": { "$ref": "#/$defs/EmmyrcWorkspace", "default": { "enableReindex": false, "encoding": "utf-8", "ignoreDir": [], "ignoreGlobs": [], "library": [], "moduleMap": [], "packages": [], "preloadFileSize": 0, "reindexDuration": 5000, "workspaceRoots": [] } } }, "$defs": { "DiagnosticCode": { "oneOf": [ { "type": "string", "enum": [ "none" ] }, { "description": "Syntax error", "type": "string", "const": "syntax-error" }, { "description": "Doc syntax error", "type": "string", "const": "doc-syntax-error" }, { "description": "Type not found", "type": "string", "const": "type-not-found" }, { "description": "Missing return statement", "type": "string", "const": "missing-return" }, { "description": "Param Type not match", "type": "string", "const": "param-type-mismatch" }, { "description": "Missing parameter", "type": "string", "const": "missing-parameter" }, { "description": "Redundant parameter", "type": "string", "const": "redundant-parameter" }, { "description": "Unreachable code", "type": "string", "const": "unreachable-code" }, { "description": "Unused", "type": "string", "const": "unused" }, { "description": "Undefined global", "type": "string", "const": "undefined-global" }, { "description": "Deprecated", "type": "string", "const": "deprecated" }, { "description": "Access invisible", "type": "string", "const": "access-invisible" }, { "description": "Discard return value", "type": "string", "const": "discard-returns" }, { "description": "Undefined field", "type": "string", "const": "undefined-field" }, { "description": "Local const reassign", "type": "string", "const": "local-const-reassign" }, { "description": "Iter variable reassign", "type": "string", "const": "iter-variable-reassign" }, { "description": "Duplicate type", "type": "string", "const": "duplicate-type" }, { "description": "Redefined local", "type": "string", "const": "redefined-local" }, { "description": "Redefined label", "type": "string", "const": "redefined-label" }, { "description": "Code style check", "type": "string", "const": "code-style-check" }, { "description": "Need check nil", "type": "string", "const": "need-check-nil" }, { "description": "Await in sync", "type": "string", "const": "await-in-sync" }, { "description": "Doc tag usage error", "type": "string", "const": "annotation-usage-error" }, { "description": "Return type mismatch", "type": "string", "const": "return-type-mismatch" }, { "description": "Missing return value", "type": "string", "const": "missing-return-value" }, { "description": "Redundant return value", "type": "string", "const": "redundant-return-value" }, { "description": "Undefined Doc Param", "type": "string", "const": "undefined-doc-param" }, { "description": "Duplicate doc field", "type": "string", "const": "duplicate-doc-field" }, { "description": "Unknown doc annotation", "type": "string", "const": "unknown-doc-tag" }, { "description": "Missing fields", "type": "string", "const": "missing-fields" }, { "description": "Inject Field", "type": "string", "const": "inject-field" }, { "description": "Circle Doc Class", "type": "string", "const": "circle-doc-class" }, { "description": "Incomplete signature doc", "type": "string", "const": "incomplete-signature-doc" }, { "description": "Missing global doc", "type": "string", "const": "missing-global-doc" }, { "description": "Assign type mismatch", "type": "string", "const": "assign-type-mismatch" }, { "description": "Duplicate require", "type": "string", "const": "duplicate-require" }, { "description": "non-literal-expressions-in-assert", "type": "string", "const": "non-literal-expressions-in-assert" }, { "description": "Unbalanced assignments", "type": "string", "const": "unbalanced-assignments" }, { "description": "unnecessary-assert", "type": "string", "const": "unnecessary-assert" }, { "description": "unnecessary-if", "type": "string", "const": "unnecessary-if" }, { "description": "duplicate-set-field", "type": "string", "const": "duplicate-set-field" }, { "description": "duplicate-index", "type": "string", "const": "duplicate-index" }, { "description": "generic-constraint-mismatch", "type": "string", "const": "generic-constraint-mismatch" }, { "description": "cast-type-mismatch", "type": "string", "const": "cast-type-mismatch" }, { "description": "unresolved-require", "type": "string", "const": "unresolved-require" }, { "description": "require-module-not-visible", "type": "string", "const": "require-module-not-visible" }, { "description": "enum-value-mismatch", "type": "string", "const": "enum-value-mismatch" }, { "description": "preferred-local-alias", "type": "string", "const": "preferred-local-alias" }, { "description": "readonly", "type": "string", "const": "read-only" }, { "description": "Global variable defined in non-module scope", "type": "string", "const": "global-in-non-module" }, { "description": "attribute-param-type-mismatch", "type": "string", "const": "attribute-param-type-mismatch" }, { "description": "attribute-missing-parameter", "type": "string", "const": "attribute-missing-parameter" }, { "description": "attribute-redundant-parameter", "type": "string", "const": "attribute-redundant-parameter" }, { "description": "invert-if", "type": "string", "const": "invert-if" }, { "description": "Call to a non-callable value", "type": "string", "const": "call-non-callable" }, { "description": "inconsistent-type-access-modifier", "type": "string", "const": "inconsistent-type-access-modifier" }, { "description": "missing-type-argument", "type": "string", "const": "missing-type-argument" } ] }, "DiagnosticSeveritySetting": { "oneOf": [ { "description": "Represents an error diagnostic severity.", "type": "string", "const": "error" }, { "description": "Represents a warning diagnostic severity.", "type": "string", "const": "warning" }, { "description": "Represents an information diagnostic severity.", "type": "string", "const": "information" }, { "description": "Represents a hint diagnostic severity.", "type": "string", "const": "hint" } ] }, "DocSyntax": { "type": "string", "enum": [ "none", "md", "myst", "rst" ] }, "EmmyrcCodeAction": { "type": "object", "properties": { "insertSpace": { "description": "Add space after `---` comments when inserting `@diagnostic disable-next-line`.\n\nWhen omitted, this follows the formatter's resolved\n`emmy_doc.space_between_tag_columns` setting.", "type": [ "boolean", "null" ], "default": null, "x-vscode-setting": true } } }, "EmmyrcCodeLens": { "type": "object", "properties": { "enable": { "description": "Enable code lens.", "type": "boolean", "default": true, "x-vscode-setting": true } } }, "EmmyrcCompletion": { "description": "Configuration for EmmyLua code completion.", "type": "object", "properties": { "autoRequire": { "description": "Automatically insert call to `require` when autocompletion\ninserts objects from other modules.", "type": "boolean", "default": true, "x-vscode-setting": true }, "autoRequireFunction": { "description": "The function used for auto-requiring modules.", "type": "string", "default": "require" }, "autoRequireNamingConvention": { "description": "The naming convention for auto-required filenames.", "$ref": "#/$defs/EmmyrcFilenameConvention", "default": "keep" }, "autoRequireSeparator": { "description": "A separator used in auto-require paths.", "type": "string", "default": "." }, "baseFunctionIncludesName": { "description": "Whether to include the name in the base function completion. Effect: `function () end` -> `function name() end`.", "type": "boolean", "default": true, "x-vscode-setting": true }, "callSnippet": { "description": "Whether to use call snippets in completions.", "type": "boolean", "default": false }, "enable": { "description": "Enable autocompletion.", "type": "boolean", "default": true, "x-vscode-setting": true }, "postfix": { "description": "Symbol that's used to trigger postfix autocompletion.", "type": "string", "default": "@", "x-vscode-setting": { "default": null, "enum": [ null, "@", ".", ":" ], "enumItemLabels": [ "Default" ], "markdownEnumDescriptions": [ "%config.common.enum.default.description%" ], "type": [ "string", "null" ] } } } }, "EmmyrcDiagnostic": { "description": "Represents the diagnostic configuration for Emmyrc.", "type": "object", "properties": { "diagnosticInterval": { "description": "Delay between opening/changing a file and scanning it for errors, in milliseconds.", "type": [ "integer", "null" ], "format": "uint64", "minimum": 0, "x-vscode-setting": true }, "disable": { "description": "A list of diagnostic codes that are disabled.", "type": "array", "default": [], "items": { "$ref": "#/$defs/DiagnosticCode" } }, "enable": { "description": "A flag indicating whether diagnostics are enabled.", "type": "boolean", "default": true }, "enables": { "description": "A list of diagnostic codes that are enabled.", "type": "array", "default": [], "items": { "$ref": "#/$defs/DiagnosticCode" } }, "globals": { "description": "A list of global variables.", "type": "array", "default": [], "items": { "type": "string" } }, "globalsRegex": { "description": "A list of regular expressions for global variables.", "type": "array", "default": [], "items": { "type": "string" } }, "severity": { "description": "A map of diagnostic codes to their severity settings.", "type": "object", "additionalProperties": { "$ref": "#/$defs/DiagnosticSeveritySetting" }, "default": {} } } }, "EmmyrcDoc": { "type": "object", "properties": { "knownTags": { "description": "List of known documentation tags.", "type": "array", "default": [], "items": { "type": "string" } }, "privateName": { "description": "Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.", "type": "array", "default": [], "items": { "type": "string" } }, "rstDefaultRole": { "description": "When `syntax` is `Myst` or `Rst`, specifies default role used\nwith RST processor.", "type": [ "string", "null" ] }, "rstPrimaryDomain": { "description": "When `syntax` is `Myst` or `Rst`, specifies primary domain used\nwith RST processor.", "type": [ "string", "null" ] }, "syntax": { "description": "Syntax for highlighting documentation.", "$ref": "#/$defs/DocSyntax", "default": "md" } } }, "EmmyrcDocumentColor": { "type": "object", "properties": { "enable": { "description": "Enable parsing strings for color tags and showing a color picker next to them.", "type": "boolean", "default": true, "x-vscode-setting": true } } }, "EmmyrcExternalTool": { "type": "object", "properties": { "args": { "description": "The arguments to pass to the external tool.", "type": "array", "default": [], "items": { "type": "string" } }, "program": { "description": "The command to run the external tool.", "type": "string", "default": "" }, "timeout": { "description": "The timeout for the external tool in milliseconds.", "type": "integer", "format": "uint64", "default": 5000, "minimum": 0 } } }, "EmmyrcFilenameConvention": { "oneOf": [ { "description": "Keep the original filename.", "type": "string", "const": "keep" }, { "description": "Convert the filename to snake_case.", "type": "string", "const": "snake-case" }, { "description": "Convert the filename to PascalCase.", "type": "string", "const": "pascal-case" }, { "description": "Convert the filename to camelCase.", "type": "string", "const": "camel-case" }, { "description": "When returning class definition, use class name, otherwise keep original name.", "type": "string", "const": "keep-class" } ] }, "EmmyrcHover": { "type": "object", "properties": { "customDetail": { "description": "The detail number of hover information.\nDefault is `None`, which means using the default detail level.\nYou can set it to a number between `1` and `255` to customize", "type": [ "integer", "null" ], "format": "uint8", "default": null, "maximum": 255, "minimum": 0 }, "enable": { "description": "Enable showing documentation on hover.", "type": "boolean", "default": true, "x-vscode-setting": true } } }, "EmmyrcInlayHint": { "type": "object", "properties": { "enable": { "description": "Enable inlay hints.", "type": "boolean", "default": true, "x-vscode-setting": true }, "enumParamHint": { "description": "Show name of enumerator when passing a literal value to a function\nthat expects an enum.\n\nExample:\n\n```lua\n--- @enum Level\nlocal Foo = {\n Info = 1,\n Error = 2,\n}\n\n--- @param l Level\nfunction print_level(l) end\n\nprint_level(1 --[[ Hint: Level.Info ]])\n```", "type": "boolean", "default": false, "x-vscode-setting": true }, "indexHint": { "description": "Show named array indexes.\n\nExample:\n\n```lua\nlocal array = {\n [1] = 1, -- [name]\n}\n\nprint(array[1] --[[ Hint: name ]])\n```", "type": "boolean", "default": true, "x-vscode-setting": true }, "localHint": { "description": "Show types of local variables.", "type": "boolean", "default": true, "x-vscode-setting": true }, "metaCallHint": { "description": "Show hint when calling an object results in a call to\nits meta table's `__call` function.", "type": "boolean", "default": true, "x-vscode-setting": true }, "overrideHint": { "description": "Show methods that override functions from base class.", "type": "boolean", "default": true, "x-vscode-setting": true }, "paramHint": { "description": "Show parameter names in function calls and parameter types in function definitions.", "type": "boolean", "default": true, "x-vscode-setting": true } } }, "EmmyrcInlineValues": { "type": "object", "properties": { "enable": { "description": "Show inline values during debug.", "type": "boolean", "default": true, "x-vscode-setting": true } } }, "EmmyrcLuaVersion": { "oneOf": [ { "description": "Lua 5.1", "type": "string", "const": "Lua5.1" }, { "description": "LuaJIT", "type": "string", "const": "LuaJIT" }, { "description": "Lua 5.2", "type": "string", "const": "Lua5.2" }, { "description": "Lua 5.3", "type": "string", "const": "Lua5.3" }, { "description": "Lua 5.4", "type": "string", "const": "Lua5.4" }, { "description": "Lua 5.5", "type": "string", "const": "Lua5.5" }, { "description": "Lua Latest", "type": "string", "const": "LuaLatest" } ] }, "EmmyrcNonStdSymbol": { "type": "string", "enum": [ "//", "/**/", "`", "+=", "-=", "*=", "/=", "%=", "^=", "//=", "|=", "&=", "<<=", ">>=", "||", "&&", "!", "!=", "continue" ] }, "EmmyrcReference": { "type": "object", "properties": { "enable": { "description": "Enable searching for symbol usages.", "type": "boolean", "default": true, "x-vscode-setting": true }, "fuzzySearch": { "description": "Use fuzzy search when searching for symbol usages\nand normal search didn't find anything.", "type": "boolean", "default": true, "x-vscode-setting": true }, "shortStringSearch": { "description": "Also search for usages in strings.", "type": "boolean", "default": false, "x-vscode-setting": true } } }, "EmmyrcReformat": { "type": "object", "properties": { "externalTool": { "description": "Whether to enable external tool formatting.", "anyOf": [ { "$ref": "#/$defs/EmmyrcExternalTool" }, { "type": "null" } ], "default": null }, "externalToolRangeFormat": { "description": "Whether to enable external tool range formatting.", "anyOf": [ { "$ref": "#/$defs/EmmyrcExternalTool" }, { "type": "null" } ], "default": null }, "useDiff": { "description": "Whether to use the diff algorithm for formatting.", "type": "boolean", "default": false } } }, "EmmyrcResource": { "type": "object", "properties": { "paths": { "type": "array", "default": [], "items": { "type": "string" } } } }, "EmmyrcRuntime": { "type": "object", "properties": { "extensions": { "description": "file Extensions. eg: .lua, .lua.txt", "type": "array", "default": [], "items": { "type": "string" } }, "frameworkVersions": { "description": "Framework versions.", "type": "array", "default": [], "items": { "type": "string" } }, "nonstandardSymbol": { "description": "Non-standard symbols.", "type": "array", "default": [], "items": { "$ref": "#/$defs/EmmyrcNonStdSymbol" } }, "requireLikeFunction": { "description": "Functions that like require.", "type": "array", "default": [], "items": { "type": "string" } }, "requirePattern": { "description": "Require pattern. eg. \"?.lua\", \"?/init.lua\"", "type": "array", "default": [], "items": { "type": "string" } }, "special": { "description": "Special symbols.", "type": "object", "additionalProperties": { "$ref": "#/$defs/EmmyrcSpecialSymbol" }, "default": {} }, "version": { "description": "Lua version.", "$ref": "#/$defs/EmmyrcLuaVersion", "default": "LuaLatest" } } }, "EmmyrcSemanticToken": { "type": "object", "properties": { "enable": { "description": "Enable semantic tokens.", "type": "boolean", "default": true, "x-vscode-setting": true }, "renderDocumentationMarkup": { "description": "Render Markdown/RST in documentation. Set `doc.syntax` for this option to have effect.", "type": "boolean", "default": false, "x-vscode-setting": true } } }, "EmmyrcSignature": { "type": "object", "properties": { "detailSignatureHelper": { "description": "Whether to enable signature help.", "type": "boolean", "default": true } } }, "EmmyrcSpecialSymbol": { "type": "string", "enum": [ "none", "require", "error", "assert", "type", "setmetatable" ] }, "EmmyrcStrict": { "type": "object", "properties": { "arrayIndex": { "description": "Whether to enable strict mode array indexing.", "type": "boolean", "default": true }, "docBaseConstMatchBaseType": { "description": "Base constant types defined in doc can match base types, allowing int to match `---@alias id 1|2|3`, same for string.", "type": "boolean", "default": false }, "metaOverrideFileDefine": { "description": "meta define overrides file define", "type": "boolean", "default": true }, "requirePath": { "description": "Whether to enable strict mode require path.", "type": "boolean", "default": false }, "typeCall": { "type": "boolean", "default": false } } }, "EmmyrcWorkspace": { "type": "object", "properties": { "enableReindex": { "description": "Enable full project reindex after changing a file.", "type": "boolean", "default": false, "x-vscode-setting": true }, "encoding": { "description": "Encoding. eg: \"utf-8\"", "type": "string", "default": "utf-8" }, "ignoreDir": { "description": "Ignore directories.", "type": "array", "default": [], "items": { "type": "string" } }, "ignoreGlobs": { "description": "Ignore globs. eg: [\"**/*.lua\"]", "type": "array", "default": [], "items": { "type": "string" } }, "library": { "description": "Library paths. Can be a string path or an object with path and ignore rules.\neg: [\"/usr/local/share/lua/5.1\"] or [{\"path\": \"/usr/local/share/lua/5.1\", \"ignoreDir\": [\"test\"], \"ignoreGlobs\": [\"**/*.spec.lua\"]}]", "type": "array", "default": [], "items": { "$ref": "#/$defs/EmmyrcWorkspacePathItem" } }, "moduleMap": { "description": "Module map. key is regex, value is new module regex\neg: {\n \"^(.*)$\": \"module_$1\"\n \"^lib(.*)$\": \"script$1\"\n}", "type": "array", "default": [], "items": { "$ref": "#/$defs/EmmyrcWorkspaceModuleMap" } }, "packages": { "description": "Package directories. Can be a string path or an object with path and ignore rules.\nTreat the parent directory as a `library`, but only add files from the specified directory.\neg: [\"/usr/local/share/lua/5.1/module\"] or [{\"path\": \"/usr/local/share/lua/5.1/module\", \"ignoreDir\": [\"test\"], \"ignoreGlobs\": [\"**/*.spec.lua\"]}]", "type": "array", "default": [], "items": { "$ref": "#/$defs/EmmyrcWorkspacePathItem" } }, "preloadFileSize": { "type": "integer", "format": "int32", "default": 0 }, "reindexDuration": { "description": "Delay between changing a file and full project reindex, in milliseconds.", "type": "integer", "format": "uint64", "default": 5000, "minimum": 0, "x-vscode-setting": true }, "workspaceRoots": { "description": "Workspace roots. eg: [\"src\", \"test\"]", "type": "array", "default": [], "items": { "type": "string" } } } }, "EmmyrcWorkspaceModuleMap": { "type": "object", "properties": { "pattern": { "type": "string" }, "replace": { "type": "string" } }, "required": [ "pattern", "replace" ] }, "EmmyrcWorkspacePathConfig": { "type": "object", "properties": { "ignoreDir": { "description": "Ignore directories within this entry", "type": "array", "default": [], "items": { "type": "string" } }, "ignoreGlobs": { "description": "Ignore globs within this entry. eg: [\"**/*.lua\"]", "type": "array", "default": [], "items": { "type": "string" } }, "path": { "description": "Workspace entry path", "type": "string" } }, "required": [ "path" ] }, "EmmyrcWorkspacePathItem": { "anyOf": [ { "description": "Simple workspace entry path string", "type": "string" }, { "description": "Workspace entry configuration with path and ignore rules", "$ref": "#/$defs/EmmyrcWorkspacePathConfig" } ] } } }