From 4be0e1388356a5724c697387b735bed1b8657b21 Mon Sep 17 00:00:00 2001 From: nerix Date: Wed, 8 Oct 2025 15:56:01 +0200 Subject: [PATCH] refactor: move LuaLS meta to a subdirectory (#6530) --- CHANGELOG.md | 1 + docs/{plugin-meta.lua => lua-meta/globals.lua} | 2 +- docs/wip-plugins.md | 4 ++-- scripts/make_luals_meta.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) rename docs/{plugin-meta.lua => lua-meta/globals.lua} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8ae797e..2b2b3e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Dev: Refactored `Emotes` into `EmoteController`. (#6516) - Dev: Added Qt keyword and warning flags project wide. (#6520) - Def: Fixed compilation error in tests with Clang 21. (#6519) +- Dev: The LuaLS meta files moved from `docs/plugin-meta.lua` to `docs/lua-meta/globals.lua`. (#6530) ## 2.5.4 diff --git a/docs/plugin-meta.lua b/docs/lua-meta/globals.lua similarity index 99% rename from docs/plugin-meta.lua rename to docs/lua-meta/globals.lua index 9d682ef8..388147d2 100644 --- a/docs/plugin-meta.lua +++ b/docs/lua-meta/globals.lua @@ -1,4 +1,4 @@ ----@meta Chatterino2 +---@meta _ -- This file is automatically generated from src/controllers/plugins/LuaAPI.hpp by the scripts/make_luals_meta.py script -- This file is intended to be used with LuaLS (https://luals.github.io/). diff --git a/docs/wip-plugins.md b/docs/wip-plugins.md index efee92ed..134e4478 100644 --- a/docs/wip-plugins.md +++ b/docs/wip-plugins.md @@ -113,7 +113,7 @@ runtime. ## LuaLS type definitions Type definitions for LuaLS are available in -[the `/plugin-meta.lua` file](./plugin-meta.lua). These are generated from [the C++ +[the `/lua-meta` directory](./lua-meta). These are generated from [the C++ headers](../src/controllers/plugins/LuaAPI.hpp) of Chatterino using [a script](../scripts/make_luals_meta.py). @@ -607,7 +607,7 @@ c2.register_command("/testing", function(ctx) end) ``` -The full range of options can be found in the typing files ([LuaLS](./plugin-meta.lua), [TypeScript](./chatterino.d.ts)). +The full range of options can be found in the typing files ([LuaLS](./lua-meta/globals.lua), [TypeScript](./chatterino.d.ts)). #### `LinkType` enum diff --git a/scripts/make_luals_meta.py b/scripts/make_luals_meta.py index c1d663b5..0f21ff0d 100755 --- a/scripts/make_luals_meta.py +++ b/scripts/make_luals_meta.py @@ -43,7 +43,7 @@ import re from typing import Optional BOILERPLATE = """ ----@meta Chatterino2 +---@meta _ -- This file is automatically generated from src/controllers/plugins/LuaAPI.hpp by the scripts/make_luals_meta.py script -- This file is intended to be used with LuaLS (https://luals.github.io/). @@ -54,7 +54,7 @@ c2 = {} repo_root = Path(__file__).parent.parent lua_api_file = repo_root / "src" / "controllers" / "plugins" / "LuaAPI.hpp" -lua_meta = repo_root / "docs" / "plugin-meta.lua" +lua_meta = repo_root / "docs" / "lua-meta" / "globals.lua" print("Writing to", lua_meta.relative_to(repo_root))