summaryrefslogtreecommitdiff
path: root/lua/lsp/handlers.lua
diff options
context:
space:
mode:
authorAbouzar Parvan <[email protected]>2021-08-01 14:27:15 +0430
committerGitHub <[email protected]>2021-08-01 09:57:15 +0000
commit30ad4b81f5dbccb6d49eb28ffdd33cefcb758ee5 (patch)
treea1b9784b7c3960bde6243e852ff624ea636460f8 /lua/lsp/handlers.lua
parent326ac090453b302b35b5747ab9a66f86c70acfbe (diff)
Hotfix/eslint d (#1198)
Diffstat (limited to 'lua/lsp/handlers.lua')
-rw-r--r--lua/lsp/handlers.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/lsp/handlers.lua b/lua/lsp/handlers.lua
index a25db3c1..849d2a03 100644
--- a/lua/lsp/handlers.lua
+++ b/lua/lsp/handlers.lua
@@ -27,7 +27,11 @@ function M.setup()
local diagnostics = params.diagnostics
for i, v in ipairs(diagnostics) do
- diagnostics[i].message = string.format("%s: %s", v.source, v.message)
+ local source = v.source
+ if string.find(v.source, "/") then
+ source = string.sub(v.source, string.find(v.source, "([%w-_]+)$"))
+ end
+ diagnostics[i].message = string.format("%s: %s", source, v.message)
if vim.tbl_contains(vim.tbl_keys(v), "code") then
diagnostics[i].message = diagnostics[i].message .. string.format(" [%s]", v.code)