diff options
| author | tami5 <kkharji@protonmail.com> | 2022-03-13 20:11:27 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-13 18:11:27 +0100 |
| commit | ef7b6ada6d91a1b2932492d78c730e4fc00cd2ea (patch) | |
| tree | dda4cb7cb3357724c83e85666bc8dc5c1ee2e898 /lua/telescope/builtin/diagnostics.lua | |
| parent | 75b57304323861631519e204d9fbca7bdbf1c4c5 (diff) | |
feat: improve UX with vim.notify (#1763)
* fix(notify): don't report request on new line
* ref(notify): update message format
* ref(msgs): always quote values + decrease duplication
* fix(ci): undefined variables
* ref(actions): temporary silent actions.__index errors
* cleanup
* revert: panic effort, we continue to use error for those
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/builtin/diagnostics.lua')
| -rw-r--r-- | lua/telescope/builtin/diagnostics.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lua/telescope/builtin/diagnostics.lua b/lua/telescope/builtin/diagnostics.lua index cd9c07f..2614e36 100644 --- a/lua/telescope/builtin/diagnostics.lua +++ b/lua/telescope/builtin/diagnostics.lua @@ -2,6 +2,7 @@ local conf = require("telescope.config").values local finders = require "telescope.finders" local make_entry = require "telescope.make_entry" local pickers = require "telescope.pickers" +local utils = require "telescope.utils" local diagnostics = {} @@ -28,7 +29,10 @@ local diagnostics_to_tbl = function(opts) local diagnosis_opts = { severity = {}, namespace = opts.namespace } if opts.severity ~= nil then if opts.severity_limit ~= nil or opts.severity_bound ~= nil then - print "Invalid severity parameters. Both a specific severity and a limit/bound is not allowed" + utils.notify("builtin.diagnostics", { + msg = "Invalid severity parameters. Both a specific severity and a limit/bound is not allowed", + level = "ERROR", + }) return {} end diagnosis_opts.severity = opts.severity @@ -110,7 +114,10 @@ diagnostics.get = function(opts) local locations = diagnostics_to_tbl(opts) if vim.tbl_isempty(locations) then - print "No diagnostics found" + utils.notify("builtin.diagnostics", { + msg = "No diagnostics found", + level = "INFO", + }) return end |
