-
-
Notifications
You must be signed in to change notification settings - Fork 21
Duplicate code-lenses #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi 👋 Thanks for the nice words 😄 I think what you're seeing are code lenses, not inlay hints. Afaik, I'm not sure why you're seeing them twice, but you can disable vim.g.haskell_tools = {
tools = {
codeLens = {
autoRefresh = false,
},
},
} |
Hello. For me it is good enough and as such I am once again want to thank you for your hard work. |
Hmm, it sounds like it may be conflicting with another plugin. Which plugins do you have installed? |
Or another question: Do the duplicate code lenses disappear when the inlay hints plugin is disabled? |
Hallo again @mrcjkb For the first question I have a few plugins installed the one that I think might be the conflicting one is the (lvimuser/lsp-inlayhints.nvim). For the others I'd have to do some detective work (please tell me what I should search for If so required). (here is my config assuming you'd need it.) As always thank you very much for your help. <3 Please tell me if I can help with anything. |
I tried to reproduce it using a minimal config based on yours (see README.md#troubleshooting), but couldn't. The minimal config-- Minimal nvim config with lazy.nvim
-- Assumes a directory in $NVIM_DATA_MINIMAL
-- Start with
--
-- export NVIM_DATA_MINIMAL=$(mktemp -d)
-- export NVIM_APP_NAME="nvim-ht-minimal"
-- nvim -u minimal.lua
--
-- Then exit out of neovim and start again.
-- Ignore default config
local config_path = vim.fn.stdpath('config')
vim.opt.rtp:remove(config_path)
-- Ignore default plugins
local data_path = vim.fn.stdpath('data')
local pack_path = data_path .. '/site'
vim.opt.packpath:remove(pack_path)
-- bootstrap lazy.nvim
data_path = assert(os.getenv('NVIM_DATA_MINIMAL'), '$NVIM_DATA_MINIMAL environment variable not set!')
local lazypath = data_path .. '/lazy/lazy.nvim'
local uv = vim.uv
---@diagnostic disable-next-line: deprecated
or vim.loop
if not uv.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'[email protected]:folke/lazy.nvim.git',
'--branch=stable',
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
local lazy = require('lazy')
lazy.setup({
{
'mrcjkb/haskell-tools.nvim',
branch = '2.x.x',
dependencies = {
'nvim-lua/plenary.nvim',
-- Uncomment or add any optional dependencies needed to reproduce the issue
-- 'nvim-telescope/telescope.nvim',
-- 'akinsho/toggleterm.nvim',
},
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' },
},
{
"lvimuser/lsp-inlayhints.nvim",
event = { "BufReadPost", "BufNewFile" },
opts = function()
vim.api.nvim_set_hl(0, "LspInlayHintCustom", { link = "Comment" })
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
vim.api.nvim_create_autocmd("LspAttach", {
group = "LspAttach_inlayhints",
callback = function(args)
if not (args.data and args.data.client_id) then
return
end
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
require("lsp-inlayhints").on_attach(client, bufnr)
end,
})
return {
inlay_hints = {
parameter_hints = {
show = true,
prefix = "<- ",
separator = ", ",
remove_colon_start = true,
remove_colon_end = true,
},
type_hints = {
-- type and other hints
show = true,
prefix = "=> ",
separator = ", ",
remove_colon_start = true,
remove_colon_end = false,
},
-- highlight group
highlight = "LspInlayHintCustom",
},
debug_mode = true,
}
end,
},
-- Add any other plugins needed to reproduce the issue.
-- see https://github.com/folke/lazy.nvim#-lazynvim for details.
}, { root = data_path, state = data_path .. '/lazy-state.json', lockfile = data_path .. '/lazy-lock.json' }) I also noticed you have the following in your config: vim.g.haskell_tools = {
hls = {
tools = {
inlay_hints = { auto = true },
},
capabilities = require("cmp_nvim_lsp").default_capabilities(),
},
} There's no |
First sorry for the old config state. (I have already removed it locally, but forgot to update it online...) Secondly I think we can simple close this issue... I am probably the only one who has this issue given my weird setup and I am fine with your solution above to just deactivate the autoreload for the codeLens. Either way I once again want to thank you for all your effort in both my issue and also the general plugin. |
Alright, I'll close this for now 😄 By the way, it looks like inlay hints will be supported natively in neovim 0.10: neovim/neovim#23984 |
I'm using the Had to disable the line |
@miguelbarao that's very strange. |
Sorry, I jumped to conclusions too fast. It seems to be some race condition, some times it shows duplicates, some times it doesn't, and coincided with commenting that line. I'm lost here. |
I recommend you follow the troubleshooting guide in the readme. |
Feature description
Thanks
fyi I am using 2.x.x
The text was updated successfully, but these errors were encountered: