Skip to content

Commit

Permalink
fix: misc typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Nov 28, 2024
1 parent 6054da2 commit b94172c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/blink/cmp/completion/trigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
--- @field buffer_events blink.cmp.BufferEvents
--- @field current_context_id number
--- @field context? blink.cmp.Context
--- @field show_emitter blink.cmp.EventEmitter<blink.cmp.Context>
--- @field show_emitter blink.cmp.EventEmitter<{ context: blink.cmp.Context }>
--- @field hide_emitter blink.cmp.EventEmitter<{}>
---
--- @field activate fun()
Expand Down
4 changes: 2 additions & 2 deletions lua/blink/cmp/lib/text_edits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end
--- Grabbed from vim.lsp.utils. Converts an offset_encoding to byte offset
--- @param position lsp.Position
--- @param offset_encoding? 'utf-8'|'utf-16'|'utf-32'
--- @return integer
--- @return number
local function get_line_byte_from_position(position, offset_encoding)
local bufnr = vim.api.nvim_get_current_buf()
local col = position.character
Expand All @@ -70,7 +70,7 @@ local function get_line_byte_from_position(position, offset_encoding)

local line = vim.api.nvim_buf_get_lines(bufnr, position.line, position.line + 1, false)[1] or ''
if vim.fn.has('nvim-0.11.0') == 1 then
col = vim.str_byteindex(line, offset_encoding or 'utf-16', col, false)
col = vim.str_byteindex(line, offset_encoding or 'utf-16', col, false) or 0
else
col = vim.lsp.util._str_byteindex_enc(line, col, offset_encoding or 'utf-16')
end
Expand Down
1 change: 1 addition & 0 deletions lua/blink/cmp/signature/trigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
--- @field show_if_on_trigger_character fun()
--- @field show fun(opts?: { trigger_character: string })
--- @field hide fun()
--- @field set_active_signature_help fun(signature_help: lsp.SignatureHelp)

local config = require('blink.cmp.config').signature.trigger
local utils = require('blink.cmp.lib.utils')
Expand Down

0 comments on commit b94172c

Please sign in to comment.