diff options
| author | fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> | 2021-03-04 15:01:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-04 15:01:17 +0100 |
| commit | 908752fc67f0aff43e35ffb175b5e6226874bad5 (patch) | |
| tree | 17a0874b107108fe07aca167184c83e2457be9fd /lua/telescope/make_entry.lua | |
| parent | 8dc00b08aa68ccfc259a35d31f55ff5eeedab17a (diff) | |
feat: workspace diagnostics, jump to and improved styling (#599)
Changes: `Telescope lsp_diagnostics` is now `Telescope lsp_document_diagnostics`
New: `Telescope lsp_workspace_diagnostics`
Co-authored-by: Fabian David Schmidt <fabian.david.schmidt@hotmail.com>
Co-authored-by: elianiva <dicha.arkana03@gmail.com>
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 2b27328..45601af 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -862,15 +862,16 @@ function make_entry.gen_from_lsp_diagnostics(opts) for _, v in pairs(lsp_type_diagnostic) do signs[v] = vim.trim(vim.fn.sign_getdefined("LspDiagnosticsSign" .. v)[1].text) end - -- expose line width for longer msg if opts.hide_filename - local line_width = utils.get_default(opts.line_width, 48) + + local layout = { + { width = 9 }, + { remaining = true } + } + local line_width = utils.get_default(opts.line_width, 47) + if not opts.hide_filename then table.insert(layout, 2, {width = line_width}) end local displayer = entry_display.create { separator = "▏", - items = { - { width = 11 }, - { width = line_width }, - { remaining = true } - } + items = layout } local make_display = function(entry) @@ -890,12 +891,10 @@ function make_entry.gen_from_lsp_diagnostics(opts) string.format("%s %s", signs[entry.type], pos), string.format("LspDiagnosticsDefault%s", entry.type) } - -- remove line break to avoid display issues - local text = string.format("%-" .. line_width .."s", entry.text:gsub(".* | ", ""):gsub("[\n]", "")) return displayer { line_info, - text, + entry.text, filename, } end @@ -912,7 +911,6 @@ function make_entry.gen_from_lsp_diagnostics(opts) or '' ) .. ' ' .. entry.text, display = make_display, - bufnr = entry.bufnr, filename = filename, type = entry.type, lnum = entry.lnum, |
