This neovim plugin provides ale#other_source#ShowResults so coc.nvim with diagnostic.displayByAle can pipe diagnostics directly to vim.diagnostic without installing the entirety of dense-analysis/ale
This plugin conflicts with dense-analysis/ale so make sure you don't have both!
Lazy.nvim add:
{
"davidosomething/coc-diagnostics-shim.nvim"
}
coc-settings.json add:
{
...
"diagnostic.displayByAle": true,
...
}
You can configure the plugin with formatters, i.e. with
{
"neoclide/coc.nvim",
branch = "release",
dependencies = {
"davidosomething/format-ts-errors.nvim",
"davidosomething/coc-diagnostics-shim.nvim",
},
init = function()
vim.g.coc_start_at_startup = true
vim.g.coc_global_extensions = {
"coc-json",
"coc-tsserver",
-- "coc-pretty-ts-errors" -- using format-ts-errors instead, remove and uninstall this!
}
require("coc-diagnostics-shim").setup({
formatters = {
coctsserver = {
---@diagnostic disable-next-line: unused-local
function(linter_name, item, formatted)
local prettifier = require("format-ts-errors")[item.code]
if not prettifier then
vim.print("no prettifier for " .. item.code)
return formatted
end
local prettified = prettifier(item.text)
return ("%s%s"):format(
prettified,
"ꜰᴏʀᴍᴀᴛᴛᴇᴅ ᴡɪᴛʜ ꜰᴏʀᴍᴀᴛ-ᴛs-ᴇʀʀᴏʀs.ɴᴠɪᴍ"
)
end,
},
},
})
end,
},
MIT