Fix tests

This commit is contained in:
António Mora 2024-06-07 13:28:42 +02:00
parent f895285651
commit 66f652cff0

View file

@ -1,34 +1,31 @@
return { return {
recommended = function()
return LazyVim.extras.wants({
ft = { "clojure", "edn" },
root = { "project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", "bb.edn" },
})
end,
-- Add Clojure & related to treesitter -- Add Clojure & related to treesitter
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "clojure" })
end
end,
},
-- Add Clojure LSP server
{
"williamboman/mason.nvim",
opts = function(_, opts) opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {} opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "clojure-lsp" }) vim.list_extend(opts.ensure_installed, { "clojure" })
end, end,
}, },
-- Extend auto completion -- Extend auto completion
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
optional = true,
dependencies = { dependencies = {
"PaterJason/cmp-conjure", "PaterJason/cmp-conjure",
}, },
opts = function(_, opts) opts = function(_, opts)
local cmp = require("cmp") if type(opts.sources) == "table" then
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { vim.list_extend(opts.sources, { name = "clojure" })
{ name = "conjure" }, end
}))
end, end,
}, },
@ -37,21 +34,49 @@ return {
-- Add s-exp mappings -- Add s-exp mappings
{ "PaterJason/nvim-treesitter-sexp" }, { "PaterJason/nvim-treesitter-sexp" },
{ "echasnovski/mini.surround" },
-- Colorize the output of the log buffer -- Colorize the output of the log buffer
{ {
"m00qek/baleia.nvim", "m00qek/baleia.nvim",
version = "*",
config = function() config = function()
vim.g.conjure_baleia = require("baleia").setup({ line_starts_at = 3 }) vim.g.conjure_baleia = require("baleia").setup({ line_starts_at = 3 })
local augroup = vim.api.nvim_create_augroup("ConjureBaleia", { clear = true }) vim.api.nvim_create_user_command("BaleiaColorize", function()
vim.g.conjure_baleia.once(vim.api.nvim_get_current_buf())
end, { bang = true })
vim.api.nvim_create_autocmd({ "BufEnter" }, { vim.api.nvim_create_user_command("BaleiaLogs", vim.g.conjure_baleia.logger.show, { bang = true })
end,
},
-- Use Clojure REPL
{
"Olical/conjure",
config = function(_, _)
require("conjure.main").main()
require("conjure.mapping")["on-filetype"]()
end,
init = function()
-- print color codes if baleia.nvim is available
local colorize = require("lazyvim.util").has("baleia.nvim")
if colorize then
vim.g["conjure#log#strip_ansi_escape_sequences_line_limit"] = 0
else
vim.g["conjure#log#strip_ansi_escape_sequences_line_limit"] = 1
end
-- disable diagnostics in log buffer and colorize it
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
pattern = "conjure-log-*", pattern = "conjure-log-*",
group = augroup,
callback = function() callback = function()
local buffer = vim.api.nvim_get_current_buf()
vim.diagnostic.enable(false, { bufnr = buffer })
if colorize and vim.g.conjure_baleia then
vim.g.conjure_baleia.automatically(buffer)
end
vim.keymap.set( vim.keymap.set(
{ "n", "v" }, { "n", "v" },
"[c", "[c",
@ -67,40 +92,6 @@ return {
end, end,
}) })
vim.api.nvim_create_user_command("BaleiaColorize", function()
vim.g.conjure_baleia.once(vim.api.nvim_get_current_buf())
end, { bang = true })
vim.api.nvim_create_user_command("BaleiaLogs", vim.g.conjure_baleia.logger.show, { bang = true })
end,
},
-- Use Clojure REPL
{
"Olical/conjure",
ft = { "clojure", "fennel" },
config = function(_, _)
require("conjure.main").main()
require("conjure.mapping")["on-filetype"]()
end,
init = function()
-- print color codes if baleia.nvim is available
local colorize = require("lazyvim.util").has("baleia.nvim")
vim.g["conjure#log#strip_ansi_escape_sequences_line_limit"] = colorize and 1 or nil
-- disable diagnostics in log buffer and colorize it
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
pattern = "conjure-log-*",
callback = function()
local buffer = vim.api.nvim_get_current_buf()
vim.diagnostic.disable(buffer)
if colorize and vim.g.conjure_baleia then
vim.g.conjure_baleia.automatically(buffer)
end
end,
})
-- prefer LSP for jump-to-definition and symbol-doc, and use conjure -- prefer LSP for jump-to-definition and symbol-doc, and use conjure
-- alternatives with <localleader>K and <localleader>gd -- alternatives with <localleader>K and <localleader>gd
vim.g["conjure#mapping#doc_word"] = "K" vim.g["conjure#mapping#doc_word"] = "K"