Comments (13)
from nixvim.
I've added the parentheses to the __lspCapabilities function but that doesn't fix the problem (E5107: Error loading lua [string ":lua"]:14: '}' expected (to close '{' at line 12) near 'capabilities'
)
EDIT: It seems like there are some ,
missing
-- LSP {{{
local __lspServers = {}
local __lspOnAttach = function(client)
end
local __lspCapabilities = function()
end
for i,server in ipairs(__lspServers) do
if type(server) == "string" then
require('lspconfig')[server].setup {
on_attach = __lspOnAttach
capabilities = __lspCapabilities
}
else
require('lspconfig')[server.name].setup(server.extraOptions)
end
end
-- }}}
from nixvim.
Could you open a PR with your fix?
from nixvim.
Could you open a PR with your fix?
yes, #8
from nixvim.
Fixed by #8, thank you!
from nixvim.
I should maybe open another issue, but this is still fresh π
The nix lsp seems to be broken:
Error detected while processing FileType Autocommands for "nix":
E5108: Error executing lua vim/shared.lua:260: after the second argument: expected table, got function
stack traceback:
[C]: in function 'error'
vim/shared.lua:608: in function 'validate'
vim/shared.lua:260: in function 'tbl_deep_extend'
...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:134: in function '_make_config'
...home-manager/start/nvim-lspconfig/lua/lspconfig/util.lua:255: in function 'add'
...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:217: in function 'try_add'
[string ":lua"]:1: in main chunk
from nixvim.
Hmm, that's weird because its works for me
lsp = {
enable = true;
servers.rnix-lsp.enable = true;
};
from nixvim.
Oh my bad, it seems to be only happening when both plugins.nix.enable and plugins.lsp.servers.rnix-lsp.enable are set to true. They're both conflicting
from nixvim.
Actually, while I'm not getting errors with rnix-lsp (but it doesn't appear to be working) when the nix plugin is disabled. I am getting it for rust, with the nix plugin disabled:
Error detected while processing FileType Autocommands for "rust":
E5108: Error executing lua vim/shared.lua:260: after the second argument: expected table, got function
stack traceback:
[C]: in function 'error'
vim/shared.lua:608: in function 'validate'
vim/shared.lua:260: in function 'tbl_deep_extend'
...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:134: in function '_make_config'
...home-manager/start/nvim-lspconfig/lua/lspconfig/util.lua:255: in function 'add'
...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:217: in function 'try_add'
[string ":lua"]:1: in main chunk
from nixvim.
I'll be checking this out tomorrow, thanks for reporting. From what I remember, no plugins should conflict at all, so it's definitely a bug.
from nixvim.
Actually, while I'm not getting errors with rnix-lsp (but it doesn't appear to be working) when the nix plugin is disabled. I am getting it for rust, with the nix plugin disabled:
Error detected while processing FileType Autocommands for "rust": E5108: Error executing lua vim/shared.lua:260: after the second argument: expected table, got function stack traceback: [C]: in function 'error' vim/shared.lua:608: in function 'validate' vim/shared.lua:260: in function 'tbl_deep_extend' ...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:134: in function '_make_config' ...home-manager/start/nvim-lspconfig/lua/lspconfig/util.lua:255: in function 'add' ...e-manager/start/nvim-lspconfig/lua/lspconfig/configs.lua:217: in function 'try_add' [string ":lua"]:1: in main chunk
that's weird because i can't seem to reproduce the error you're getting when enabling plugins.nix
and plugins.lsp.servers.rust-analyzer
from nixvim.
Hi, sorry for being gone for so long. Seems like there are several issues to unravel here! First off, after turning on LSP on my config, I get this line:
local __lspCapabilities = function
end
in my init.vim, which is clearly wrong, because it's missing the parentheses after function().
However, looking at the culprit code...
extraConfigLua = ''
-- LSP {{{
local __lspServers = ${helpers.toLuaObject cfg.enabledServers}
local __lspOnAttach = function(client)
${cfg.onAttach}
end
local __lspCapabilities = function()
${cfg.capabilities}
end
-- ...
";
Uh, this is odd.... If anyone has any idea why this is happening, help is welcome!
from nixvim.
For now, just to have LSP working, I think I will just comment this part out, since it's not being used by anyone.
from nixvim.
Related Issues (20)
- [BUG] Example for plugins.gitsigns.onAttach is wrong / confusing
- [BUG] Unable to set obsidian.followUrlFunc using if statement
- [PLUGIN REQUEST] virt-column.nvim
- [BUG] attribute 'base16-nvim' missing HOT 2
- [BUG] Can't install nixvim, "option ... does not exist" HOT 2
- [BUG] Alpha terminal
- [BUG] Conform plugin does not install enabled formatters
- [PLUGIN REQUEST] indent-o-matic
- [PLUGIN REQUEST] direnv.vim
- [PLUGIN REQUEST] crates.nvim HOT 2
- Running `nix flake show` fails to evaluate on `x86_64-linux` HOT 2
- [BUG] copilot-vim.keymaps do not work properly
- LSP keymaps should use keymap-helpers submodule HOT 2
- [PLUGIN REQUEST] lsp-status.nvim
- [BUG] error: `phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`. HOT 14
- [PLUGIN REQUEST] vim-sandwich
- [BUG] Treesitter configures custom parser lists incorrectly HOT 4
- plugins/whichkey: Support window and layout fields HOT 1
- [PLUGIN REQUEST] <auto-save fork>
- [BUG] [nvim-cmp] unable to pass a function in sources entryFilter HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixvim.