From 95b9561fd510ae868288ca12f14d666d11052111 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 25 Feb 2011 17:00:56 -0500 Subject: Allow for raw symbol matching in get_apidoc(); modules/textadept/adeptsense.lua --- modules/textadept/adeptsense.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/textadept') diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua index 544f2df4..63282680 100644 --- a/modules/textadept/adeptsense.lua +++ b/modules/textadept/adeptsense.lua @@ -533,11 +533,14 @@ end -- the 'pos' key in the returned list. -- @param sense The adeptsense returned by adeptsense.new(). -- @param symbol The symbol to get apidocs for. +-- @param raw Flag indicating whether or not to lookup the raw symbol as opposed +-- to parsing it for class information. Defaults to false. -- @return apidoc_list or nil -function get_apidoc(sense, symbol) +function get_apidoc(sense, symbol, raw) if not symbol then return nil end local apidocs = { pos = 1} local entity, func = symbol:match('^(.-)[^%w_]*([%w_]+)$') + if raw then entity, func = '', symbol end local c = func:sub(1, 1) -- for quick comparison local patt = '^'..func..'%s+(.+)$' for _, file in ipairs(sense.api_files) do -- cgit v1.2.3