LaTeX-Workshop: Automatically trigger auto-completion inside a snippet
Description
I found this bug with \ref and it’s autocompletion for the labels. It could also apply to cite, didn’t tested it with cite. Just a quick gif to visualize as it might be easier to understand with the help of the gif:

The basic problem is if I use the autocompletion on the \ref command the label suggestions is not working after it. But if I type it out myself without using the autocompletion function then the label suggestion works. Furthermore, if I use the autocompletion but move the cursor outside of the autocompleted text, the autocompletion starts to work again.
Log messages
Log messages didn’t log anything.
How to reproduce
- Start typing
\refand use the suggestionreffor completion. - Suggestion for labels is not working
- Moving outside of the text from autocompletion, suggestions for labels start work again.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 15
Commits related to this issue
- Add more cite/ref snippets parencite, textcite, cref, cpageref It fixes the textcite issue mentionned in #744. — committed to James-Yu/LaTeX-Workshop by jlelong 6 years ago
- Automatically trigger completion for some discovered commands While processing a file for discovering already used commands in order to turn them into snippets, we may add a post action to automatica... — committed to James-Yu/LaTeX-Workshop by jlelong 6 years ago
- Automatically trigger intellisense after cite and ref commands This is related to #744 and 25db12c9 and had been partly broken since we added the new intellisense mechanism based on used packages (se... — committed to James-Yu/LaTeX-Workshop by jlelong 6 years ago
@werunom, the extension parses your tex file for listing all/some macros and then creates suggestions of the form
macro{arg}. This is what was happening with\textcite.@ahelm, the problem is that the first autocompletion (the one inserting
\ref{}) should automatically trigger a second one to insert the label. I will investigate this. Meanwhile, while inside the{}, you can manually trigger autocompletion (ctrl-space) and this works as expected.@werunom, I cannot find
\textcitein the snippets defined by the extension. Could it be that you defined it yourself. In this case, you can define it as\texticte{$0}instead of\textcite{${1:arg}}. See my comment to @ahelm just above.