diff options
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 3ec663b..4db664e 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -284,4 +284,53 @@ function make_entry.gen_from_treesitter(opts) end end +function make_entry.gen_from_tagfile(opts) + local help_entry, version + local delim = string.char(7) + + local make_display = function(line) + help_entry = "" + display = "" + version = "" + + line = line .. delim + for section in line:gmatch("(.-)" .. delim) do + if section:find("^vim:") == nil then + local ver = section:match("^neovim:(.*)") + if ver == nil then + help_entry = section + else + version = ver:sub(1, -2) + end + end + end + + result = {} + if version ~= "" then -- some Vim only entries are unversioned + if opts.show_version then + result.display = string.format("%s [%s]", help_entry, version) + else + result.display = help_entry + end + result.value = help_entry + end + + return result + end + + return function(line) + local entry = { + entry_type = make_entry.types.GENERIC, + + } + local d = make_display(line) + entry.valid = next(d) ~= nil + entry.display = d.display + entry.value = d.value + entry.ordinal = d.value + + return entry + end +end + return make_entry |
