nvim: lsp: Minor clean up
Define functions in a consistent way through out. We like the pattern `local function_name = function()` instead of `local function_name()` for defining functions.
This commit is contained in:
parent
31c9213c0a
commit
9d8130d160
1 changed files with 2 additions and 2 deletions
|
@ -3,14 +3,14 @@ local lightbulb = require 'nvim-lightbulb'
|
||||||
|
|
||||||
vim.lsp.set_log_level("off")
|
vim.lsp.set_log_level("off")
|
||||||
|
|
||||||
local function preview_location_callback(_, result)
|
local preview_location_callback = function(_, result)
|
||||||
if result == nil or vim.tbl_isempty(result) then
|
if result == nil or vim.tbl_isempty(result) then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
vim.lsp.util.preview_location(result[1])
|
vim.lsp.util.preview_location(result[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
local function peek_definition()
|
local peek_definition = function()
|
||||||
local params = vim.lsp.util.make_position_params()
|
local params = vim.lsp.util.make_position_params()
|
||||||
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
|
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue