Skip to content
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

ultisnips not working with the latest neovim nightly #241

Closed
Trid-collab opened this issue Sep 23, 2021 · 11 comments
Closed

ultisnips not working with the latest neovim nightly #241

Trid-collab opened this issue Sep 23, 2021 · 11 comments

Comments

@Trid-collab
Copy link

I have noticed that the Ultisnips options have stopped working with latest neovim nightly release. Have checked that it works with the rolled back stable release.

Is there something we need to do to fix in the new release

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 23, 2021

nvim-cmp has no ultisnips related codes.

@Trid-collab
Copy link
Author

I was using the cmp-nvim-ultisnips to for ultisnips sources. it seems to have stopped providinq ultisnip sources during autocomplete in the latest neovim nightly. It was working in the previous releases and is also working in the stable 0.5 release

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 23, 2021

If your all sources stop working, it is nvim-cmp's problem, I think.
But you say 'cmp-nvim-ultisnips' not working with latest neovim.

@Trid-collab
Copy link
Author

I mean I not sure if its the issue with cmp-nvim-ultisnips but since the ultisnips options are not showing up in the auto complete I am presuming its due to cmp-nvim-ultisnips or something in cmp which has broken due to the latest changes in the neovim nightly. I am no expert on this

@Shougo
Copy link

Shougo commented Sep 23, 2021

I think is should be reported in cmp-nvim-ultisnips issues.
But UltiSnips neovim support is best effort.
It may not be fixed.

@rebelot
Copy link

rebelot commented Sep 23, 2021

I had the same issue, fixed it with the following. I discovered it with :echo &rtp, I don't know enough to understand the problem, but from ultinsnips documentation it looks for directories named UltiSnips in runtimepath. However my start plugins are not present in rtp. Idk if it's an issue and where it comes from

  use {'honza/vim-snippets', rtp = '.'}
  use {'SirVer/ultisnips'}

@Trid-collab
Copy link
Author

Putting the following as suggested - helped to get back the ultisnip options
use {'honza/vim-snippets', rtp = '.'}
use {'SirVer/ultisnips'}

But I also noticed that the I am not able to circulate the snippet placeholders using tabs like it was working before. Its not even working in the neovim stable release. When I am typing in the snippet placeholder the autocompletes are popping up while I am typing. On completion I am not able to use the tabs to move to the next placeholder.

This working earlier before -few days back

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 24, 2021

I think placeholder issue relates your mapping configuration.

@Trid-collab
Copy link
Author

This is my mapping setup. I am sorry I am no expert on this. Just tried to follow some leads which I picked up while going through the configs of others and it worked for me till recently

mapping = {
	["<C-p>"] = cmp.mapping.select_prev_item(),
	["<C-n>"] = cmp.mapping.select_next_item(),
	["<C-d>"] = cmp.mapping.scroll_docs(-4),
	["<C-f>"] = cmp.mapping.scroll_docs(4),
	["<C-Space>"] = cmp.mapping.complete(),
	["<C-e>"] = cmp.mapping.close(),
	["<CR>"] = cmp.mapping.confirm({
		behavior = cmp.ConfirmBehavior.Insert,
		select = true,
	}),
	["<Tab>"] = cmp.mapping(function(fallback)
		if vim.fn.pumvisible() == 1 then
			if vim.fn["UltiSnips#CanExpandSnippet"]() == 1 or vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
				return vim.fn.feedkeys(t("<C-R>=UltiSnips#ExpandSnippetOrJump()<CR>"))
			end

			vim.fn.feedkeys(t("<C-n>"), "n")
		elseif check_back_space() then
			vim.fn.feedkeys(t("<tab>"), "n")
		else
			fallback()
		end
	end, {
		"i",
		"s",
	}),
	["<S-Tab>"] = cmp.mapping(function(fallback)
		if vim.fn.pumvisible() == 1 then
			vim.fn.feedkeys(t("<C-p>"), "n")
		else
			fallback()
		end
	end, {
		"i",
		"s",
	}),
},

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 24, 2021

Your configuration says

  1. If popup menu is visible, check UltiSnips#CanExpandSnippet or UltiSnips#CanJumpForwards
  2. If it returns false, should navigate the next popup menu item.

So I think the problem caused by UltiSnips#CanExpandSnippet or UltiSnips#CanJumpForwards, right?

@hrsh7th
Copy link
Owner

hrsh7th commented Sep 28, 2021

@Trid-collab Do you still have a problem?

@hrsh7th hrsh7th closed this as completed Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants