Compare commits

...

2 commits

Author SHA1 Message Date
Anish Lakhwara a90219e7cd working fennel-ls wowsa 2022-12-30 23:04:47 +10:00
Anish Lakhwara 708e0fec3a fennel-ls maybe 2022-12-30 22:36:20 +10:00
3 changed files with 54 additions and 21 deletions

View file

@ -505,22 +505,6 @@ in
format = lspkind.cmp_format({
mode = 'symbol_text',
maxwidth = 50,
-- old format
-- format = function(entry, vim_item)
-- -- fancy icons and a name of kind
-- vim_item.kind = require("lspkind").presets.default[vim_item.kind] ..
-- " " .. vim_item.kind
-- -- set a name for each source
-- vim_item.menu = ({
-- buffer = "[Buffer]",
-- nvim_lsp = "[LSP]",
-- look = "[Look]",
-- path = "[Path]",
-- spell = "[Spell]",
-- calc = "[Calc]",
-- })[entry.source.name]
-- return vim_item
-- end
})
},
mapping = {
@ -625,10 +609,19 @@ in
},
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
capabilities = require('cmp_nvim_lsp').default_capabilities()
-- fennel-ls is bleeding edge
local lspconfig = require('lspconfig')
require("lspconfig.configs")["fennel-ls"] = {
default_config = {
cmd = {"fennel-ls"},
filetypes = {"fennel"},
root_dir = function(dir) return lspconfig.util.find_git_ancestor(dir) end,
settings = {}
}
}
local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'sumneko_lua'}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
@ -640,12 +633,20 @@ in
}
end
-- rnix doesn't support gps
require('lspconfig').rnix.setup {
lspconfig['rnix'].setup {
on_attach = function(client, bufnr)
format.on_attach(client)
end,
capabilities = capabilities,
}
-- fennel-ls doesn't support gps
lspconfig['fennel-ls'].setup {
on_attach = function(client, bufnr)
format.on_attach(client)
end,
capabilities = capabilities,
}
-- deprecated pylsp
-- require('lspconfig').pylsp.setup {
-- on_attach = function(client, bufnr)
@ -864,6 +865,7 @@ in
nodePackages.typescript
nodePackages.typescript-language-server
sumneko-lua-language-server
fennel-ls
];
plugins = with pkgs.vimPlugins // customPlugins; [

View file

@ -4,5 +4,5 @@
{ pkgs ? (import ../nixpkgs.nix) { } }: {
plymouth-themes = pkgs.callPackage ./plymouth.nix { };
tic-80 = pkgs.callPackage ./tic-80.nix { };
fennel-ls = pkgs.callPackage ./fennel-ls.nix { };
}

31
pkgs/fennel-ls.nix Normal file
View file

@ -0,0 +1,31 @@
# Stolen from: https://gist.github.com/jjwatt/c83c02e6903c8ffaf546fe5eb27e7d25?permalink_comment_id=3305141#gistcomment-3305141
{ pkgs, ... }:
pkgs.stdenv.mkDerivation rec {
name = "fennel-ls";
src = pkgs.fetchgit {
url = "https://git.sr.ht/~xerool/fennel-ls";
rev = "70e434839fdf9fad7512118d3f72e38aa8d3ca9f";
sha256 = "mYOAlSCixlWzykPeLcGyTzWksDAJjblkYwI0k1GuYvE=";
};
buildInputs = with pkgs; [
lua
fennel
];
configurePhase = ''
echo [DIRECTORY] $(pwd)
sed -i 's/\.\/fennel/fennel/' Makefile
# cd build/
# cmake ..
'';
buildPhase = ''
make -j4
'';
installPhase = ''
mkdir -p $out/bin
chmod a+x fennel-ls
cp -v fennel-ls $out/bin
'';
}