litee-calltree.nvim icon indicating copy to clipboard operation
litee-calltree.nvim copied to clipboard

Lazyvim support?

Open sp71 opened this issue 1 year ago • 3 comments
trafficstars

Does this work with lazyvim? If so, could you provide a snippet how to hook it all up in readme?

sp71 avatar Dec 31 '23 05:12 sp71

I'm using it with lazy.nvim (which seems to be how lazyvim manages its plugins as well). The readme's snippet can be adapted like this:

{
	'ldelossa/litee-calltree.nvim',
	dependencies = 'ldelossa/litee.nvim',
	config = function()
		require('litee.lib').setup({})
		require('litee.calltree').setup({})
	end
}

So that the litee dependency gets pulled in and loaded before calltree.

If you use other litee plugins you could probably invert the dependency order like this:

{
	'ldelossa/litee.nvim'
	dependencies = {
		'ldelossa/litee-calltree.nvim',
		'ldelossa/litee-symboltree.nvim',
		'ldelossa/litee-filetree.nvim',
		'kyazdani42/nvim-web-devicons' -- For filetree.
	}
	config = function()
		require('litee.lib').setup({})
		require('litee.calltree').setup({})
		require('litee.symboltree').setup({})
		require('litee.filetree').setup({})
	end
}

I'm specifically using this in my own config:

{
	'ldelossa/litee-calltree.nvim', -- Call tree / hierarchy UI.
	dependencies = 'ldelossa/litee.nvim',
	config = function()
		require('litee.lib').setup({})
		require('litee.calltree').setup({
			on_open = "popout",
			map_resize_keys = false,
			keymaps = {
				expand = "<Right>",
				collapse = "<Left>"
			},
		})
		vim.keymap.set('n', '<Leader>c', vim.lsp.buf.incoming_calls)
	end
}

And haven't had any issues with it. (But might switch to using the second style mentioned above if I decide to use more than just calltree.)

djdv avatar Jan 01 '24 23:01 djdv

This should 100% be in the readme:

  • lazy config
  • vim.lsp.buf.incoming_calls → Explain if the lsp server support hierarchy tree, this will display the tree.

Zeioth avatar Apr 01 '24 15:04 Zeioth

Open up PRs for README changes, will accept :)

ldelossa avatar Apr 01 '24 15:04 ldelossa