Consistent filepath display and code cleanup. (#839)
BREAKING CHANGE: see :help telescope.changelog-839 for more information Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
@@ -15,8 +15,6 @@ local conf = require('telescope.config').values
|
||||
local lsp = {}
|
||||
|
||||
lsp.references = function(opts)
|
||||
opts.shorten_path = utils.get_default(opts.shorten_path, true)
|
||||
|
||||
local params = vim.lsp.util.make_position_params()
|
||||
params.context = { includeDeclaration = true }
|
||||
|
||||
@@ -250,8 +248,6 @@ lsp.range_code_actions = function(opts)
|
||||
end
|
||||
|
||||
lsp.workspace_symbols = function(opts)
|
||||
opts.shorten_path = utils.get_default(opts.shorten_path, true)
|
||||
|
||||
local params = {query = opts.query or ''}
|
||||
local results_lsp, err = vim.lsp.buf_request_sync(0, "workspace/symbol", params, opts.timeout or 10000)
|
||||
if err then
|
||||
@@ -283,7 +279,6 @@ lsp.workspace_symbols = function(opts)
|
||||
end
|
||||
|
||||
opts.ignore_filename = utils.get_default(opts.ignore_filename, false)
|
||||
opts.hide_filename = utils.get_default(opts.hide_filename, false)
|
||||
|
||||
pickers.new(opts, {
|
||||
prompt_title = 'LSP Workspace Symbols',
|
||||
@@ -337,7 +332,7 @@ lsp.diagnostics = function(opts)
|
||||
return
|
||||
end
|
||||
|
||||
opts.hide_filename = utils.get_default(opts.hide_filename, true)
|
||||
opts.path_display = utils.get_default(opts.path_display, 'hidden')
|
||||
pickers.new(opts, {
|
||||
prompt_title = 'LSP Document Diagnostics',
|
||||
finder = finders.new_table {
|
||||
@@ -354,7 +349,7 @@ end
|
||||
|
||||
lsp.workspace_diagnostics = function(opts)
|
||||
opts = utils.get_default(opts, {})
|
||||
opts.hide_filename = utils.get_default(opts.hide_filename, false)
|
||||
opts.path_display = utils.get_default(opts.path_display, {})
|
||||
opts.prompt_title = 'LSP Workspace Diagnostics'
|
||||
opts.get_all = true
|
||||
lsp.diagnostics(opts)
|
||||
|
||||
Reference in New Issue
Block a user