chore: add type annotations

This commit is contained in:
James Trew
2024-01-09 23:04:37 -05:00
parent 4367e05c06
commit 772da88723
9 changed files with 147 additions and 19 deletions
+9 -3
View File
@@ -1,3 +1,5 @@
---@diagnostic disable: undefined-doc-param
---@tag telescope.builtin
---@config { ['field_heading'] = "Options", ["module"] = "telescope.builtin" }
@@ -45,17 +47,21 @@ end
--
--
--- Search for a string and get results live as you type, respects .gitignore
---@param opts table: options to pass to the picker
---@class TelescopeLiveGrepOpts : TelescopeBasePickerOpts
---@field cwd string: root dir to search from (default: cwd, use utils.buffer_dir() to search relative to open buffer)
---@field grep_open_files boolean: if true, restrict search to open files only, mutually exclusive with `search_dirs`
---@field search_dirs table: directory/directories/files to search, mutually exclusive with `grep_open_files`
---@field search_dirs string[]: directory/directories/files to search, mutually exclusive with `grep_open_files`
---@field glob_pattern string|table: argument to be used with `--glob`, e.g. "*.toml", can use the opposite "!*.toml"
---@field type_filter string: argument to be used with `--type`, e.g. "rust", see `rg --type-list`
---@field additional_args function|table: additional arguments to be passed on. Can be fn(opts) -> tbl
---@field max_results number: define a upper result value
---@field disable_coordinates boolean: don't show the line & row numbers (default: false)
---@field file_encoding string: file encoding for the entry & previewer
---@field vimgrep_arguments string[]: cmd to use for the search
---@field [string] any
--- Search for a string and get results live as you type, respects .gitignore
---@param opts TelescopeLiveGrepOpts: options to pass to the picker
builtin.live_grep = require_on_exported_call("telescope.builtin.__files").live_grep
--- Searches for the string under your cursor or the visual selection in your current working directory