aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-02-25 17:00:56 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2011-02-25 17:00:56 -0500
commit95b9561fd510ae868288ca12f14d666d11052111 (patch)
tree0381061bfe27d406a9e3009f1b8b14b973afae52 /modules/textadept
parentd41f1d86942e68fa089e507414b960d5d09a1988 (diff)
downloadtextadept-95b9561fd510ae868288ca12f14d666d11052111.tar.gz
textadept-95b9561fd510ae868288ca12f14d666d11052111.zip
Allow for raw symbol matching in get_apidoc(); modules/textadept/adeptsense.lua
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/adeptsense.lua5
1 files changed, 4 insertions, 1 deletions
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