Closed daUnknownCoder closed 1 week ago
first param is client
first param is client
Sorry about that but I just tried switching places, and it doesn't matter (earlier first param was client)
It doesn't matter whatever I put there but it doesn't attach (not only for lua_ls but for every language) Check : https://www.reddit.com/r/neovim/comments/1dnl0f9/lsp_stuff_not_working/
hi @glepnir are we re-opening this?
idk if this is related but, i recently started using lsp_lines.nvim
in favor of vim.diagnostic.open_float()
which stopped working recently due to this
Description
plainly,
on_attach
isnt workingthis is my on_attach:
so idk whats wrong.
this is my whole config
```lua return { { "neovim/nvim-lspconfig", event = { "LazyFile" }, keys = { { "gT", function() local buf = vim.api.nvim_get_current_buf() local clients = vim.lsp.get_clients({ bufnr = buf }) if not vim.tbl_isempty(clients) then vim.cmd("LspStop") else vim.cmd("LspStart") end end, desc = "Toggle LSP", }, }, dependencies = { { "hrsh7th/cmp-nvim-lsp", event = { "LspAttach", "InsertEnter" }, lazy = true, }, { "antosha417/nvim-lsp-file-operations", event = { "LspAttach" }, dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-tree.lua", }, lazy = true, config = true, }, { "ray-x/lsp_signature.nvim", lazy = true, event = "InsertEnter", }, { "LukasPietzschmann/boo.nvim", lazy = true, event = "LspAttach", opts = { focus_on_open = false }, }, { "zeioth/garbage-day.nvim", dependencies = "neovim/nvim-lspconfig", enabled = function() if vim.fn.has("nvim-0.10.0") == 1 then return true end return false end, event = { "LspAttach" }, opts = { notifications = true, }, }, }, config = function() local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") if not lspconfig_status_ok then print("lspconfig not found!") end local cmp_nvim_lsp_status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") if not cmp_nvim_lsp_status_ok then print("cmp_nvim_lsp not found!") end local lsp_file_operations_status_ok, lsp_file_operations = pcall(require, "lsp-file-operations") if not lsp_file_operations_status_ok then print("lsp_file_operations not found!") end local icons_ok, icons = pcall(require, "NeutronVim.core.icons") if not icons_ok then print("Unable to import icons!") end lsp_file_operations.setup() local on_attach = function(bufnr, client) if client == nil then print("LSP client is nil!") return end local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end local function opts(desc) return { desc = desc, noremap = true, silent = true } end local methods = vim.lsp.protocol.Methods buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") buf_set_keymap("n", "gr", "maybe unrelated but i wanted help with lua_ls: https://new.reddit.com/r/neovim/comments/1debxtc/lua_ls_sweating_up_my_device/
check this too!
while using this keymaps: ```lua -- Move text up and down [in all modes] with `J` and `K` map("n", "J", ":m .+1and yeah pls dont close this for not providing
minimal.lua
because i suck at it 🙏🏻