Closed pidgeon777 closed 8 months ago
I've got similar issue with Lsp Len and make it works by pin to the commit
-- disable lsp-inlayhints and lsp lenf if that is nightly version, will remove when 0.10.0 is stable
local is_stable_version = true
if vim.fn.has("nvim-0.10.0") == 1 then
is_stable_version = false
end
return {
{
-- Displaying references and definition infos upon functions
"VidocqH/lsp-lens.nvim",
-- Pin to commit due to some breaking changes
commit = "13d25ad8bd55aa34cc0aa3082e78a4157c401346",
event = "BufRead",
-- Disable lsp lens if that is nightly version
enabled = is_stable_version,
opts = {
enable = true,
},
keys = {
{
-- LspLensToggle
"<leader>uL",
"<cmd>LspLensToggle<CR>",
desc = "LSP Len Toggle",
},
},
}
}
I confirm that with that commit it works, hopefully this will be fixed in the latest master
commit.
@pidgeon777 I'm not experiencing this issue but decided to look into it. Firstly, I installed v0.9.2
and put in the configuration in the original issue comment. I receive this error:
Looking at lsp-lens.nvim/lua/lsp-lens/config.lua
, sections are functions, not booleans, hence the error. If I understand correctly, the configuration in the readme is incorrect and the config in the original issue comment has the same problem. Removing the section
option or changing the values to functions fixes it for me. Idk if this really solves your problem but please sound off and let me know if modifying that config section does anything for you. If not, more information may be useful.
Edit: Right after I wrote this, I removed your config and went back to mine. I tried it with 0.9.2 and am getting the same issue, where lsp-lens doesn't activate, and all the I had an error in my config.LspLens...
functions are unavailable. Looking into it.
@pidgeon777 I'm not experiencing this issue but decided to look into it. Firstly, I installed
v0.9.2
and put in the configuration in the original issue comment. I receive this error:Looking at
lsp-lens.nvim/lua/lsp-lens/config.lua
, sections are functions, not booleans, hence the error. If I understand correctly, the configuration in the readme is incorrect and the config in the original issue comment has the same problem. Removing thesection
option or changing the values to functions fixes it for me. Idk if this really solves your problem but please sound off and let me know if modifying that config section does anything for you. If not, more information may be useful.Edit: ~Right after I wrote this, I removed your config and went back to mine. I tried it with 0.9.2 and am getting the same issue, where lsp-lens doesn't activate, and all the
LspLens...
functions are unavailable. Looking into it.~ I had an error in my config.
Sorry for the late reply. It should be fixed now.
It should be fixed now.
Thanks. It works for me.
bro still doesnt work for me, i installed it and tried it first in the lua
language, mostly my nvim's config
lsp_lens is on LspLensOn
i also tried pinning to commit 13d25ad8bd55aa34cc0aa3082e78a4157c401346
bro still doesnt work for me, i installed it and tried it first in the
lua
language, mostly my nvim's configlsp_lens is on
LspLensOn
i also tried pinning to commit
13d25ad8bd55aa34cc0aa3082e78a4157c401346
Can you try define a non-anonymous function?
function hello()
print("Hello, World")
end
function hello() print("Hello, World") end
still doesnt work, LspLensOn
is enabled
i forgot this earlier, this is my config:
return {
"VidocqH/lsp-lens.nvim",
lazy = true,
event = "LspAttach",
opts = {
enable = true,
commit = "13d25ad8bd55aa34cc0aa3082e78a4157c401346",
include_declaration = true,
sections = {
definitions = true,
},
},
}
also tried moving opts
inside require("lsp-lens").setup({...})
Firstly, "definitions" should be singular , and you may need to wrap the entire plugin in curly braces because plugin defs for Lazy should be a table of tables, I think. I'll test this when I'm available and debug it. I don't believe this is related to this issue, though, because this seems like a configuration error at first glance.
Edit: Your config works for me on nightly, both with and without the commit spec. This seems like a configuration issue, maybe someplace else an issue with something other than what this issue deals with.
thanks but i got it to work, even without pinning it to a commit:
I confirm the latest commit fixed the issue. This can be closed if needed.
I'm testing the plugin with a
C
source code withclangd
enabled.Nohing changes when
LspLensOn
is executed.My
Lazy
config:clangd
LSP is working as expected, though.Also I tried with other filetypes, nothing happens.
Neovim version:
v0.9.2