From 70c7197c4300565cb9fd8326ed4cc5ed6d8b7e82 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 15 May 2013 18:00:51 -0400 Subject: Fix absolute field tags; modules/lua/adeptsensedoc.lua An absolute field like '_G.events.FILE_OPENED' used to be tagged as belonging to the 'io' module, but it is tagged properly now. --- modules/lua/adeptsensedoc.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/lua') diff --git a/modules/lua/adeptsensedoc.lua b/modules/lua/adeptsensedoc.lua index f0bf42f3..d1a436b8 100644 --- a/modules/lua/adeptsensedoc.lua +++ b/modules/lua/adeptsensedoc.lua @@ -246,11 +246,15 @@ function M.start(doc) end -- Tag the fields. for _, f in ipairs(m.fields or {}) do + local field = m.fields[f] + local module = module -- define locally so any modification stays local + if f:find('^_G%.') then module, f = f:match('^_G%.(.-)%.?([^%.]+)$') end + if not module then print(field.name) end local ext_fields = module == '_G' and '' or 'class:'..module write_tag(ctags, f, 'F', ext_fields) write_apidoc(apidoc, {name = f}, { name = module..'.'..f, - description = m.fields[f], + description = field, class = 'field' }) end -- cgit v1.2.3