From 3fd504dbec39eeced1bea17d9f3bd06de7f3e4d8 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 16 Jul 2023 09:34:50 +0100 Subject: docs: handle whitespace in emmycomments --- scripts/lua2dox.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/lua2dox.lua') diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index bb5214f091..b0eb4c086c 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -328,6 +328,7 @@ function TLua2DoX_filter.filter(this, AppStamp, Filename) line = string_trim(inStream:getLine()) l = l + 1 if string.sub(line, 1, 2) == '--' then -- it's a comment + line = line:gsub('^---%s+@', '---@') -- Allow people to write style similar to EmmyLua (since they are basically the same) -- instead of silently skipping things that start with --- if string.sub(line, 3, 3) == '@' then -- it's a magic comment @@ -341,6 +342,7 @@ function TLua2DoX_filter.filter(this, AppStamp, Filename) if vim.startswith(line, '---@cast') or vim.startswith(line, '---@diagnostic') or vim.startswith(line, '---@overload') + or vim.startswith(line, '---@meta') or vim.startswith(line, '---@type') then -- Ignore LSP directives outStream:writeln('// gg:"' .. line .. '"') -- cgit From c2d7c2826ca77b0ca31bec511fdcdf1e4abaf946 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 17 Jul 2023 15:13:54 +0100 Subject: docs(lua): change *lua-foo* -> *vim.foo* --- scripts/lua2dox.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/lua2dox.lua') diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index b0eb4c086c..3f0d0505dd 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -416,6 +416,11 @@ function TLua2DoX_filter.filter(this, AppStamp, Filename) magic = table.concat(magic_split, ' ') + if magic_split[1] == 'defgroup' or magic_split[1] == 'addtogroup' then + -- Can't use '.' in defgroup, so convert to '--' + magic = magic:gsub('%.', '-dot-') + end + outStream:writeln('/// @' .. magic) fn_magic = checkComment4fn(fn_magic, magic) end -- cgit From 6e9b204afbe5f16c44a2697aed07aafff36bf856 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 17 Jul 2023 16:39:57 +0100 Subject: fix: doc errors --- scripts/lua2dox.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/lua2dox.lua') diff --git a/scripts/lua2dox.lua b/scripts/lua2dox.lua index 3f0d0505dd..55cb566ca3 100644 --- a/scripts/lua2dox.lua +++ b/scripts/lua2dox.lua @@ -363,6 +363,8 @@ function TLua2DoX_filter.filter(this, AppStamp, Filename) magic = magic:gsub('^return%s+.*%((' .. type .. ')%)', 'return %1') magic = magic:gsub('^return%s+.*%((' .. type .. '|nil)%)', 'return %1') end + -- handle the return of vim.spell.check + magic = magic:gsub('({.*}%[%])', '`%1`') magic_split = string_split(magic, ' ') end -- cgit