Skip to content

Commit

Permalink
Merge pull request #55 from redyf/dev
Browse files Browse the repository at this point in the history
Better lsp for nix + formatting for null-ls
  • Loading branch information
redyf authored Feb 10, 2024
2 parents 507eb46 + d4b9b2c commit 2268697
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions config/lsp/lsp.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
plugins = {
lsp-format = {
enable = true;
enable = false; # Enable it if you want lsp-format integration for none-ls
};
lsp = {
enable = true;
Expand All @@ -22,7 +22,7 @@
};
};
};
nixd = { enable = true; };
nil_ls = { enable = true; };
tsserver = {
enable = false;
filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" ];
Expand Down
16 changes: 15 additions & 1 deletion config/none-ls/none-ls.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
{
plugins.none-ls = {
enable = false;
enableLspFormat = true;
enableLspFormat = false;
updateInInsert = false;
onAttach = ''
function(client, bufnr)
if client.supports_method "textDocument/formatting" then
vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr }
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format { bufnr = bufnr }
end,
})
end
end
'';
sources = {
code_actions = {
eslint_d.enable = true;
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2268697

Please sign in to comment.