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

Regression: nested snippet expansion breaks initial snippet placeholder navigation #1562

Closed
oblitum opened this issue Feb 19, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@oblitum
Copy link
Member

oblitum commented Feb 19, 2020

Result from CocInfo

versions

vim version: NVIM v0.4.3
node version: v13.8.0
coc.nvim version: 0.0.74-d57f450e8d
term: tmux-256color
platform: linux

Messages

Output channel: clangd trace

I[00:43:49.836] clangd version 9.0.1
I[00:43:49.836] Working directory: /home/francisco/Projects/samples/c++
I[00:43:49.836] argv[0]: /usr/bin/clangd
I[00:43:49.836] Starting LSP over stdin/stdout
I[00:43:49.837] <-- initialize(0)
I[00:43:49.837] --> reply:initialize(0) 0 ms
I[00:43:49.840] <-- initialized
I[00:43:49.840] unhandled notification initialized
I[00:43:49.841] <-- textDocument/didOpen
I[00:43:49.841] Enqueueing 0 commands for indexing
I[00:43:49.841] --> textDocument/clangd.fileStatus
I[00:43:49.841] Updating file /home/francisco/Projects/samples/c++/sample.cpp with command
[/home/francisco/Projects/samples/c++]
/usr/bin/clang-tool -Wall -Wextra -pedantic -std=c++17 -stdlib=libc++ -I/opt/src/GSL/include -I/opt/src/range-v3/include /home/francisco/Projects/samples/c++/sample.cpp -fsyntax-only -resource-dir=/usr/lib/clang/9.0.1
I[00:43:49.853] --> textDocument/publishDiagnostics
I[00:43:49.853] --> textDocument/clangd.fileStatus

Output channel: git

Looking for git in: git

git rev-parse --show-toplevel
resolved root: /home/francisco
git ls-files -- Projects/samples/c++/sample.cpp
resolved root: /home/francisco
git symbolic-ref --short HEAD
git diff --name-status
git diff --staged --name-status
git ls-files --others --exclude-standard

Output channel: prettier

Output channel: snippets

Describe the bug

A clear and concise description of what the bug is.

This was implemented on #156, but have stopped working lately, it's not possible to jump placeholder when there's nested snippet expansion involved. This provides a bad experience as the user is forced to patch snippet code and remove placeholders manually.

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't
reproduce it

  • Create file mini.vim with:

    let g:coc_global_extensions = ['coc-clangd']
    set runtimepath^=~/.vim/plugged/coc.nvim
  • touch compile_flags.txt

  • Start (neo)vim with command: nvim -u mini.vim sample.cpp

  • Set content according to gif.

  • Try to switch to next placeholder of outer snippet after finishing filling inner snippet.

Screenshots (optional)

If applicable, add screenshots to help explain your problem.

screencast

@oblitum
Copy link
Member Author

oblitum commented Feb 19, 2020

Former commit fix was b1ad247.

@jackielii
Copy link
Contributor

@oblitum can you try pr #1620 I suspect it'll fix this problem as well

@oblitum
Copy link
Member Author

oblitum commented Mar 7, 2020

@jackielii I tried. It does not fix this. Also, it causes more issues, it doesn't jump correctly after the second snippet is expanded.

@chemzqm
Copy link
Member

chemzqm commented Mar 9, 2020

Hm, it doesn't work sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants