Skip to content

Commit b94172c

Browse files
committed
fix: misc typing issues
1 parent 6054da2 commit b94172c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lua/blink/cmp/completion/trigger.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
--- @field buffer_events blink.cmp.BufferEvents
2222
--- @field current_context_id number
2323
--- @field context? blink.cmp.Context
24-
--- @field show_emitter blink.cmp.EventEmitter<blink.cmp.Context>
24+
--- @field show_emitter blink.cmp.EventEmitter<{ context: blink.cmp.Context }>
2525
--- @field hide_emitter blink.cmp.EventEmitter<{}>
2626
---
2727
--- @field activate fun()

lua/blink/cmp/lib/text_edits.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ end
6060
--- Grabbed from vim.lsp.utils. Converts an offset_encoding to byte offset
6161
--- @param position lsp.Position
6262
--- @param offset_encoding? 'utf-8'|'utf-16'|'utf-32'
63-
--- @return integer
63+
--- @return number
6464
local function get_line_byte_from_position(position, offset_encoding)
6565
local bufnr = vim.api.nvim_get_current_buf()
6666
local col = position.character
@@ -70,7 +70,7 @@ local function get_line_byte_from_position(position, offset_encoding)
7070

7171
local line = vim.api.nvim_buf_get_lines(bufnr, position.line, position.line + 1, false)[1] or ''
7272
if vim.fn.has('nvim-0.11.0') == 1 then
73-
col = vim.str_byteindex(line, offset_encoding or 'utf-16', col, false)
73+
col = vim.str_byteindex(line, offset_encoding or 'utf-16', col, false) or 0
7474
else
7575
col = vim.lsp.util._str_byteindex_enc(line, col, offset_encoding or 'utf-16')
7676
end

lua/blink/cmp/signature/trigger.lua

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
--- @field show_if_on_trigger_character fun()
2525
--- @field show fun(opts?: { trigger_character: string })
2626
--- @field hide fun()
27+
--- @field set_active_signature_help fun(signature_help: lsp.SignatureHelp)
2728

2829
local config = require('blink.cmp.config').signature.trigger
2930
local utils = require('blink.cmp.lib.utils')

0 commit comments

Comments
 (0)