From 794da1b443f0b963c81a10e31a9283186382a3cc Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Mon, 4 Nov 2024 15:35:29 -0600 Subject: [PATCH] chore(lua): add vscode and luacheck setup --- .luacheckrc | 9 +++++++++ .vscode/extensions.json | 7 +++++++ .vscode/settings.json | 27 +++++++++++++++++++++------ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .luacheckrc create mode 100644 .vscode/extensions.json diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..d3579b9 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,9 @@ +allow_defined = true +exclude_files = { + "src/crypto", +} +globals = { + "Handlers", + "ao", +} +max_line_length = 185 diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..af4f998 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "JohnnyMorganz.stylua", + "sumneko.lua", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 8d4db3f..c0fc34b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,15 +1,18 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true, - "editor.formatOnPaste": true, - "editor.formatOnSaveMode": "file", + "[mjs, js]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.formatOnSaveMode": "file" + }, "prettier.configPath": ".prettierrc", "prettier.prettierPath": "./node_modules/prettier/index.cjs", "[typescript]": { "editor.formatOnSave": true }, "[markdown]": { - "editor.formatOnSave": true + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file" }, "search.exclude": { "**/node_modules": true, @@ -17,9 +20,21 @@ "**/dist": true, "**/coverage": true }, + "Lua.codeLens.enable": true, + "Lua.workspace.library": ["${workspaceFolderBasename}/**"], + "Lua.completion.callSnippet": "Both", + "Lua.signatureHelp.enable": true, "Lua.workspace.checkThirdParty": true, + "Lua.diagnostics.enable": true, + "Lua.diagnostics.disable": ["lowercase-global", "undefined-global"], + "Lua.format.defaultConfig": { + "indent_style": "space", + "indent_size": "2" + }, "[lua]": { "editor.defaultFormatter": "JohnnyMorganz.stylua", - "editor.formatOnSave": true + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.formatOnSaveMode": "file" } }