From 79f96a5afef3cc26f130b28ef34ff93d835aac31 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Wed, 4 Jun 2025 11:51:53 -0400 Subject: [PATCH] docs: Improve LuaLS formatter example (#32084) - Closes https://github.com/zed-extensions/lua/issues/4 Release Notes: - N/A --- docs/src/languages/lua.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/src/languages/lua.md b/docs/src/languages/lua.md index 4ad143ce41..db060033a6 100644 --- a/docs/src/languages/lua.md +++ b/docs/src/languages/lua.md @@ -107,9 +107,18 @@ To enable [Inlay Hints](../configuring-languages#inlay-hints) for LuaLS in Zed ## Formatting -### LuaLS +### LuaLS Formatting -To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)) make sure you have `"format.enable": true,` in your .luarc.json add the following to your Zed `settings.json`: +To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)) make sure you have `"format.enable": true,` in your .luarc.json: + +```json +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "format.enable": true +} +``` + +Then add the following to your Zed `settings.json`: ```json { @@ -124,7 +133,7 @@ To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle] You can customize various EmmyLuaCodeStyle style options via `.editorconfig`, see [lua.template.editorconfig](https://github.com/CppCXY/EmmyLuaCodeStyle/blob/master/lua.template.editorconfig) for all available options. -### StyLua +### StyLua Formatting Alternatively to use [StyLua](https://github.com/JohnnyMorganz/StyLua) for auto-formatting: