Skip to content

Commit

Permalink
refactor: rename get_context_bounds to get_bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 19, 2024
1 parent 46eb5f3 commit ebc08ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lua/blink/cmp/completion/trigger/context.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
--- @field get_cursor fun(): number[]
--- @field set_cursor fun(cursor: number[])
--- @field get_line fun(num?: number): string
--- @field get_context_bounds fun(line: string, cursor: number[]): blink.cmp.ContextBounds
--- @field get_bounds fun(line: string, cursor: number[]): blink.cmp.ContextBounds
--- @field get_regex_around_cursor fun(range: string, regex_str: string, exclude_from_prefix_regex_str: string): { start_col: number, length: number }

--- @class blink.cmp.ContextOpts
Expand All @@ -49,7 +49,7 @@ function context.new(opts)
bufnr = vim.api.nvim_get_current_buf(),
cursor = cursor,
line = line,
bounds = context.get_context_bounds(line, cursor),
bounds = context.get_bounds(line, cursor),
trigger = {
kind = opts.trigger_character and vim.lsp.protocol.CompletionTriggerKind.TriggerCharacter
or vim.lsp.protocol.CompletionTriggerKind.Invoked,
Expand Down Expand Up @@ -102,7 +102,7 @@ function context.get_line(num)
end

--- Moves forward and backwards around the cursor looking for word boundaries
function context.get_context_bounds(line, cursor)
function context.get_bounds(line, cursor)
local cursor_line = cursor[1]
local cursor_col = cursor[2]

Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/completion/trigger/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
--- @field show fun(opts?: { trigger_character?: string, force?: boolean, send_upstream?: boolean, providers?: string[], prefetch?: boolean })
--- @field hide fun()
--- @field within_query_bounds fun(cursor: number[]): boolean
--- @field get_context_bounds fun(regex: vim.regex, line: string, cursor: number[]): blink.cmp.ContextBounds
--- @field get_bounds fun(regex: vim.regex, line: string, cursor: number[]): blink.cmp.ContextBounds

local keyword_config = require('blink.cmp.config').completion.keyword
local config = require('blink.cmp.config').completion.trigger
Expand Down

0 comments on commit ebc08ab

Please sign in to comment.