feat: migrate lsp/init.lua to fennel
This commit is contained in:
parent
8689c11dd0
commit
49eccb84e2
2 changed files with 45 additions and 75 deletions
24
fnl/lsp/init.fnl
Normal file
24
fnl/lsp/init.fnl
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{:setup (fn []
|
||||||
|
(local symbols {:Error "" :Info "" :Hint "" :Warn ""})
|
||||||
|
(each [name icon (pairs symbols)]
|
||||||
|
(let [hl (.. :DiagnosticSign name)]
|
||||||
|
(vim.fn.sign_define hl {:text icon :numhl hl :texthl hl})))
|
||||||
|
(let [lspconfig (require :lspconfig)]
|
||||||
|
(lspconfig.lua_ls.setup {:settings {:Lua {:runtime {:version :LuaJIT}
|
||||||
|
:diagnostics {:globals [:nixCats]}
|
||||||
|
:telemetry {:enable false}}}})
|
||||||
|
(lspconfig.nixd.setup {})
|
||||||
|
(lspconfig.marksman.setup {})
|
||||||
|
(lspconfig.tinymist.setup {:offset_encoding :utf-8})
|
||||||
|
(lspconfig.svelte.setup {})
|
||||||
|
(lspconfig.texlab.setup {})
|
||||||
|
(lspconfig.clangd.setup {})
|
||||||
|
(lspconfig.mesonlsp.setup {})
|
||||||
|
(lspconfig.nushell.setup {})
|
||||||
|
(lspconfig.vale_ls.setup {:filetypes [:markdown
|
||||||
|
:text
|
||||||
|
:tex
|
||||||
|
:rst
|
||||||
|
:typst]})
|
||||||
|
(lspconfig.fennel_ls.setup {}))
|
||||||
|
{})}
|
|
@ -1,78 +1,24 @@
|
||||||
local M = {}
|
-- [nfnl] Compiled from ./fnl/lsp/init.fnl by https://github.com/Olical/nfnl, do not edit.
|
||||||
|
local function _1_()
|
||||||
M.setup = function()
|
local symbols = {Error = "\243\176\133\153", Info = "\243\176\139\188", Hint = "\243\176\140\181", Warn = "\239\129\177"}
|
||||||
local symbols = { Error = "", Info = "", Hint = "", Warn = "" }
|
|
||||||
|
|
||||||
for name, icon in pairs(symbols) do
|
for name, icon in pairs(symbols) do
|
||||||
local hl = "DiagnosticSign" .. name
|
local hl = ("DiagnosticSign" .. name)
|
||||||
vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl })
|
vim.fn.sign_define(hl, {text = icon, numhl = hl, texthl = hl})
|
||||||
end
|
end
|
||||||
|
do
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
lspconfig.lua_ls.setup({settings = {Lua = {runtime = {version = "LuaJIT"}, diagnostics = {globals = {"nixCats"}}, telemetry = {enable = false}}}})
|
||||||
lspconfig.lua_ls.setup({
|
lspconfig.nixd.setup({})
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
runtime = {
|
|
||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
|
||||||
version = "LuaJIT",
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "nixCats" },
|
|
||||||
},
|
|
||||||
-- unfortunately we won't get nixCats autocomplete with this option
|
|
||||||
-- off, but lazydev will be much faster
|
|
||||||
--
|
|
||||||
-- workspace = {
|
|
||||||
-- -- Make the server aware of Neovim runtime files
|
|
||||||
-- library = vim.api.nvim_get_runtime_file("", true),
|
|
||||||
-- -- library =
|
|
||||||
-- },
|
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
|
||||||
telemetry = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.nixd.setup({
|
|
||||||
nixd = {
|
|
||||||
nixpkgs = {
|
|
||||||
expr = [[import (builtins.getFlake ")]] .. nixCats("nixdExtras.nixpkgs") .. [[") { } ]],
|
|
||||||
},
|
|
||||||
-- options = {
|
|
||||||
-- nixos = {
|
|
||||||
-- expr = [[(builtins.getFlake "]]
|
|
||||||
-- .. nixCats("nixdExtras.flake-path")
|
|
||||||
-- .. [[").nixosConfigurations."]]
|
|
||||||
-- .. nixCats("nixdExtras.systemCFGname")
|
|
||||||
-- .. [[".options]],
|
|
||||||
-- },
|
|
||||||
-- -- (builtins.getFlake "<path_to_system_flake>").homeConfigurations."<name>".options
|
|
||||||
-- ["home-manager"] = {
|
|
||||||
-- expr = [[(builtins.getFlake "]]
|
|
||||||
-- .. nixCats("nixdExtras.flake-path")
|
|
||||||
-- .. [[").homeConfigurations."]]
|
|
||||||
-- .. nixCats("nixdExtras.homeCFGname")
|
|
||||||
-- .. [[".options]],
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
lspconfig.marksman.setup({})
|
lspconfig.marksman.setup({})
|
||||||
lspconfig.tinymist.setup({
|
lspconfig.tinymist.setup({offset_encoding = "utf-8"})
|
||||||
offset_encoding = "utf-8",
|
|
||||||
})
|
|
||||||
lspconfig.svelte.setup({})
|
lspconfig.svelte.setup({})
|
||||||
lspconfig.texlab.setup({})
|
lspconfig.texlab.setup({})
|
||||||
lspconfig.clangd.setup({})
|
lspconfig.clangd.setup({})
|
||||||
lspconfig.mesonlsp.setup({})
|
lspconfig.mesonlsp.setup({})
|
||||||
lspconfig.nushell.setup({})
|
lspconfig.nushell.setup({})
|
||||||
lspconfig.vale_ls.setup({
|
lspconfig.vale_ls.setup({filetypes = {"markdown", "text", "tex", "rst", "typst"}})
|
||||||
filetypes = { "markdown", "text", "tex", "rst", "typst" },
|
|
||||||
})
|
|
||||||
lspconfig.fennel_ls.setup({})
|
lspconfig.fennel_ls.setup({})
|
||||||
|
end
|
||||||
|
return {}
|
||||||
end
|
end
|
||||||
|
return {setup = _1_}
|
||||||
return M
|
|
||||||
|
|
Loading…
Reference in a new issue