fix(lua): not obvious which _meta/ files are generated #39035

Problem:
- Not obvious which _meta/ are generated and which should be edited
  manually.
- The require guard (`error('Cannot require a meta file')`) is not
  consistently present in all meta files.

Solution:
- Update headers.
- Add require() guard to all meta files.
- Rename generated meta files with `.gen.lua`.
This commit is contained in:
Justin M. Keyes
2026-04-14 05:38:47 -04:00
committed by GitHub
parent 829e9ec65e
commit 65b40e69ac
20 changed files with 54 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
--
-- DO NOT EDIT. GENERATED BY: src/gen/gen_eval_files.lua
--
error('Cannot require a meta file')
--- This file embeds vimdoc as the function descriptions

View File

@@ -1,6 +1,7 @@
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
--
-- DO NOT EDIT. GENERATED BY: src/gen/gen_eval_files.lua
--
error('Cannot require a meta file')
--- @class vim.api.keyset.buf_attach

View File

@@ -1,4 +1,5 @@
--- @meta _
-- This file is NOT generated, edit it directly. See also _meta/api_keysets.gen.lua.
error('Cannot require a meta file')
--- Extra types we can't generate keysets for

View File

@@ -1,4 +1,6 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
vim.base64 = {}

View File

@@ -1,4 +1,5 @@
---@meta
-- This file is NOT generated, edit it directly.
-- luacheck: no unused args
error('Cannot require a meta file')

View File

@@ -1,3 +1,7 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
--- @class vim.fn.sign
--- @field group string
--- @field id integer

View File

@@ -1,4 +1,6 @@
---@meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
---@nodoc
vim.json = {}

View File

@@ -1,4 +1,5 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- These types were taken from https://github.com/LuaCATS/lpeg

View File

@@ -1,4 +1,6 @@
---@meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- luacheck: no unused args

View File

@@ -1,4 +1,6 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- luacheck: no unused args

View File

@@ -1,6 +1,7 @@
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
--
-- DO NOT EDIT. GENERATED BY: src/gen/gen_eval_files.lua
--
error('Cannot require a meta file')
---@class vim.bo

View File

@@ -1,4 +1,5 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- Documentations and Lua types for vim.re (vendored re.lua, lpeg-1.1.0)

View File

@@ -1,4 +1,6 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- luacheck: no unused args

View File

@@ -1,4 +1,6 @@
--- @meta
-- This file is NOT generated, edit it directly.
error('Cannot require a meta file')
-- luacheck: no unused args

View File

@@ -1,6 +1,7 @@
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
--
-- DO NOT EDIT. GENERATED BY: src/gen/gen_eval_files.lua
--
error('Cannot require a meta file')
--- Return the absolute value of {expr}. When {expr} evaluates to

View File

@@ -1,6 +1,7 @@
--- @meta _
-- THIS FILE IS GENERATED
-- DO NOT EDIT
--
-- DO NOT EDIT. GENERATED BY: src/gen/gen_eval_files.lua
--
error('Cannot require a meta file')
--- @class vim.v

View File

@@ -1,4 +1,5 @@
--- @meta _
-- This file is NOT generated, edit it directly. See also _meta/vvars.gen.lua.
error('Cannot require a meta file')
--- Extra types for vim.v dictionary fields