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

No snippets like coc-python #410

Closed
ilkl opened this issue Mar 26, 2021 · 11 comments
Closed

No snippets like coc-python #410

ilkl opened this issue Mar 26, 2021 · 11 comments
Assignees

Comments

@ilkl
Copy link

ilkl commented Mar 26, 2021

There are no snippets like coc-python, except for keywords.

@fannheyward
Copy link
Owner

fannheyward commented Mar 26, 2021

The vscode-python has already removed the snippets feature, microsoft/vscode-python#15006, check microsoft/pylance-release#629 microsoft/python-language-server#2011 microsoft/vscode-python#14566 and microsoft/vscode-python#15220.

The reason is LS already has provided intelligent code completions, snippets may add conflicts.

I'll leave this issue open for a while, waiting for more feedbacks.

@lodagro
Copy link

lodagro commented Mar 30, 2021

Can ultisnips be used tother with coc-pyright?
Tried it, but no completions on the snippets unfortunately.

@fannheyward
Copy link
Owner

I'm using coc-snippets with honza/vim-snippets, works as expected.

@lodagro
Copy link

lodagro commented Mar 30, 2021

Do you get the snippet previews in the completion overview?
I have to manually trigger snippet list, the snippets do not show up in the coc* completion.
In coc settings: "pyright.completion.snippetSupport": true.

Besides the completion&preview ultisnips+vim-snippets is working fine.

@fannheyward
Copy link
Owner

@lodagro yes, snippet preview is working, the snippet item will be labeled [S].

截屏2021-03-30 17 30 15

@lodagro
Copy link

lodagro commented Mar 30, 2021

Do i need to configure anything else besides "pyright.completion.snippetSupport": true to get this?

@fannheyward
Copy link
Owner

@lodagro No, maybe you need to use coc-snippets.

@lodagro
Copy link

lodagro commented Mar 30, 2021

I removed coc-snippets and switched from coc-python to coc-pyright at the same time. After this i no longer have the snippet completion and i was thinking this was due to coc-pyright. But it is probably because i removed coc-snippets. I do want to use ultisnips to process the vim-snippets instead of coc-snippets since coc-snippets is not supporting all ultisnips features (see also https://github.com/neoclide/coc-snippets#ultisnips-features).

@fannheyward
Copy link
Owner

@lodagro I see. I don't know how to make ultisnips work with coc completions.

@lodagro
Copy link

lodagro commented Mar 30, 2021

Found a solution, i installed coc-ultisnips. The snippets are now in the completion list (without preview unfortunately) and are handled by ultisnips. Hard to get an overview for all these coc-nvim plugins.

See also https://github.com/neoclide/coc-sources

@fannheyward
Copy link
Owner

I'll close this issue, and will not port snippets from vscode-python/coc-python. If you want to use snippets, use coc-snippets.

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

3 participants