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:
Sanchayan Maity 2023-06-22 12:21:42 +05:30
parent 31c9213c0a
commit 9d8130d160
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -3,14 +3,14 @@ local lightbulb = require 'nvim-lightbulb'
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
return nil
end
vim.lsp.util.preview_location(result[1])
end
local function peek_definition()
local peek_definition = function()
local params = vim.lsp.util.make_position_params()
return vim.lsp.buf_request(0, 'textDocument/definition', params, preview_location_callback)
end