float title

pull/268/head
ray-x 1 year ago
parent 8b3d26453d
commit 274581e35e

@ -126,6 +126,7 @@ local function ctags_symbols()
transparency = 50, transparency = 50,
prompt = true, prompt = true,
rawdata = true, rawdata = true,
title = 'ctags',
rect = { height = height, pos_x = 0, pos_y = 0, width = width }, rect = { height = height, pos_x = 0, pos_y = 0, width = width },
} }

@ -29,7 +29,7 @@ local definition_hdlr = function(err, locations, ctx, _)
if vim.tbl_islist(locations) then if vim.tbl_islist(locations) then
if #locations > 1 then if #locations > 1 then
local items = locations_to_items(locations) local items = locations_to_items(locations)
gui.new_list_view({ items = items, api = 'Definition' }) gui.new_list_view({ items = items, api = 'Definition', title = 'Definition' })
else else
vim.lsp.util.jump_to_location(locations[1], oe) vim.lsp.util.jump_to_location(locations[1], oe)
end end

@ -404,6 +404,7 @@ M.show_buf_diagnostics = function()
.. _NgConfigValues.icons.diagnostic_head .. _NgConfigValues.icons.diagnostic_head
.. ' Diagnostic ', .. ' Diagnostic ',
enable_preview_edit = true, enable_preview_edit = true,
title = 'LSP Diagnostic',
}) })
if listview == nil then if listview == nil then
return log('nil listview') return log('nil listview')

@ -56,6 +56,7 @@ function M.new_list_view(opts)
opts.external = config.external opts.external = config.external
opts.preview_lines_before = 4 opts.preview_lines_before = 4
opts.title = opts.title or 'Navigator Searcher'
if _NgConfigValues.debug then if _NgConfigValues.debug then
local logopts = { items = {}, data = {} } local logopts = { items = {}, data = {} }
logopts = vim.tbl_deep_extend('keep', logopts, opts) logopts = vim.tbl_deep_extend('keep', logopts, opts)

@ -122,6 +122,7 @@ hierarchy_handler = function(dir, handler, show, api, err, result, ctx, cfg)
bufnr = bufnr, bufnr = bufnr,
panel = opts.panel, panel = opts.panel,
parent_node = opts.parent_node, parent_node = opts.parent_node,
title = 'Call Hierarchy',
} }
local win = show(show_args) local win = show(show_args)
return results, win return results, win

@ -18,7 +18,7 @@ end
local function implementation_handler(_, err, result, ctx, cfg) local function implementation_handler(_, err, result, ctx, cfg)
local results = location_handler(err, result, ctx, cfg, 'Implementation not found') local results = location_handler(err, result, ctx, cfg, 'Implementation not found')
local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft') local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft')
gui.new_list_view({ items = results, ft = ft, api = 'Implementation' }) gui.new_list_view({ items = results, ft = ft, api = 'Implementation', title = 'Implementation' })
end end
function M.implementation(bang, opts) function M.implementation(bang, opts)
@ -29,7 +29,12 @@ function M.implementation(bang, opts)
local params = vim.lsp.util.make_position_params() local params = vim.lsp.util.make_position_params()
log('impel params', params) log('impel params', params)
lsphelper.call_sync('textDocument/implementation', params, opts, partial(implementation_handler, bang)) lsphelper.call_sync(
'textDocument/implementation',
params,
opts,
partial(implementation_handler, bang)
)
end end
M.implementation_call = partial(M.implementation, 0) M.implementation_call = partial(M.implementation, 0)

@ -94,6 +94,7 @@ local ref_view = function(err, locations, ctx, cfg)
width = width, width = width,
api = 'Reference', api = 'Reference',
enable_preview_edit = true, enable_preview_edit = true,
title = 'References ' .. vim.fn.expand('<cword>'),
} }
local listview local listview
if not ctx.no_show then if not ctx.no_show then
@ -215,24 +216,27 @@ local function fetch_lsp_references(bufnr, lsp_params, callback)
log(bufnr, params) log(bufnr, params)
-- return id, closer -- return id, closer
return vim.lsp.buf_request(bufnr, 'textDocument/references', params, function(err, result, ctx, cfg) return vim.lsp.buf_request(
log(result) bufnr,
if err then 'textDocument/references',
log('[nav-rename] Error while finding references: ' .. err.message) params,
return function(err, result, ctx, cfg)
end log(result)
if not result or vim.tbl_isempty(result) then if err then
log('[nav-rename] Nothing to rename', result) log('[nav-rename] Error while finding references: ' .. err.message)
return return
end end
if callback then if not result or vim.tbl_isempty(result) then
callback(err, result, ctx, cfg) log('[nav-rename] Nothing to rename', result)
return
end
if callback then
callback(err, result, ctx, cfg)
end
end end
end) )
end end
local ref_req = function() local ref_req = function()
if _NgConfigValues.closer ~= nil then if _NgConfigValues.closer ~= nil then
-- do not call it twice -- do not call it twice

@ -308,6 +308,7 @@ M.rename = function()
ghinput.setup({ ghinput.setup({
on_change = function(new_name) end, on_change = function(new_name) end,
on_concel = function(new_name) end, on_concel = function(new_name) end,
title = 'lsp rename',
on_cancel = function() end, on_cancel = function() end,
}) })
vim.ui.input = ghinput.input vim.ui.input = ghinput.input

@ -126,6 +126,7 @@ M.document_symbol_handler = function(err, result, ctx)
rawdata = true, rawdata = true,
height = 0.62, height = 0.62,
preview_height = 0.1, preview_height = 0.1,
title = 'Document Symbols',
ft = ft, ft = ft,
api = _NgConfigValues.icons.doc_symbol, api = _NgConfigValues.icons.doc_symbol,
}) })
@ -153,7 +154,7 @@ M.workspace_symbol_handler = function(err, result, ctx, cfg)
log(items[1]) log(items[1])
local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft') local ft = vim.api.nvim_buf_get_option(ctx.bufnr, 'ft')
gui.new_list_view({ items = items, prompt = true, ft = ft, rowdata = true, api = '' }) gui.new_list_view({ items = items, prompt = true, ft = ft, rowdata = true, api = '' , title = 'Workspace Symbols''})
end end
function M.side_panel() function M.side_panel()

@ -785,6 +785,7 @@ function M.buf_ts()
height = 0.62, height = 0.62,
preview_height = 0.12, preview_height = 0.12,
width = (width or 80) + 10, width = (width or 80) + 10,
title = 'treesitter symbols',
api = _NgConfigValues.icons.treesitter_defult, api = _NgConfigValues.icons.treesitter_defult,
}) })
return listview, all_nodes, width return listview, all_nodes, width
@ -825,6 +826,7 @@ function M.bufs_ts()
height = 0.62, height = 0.62,
preview_height = 0.12, preview_height = 0.12,
width = max_length + 10, width = max_length + 10,
title = 'treesitter symbols',
api = _NgConfigValues.icons.treesitter_defult, api = _NgConfigValues.icons.treesitter_defult,
}) })
end end

@ -93,6 +93,7 @@ M.list_workspace_folders = function()
local folders = vim.lsp.buf.list_workspace_folders() local folders = vim.lsp.buf.list_workspace_folders()
if #folders > 0 then if #folders > 0 then
return require('navigator.gui').new_list_view({ return require('navigator.gui').new_list_view({
title = 'workspace folders',
items = folders, items = folders,
border = 'single', border = 'single',
rawdata = true, rawdata = true,

Loading…
Cancel
Save