nix-community / kickstart-nix.nvim

❄️ A dead simple Nix flake template repository for Neovim derivations [maintainer=@mrcjkb]
GNU General Public License v2.0
231 stars 10 forks source link

Error message when opening a .nix file then a .lua file #33

Closed Eddio0141 closed 3 months ago

Eddio0141 commented 3 months ago

The error I get is method textDocument/codeLens is not supported by any of the servers registered for the current buffer. This error pops up on anything I do, writing, escaping to normal mode, etc.

How to do:

  1. Open some nix file
  2. Open some lua file in the same session (you can use :e whatever.lua or :Explore, doesn't matter)
  3. Try do anything in the lua file, :w can cause the error
mrcjkb commented 3 months ago

Hey 👋

I haven't encountered this with the default setup. Is this with nixd instead of nil?

It sounds like the nixd client (which I guess supports code lenses) is somehow attaching to the Lua buffer, which leads to this autocommand being created.

Eddio0141 commented 3 months ago

Hiya This is with the default template unmodified, I directly run nix run "github:nix-community/kickstart-nix.nvim" to open some nix file, and then a lua file which causes the error for me

A short clip here goes through exactly what I'm doing

https://github.com/user-attachments/assets/b5ac8a06-47b0-4b71-a100-6d670221ebf9

jirafey commented 3 months ago

I am facing the same issue when running the flake with nix run "github:nix-community/kickstart-nix.nvim" open nix/neovim-overlay.nix :e ../kickstart-nix.nvim/nvim/lua/user/lsp.lua delete a line of code make the code look like this for example:

---@mod user.lsp
---@brief [[
---LSP related functions
---@brief ]]

---Gets a 'ClientCapabilities' object, describing the LSP client capabilities
---Extends the object with capabilities provided by plugins.
---@return lsp.ClientCapabilities
  local capabilities = vim.lsp.protocol.make_client_capabilities()
  -- Add com_nvim_lsp capabilities
  local cmp_lsp = require('cmp_nvim_lsp')
  local cmp_lsp_capabilities = cmp_lsp.default_capabilities()
  capabilities = vim.tbl_deep_extend('keep', capabilities, cmp_lsp_capabilities)
  -- Add any additional plugin capabilities here.
  -- Make sure to follow the instructions provided in the plugin's docs.
  return capabilities
end

return M

image

mrcjkb commented 3 months ago

:thinking: just pulled the latest changes and can reproduce. ~It looks like lua-language-server is erroneously reporting that it supports code lenses to the client.~

mrcjkb commented 3 months ago

Fixed: https://github.com/nix-community/kickstart-nix.nvim/commit/2181d879ce041411f8b8c36c5d6160928631ba85