Skip to content

Commit

Permalink
feat: add lua_ls types for the plugin's options (#3)
Browse files Browse the repository at this point in the history
This way the users can know what options are available for the plugin.
  • Loading branch information
mikavilpas authored Nov 3, 2024
1 parent 5875f15 commit 16598dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/blink-cmp-rg/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---@module "blink.cmp"

---@class blink-cmp-rg.Options
---@field prefix_min_len? number
---@field get_command? fun(self: blink.cmp.Source, prefix: string): string[]
---@field get_prefix? fun(self: blink.cmp.Source): string

local RgSource = {}

---@param opts blink-cmp-rg.Options
function RgSource.new(opts)
opts = opts or {}

Expand Down Expand Up @@ -55,6 +63,8 @@ function RgSource:get_completions(context, resolve)
end)
:flatten()
:each(function(submatch)
---@type blink.cmp.CompletionItem
---@diagnostic disable-next-line: missing-fields
items[submatch.match.text] = {
label = submatch.match.text,
kind = vim.lsp.protocol.CompletionItemKind.Text,
Expand Down

0 comments on commit 16598dd

Please sign in to comment.