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

Add $1 to jump out of snippets? #1059

Closed
Astrantia opened this issue Dec 11, 2018 · 8 comments
Closed

Add $1 to jump out of snippets? #1059

Astrantia opened this issue Dec 11, 2018 · 8 comments
Labels
snippets Issue is related to snippets

Comments

@Astrantia
Copy link
Contributor

Astrantia commented Dec 11, 2018

https://github.com/James-Yu/LaTeX-Workshop/blob/master/snippets/latex.json#L475

In many of current snippets it is impossible to jump to the next scope once you've triggered the snippet. For example ( snippet expands to ( … ), but once you are done with typing … you want to move on by leaving (). I've observed this to be the case with many other snippets. Thoughts about reworking it?

@jlelong @tecosaur

@jlelong
Copy link
Collaborator

jlelong commented Dec 11, 2018

See the discussion in 609. The problem basically comes from the ability to nest snippets.

@Astrantia
Copy link
Contributor Author

@jlelong So what was the final decision regarding this? Leaving it up to vscode? Also the issue referenced to vscode is about adding priorities to snippets. So if I understand correctly to have all issues with snippets will be gone when vscode adds priorities to snippets?

@jlelong
Copy link
Collaborator

jlelong commented Dec 12, 2018

@Astrantia there is currently an issue with some snippets and I cannot figure out why it is not working. I have posted an issue on vscode repo. Hopefully, I will get some insights there and then return to our issue.

@Astrantia
Copy link
Contributor Author

Astrantia commented Dec 12, 2018

@jlelong I think we found a solution in your issue. We need to add wordpattern regex in syntax.json and this should be hopefully fixed.

@jlelong
Copy link
Collaborator

jlelong commented Dec 12, 2018

I have been playing a bit with the wordPattern regex and it does indeed solve our issue. Once this is done, I add back the jump out of snippets feature. I will do some further tests before pushing a fix.

jlelong added a commit that referenced this issue Dec 12, 2018
This is a regex to determine what a word is for the LaTeX language. This
is used by vscode to trigger intellisense.
See https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributeslanguages

This finally fixes #609 #669 801 #837 #857 #883 #1059 and possible
others.
@jlelong
Copy link
Collaborator

jlelong commented Dec 12, 2018

To have intellisense automatically triggered inside snippets, set "editor.suggest.snippetsPreventQuickSuggestions": false.

@jlelong jlelong added the snippets Issue is related to snippets label Dec 12, 2018
@duhd1993
Copy link

Is this feature implemented? seems not working for me.

@jlelong
Copy link
Collaborator

jlelong commented Mar 18, 2019

Yes. For which snippets, is not working?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
snippets Issue is related to snippets
Projects
None yet
Development

No branches or pull requests

3 participants