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

Zz/bringmybracketback #855

Closed
wants to merge 3 commits into from

Conversation

innerlee
Copy link
Contributor

@innerlee innerlee commented Oct 8, 2018

Fix #854
Also re-fix #609

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

This breaks snippet nesting, which was the main issue about snippets and using ${1}.

Without your PR: \(@a\) expands to \(\alpha\).
With it: \(@a\) does not expand. TAB just jumps out of the \(...\).

@tecosaur
Copy link
Contributor

tecosaur commented Oct 8, 2018

Do you know if there might be any way to force vs code to expand a snippet if it can, then only if it can't move on to the next $ region.

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

Indeed, I have searched a lot for this and never found anything interesting. So I guess it a no.

@innerlee
Copy link
Contributor Author

innerlee commented Oct 8, 2018

I do not understand the concept of nesting.

For the link #609 (comment), we can auto complete brackets in math mode with this pr, so no need to type __<tab>-like things.

For the @a example, I cannot make it work on my machine. Do I need to turn on any option to get the @something nesting?

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

There is a weird play between snippets starting in \ and others (especially those starting in @).

Hitting TAB on @a leads to \alpha, even though the menu completion may not show up, see the end of #669. With your PR, this is not possible inside \(...\).

@innerlee
Copy link
Contributor Author

innerlee commented Oct 8, 2018

Cannot get it working with the version on marketplace

abc

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

Have checked that you have "editor.tabCompletion": true?

@innerlee
Copy link
Contributor Author

innerlee commented Oct 8, 2018

Both true or false do not work.
latexworkshop version 5.11.1
vscode version 1.27.2
win10

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

Have you tried playing a bit with "editor.wordBasedSuggestions": false/true and "editor.quickSuggestions": false/true?
A few people have already reported this but we have never managed to understand what was happening. Maybe this time...

@Astrantia
Copy link
Contributor

Astrantia commented Oct 8, 2018

@jlelong i'll jump in. having both quicksuggestions and wordBasedSuggestions set to true, I still don't get any suggestions when I type @ . I do get a suggestion when I type @a, but no suggestions for @%, no suggestions for @8, etc...

@innerlee
Copy link
Contributor Author

innerlee commented Oct 8, 2018

Tried the 8 combinations, none works. Maybe conflict with some other extensions?

btw, this is not a judgement or anything, and I appreciate the typing habits from other software.
But by suggesting completion items (suggest \alpha when typing \a) as in https://code.visualstudio.com/updates/v1_25#_suggestion-selections, we can provide a more natural experience to autocomplete \alpha, without typing the @ symbol.
So I would like to suggest remove the @thing feature.

@Astrantia
Copy link
Contributor

@innerlee I wouldn't agree. I like @ more. Those who use latex frequently will easily familiarize themselves with @ and the convenience it provides vs \ is big, because \ is already overpopulated with suggestions

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

As @Astrantia pointed out, the completion list for \a is so huge, \alpha is only on 18th position and you have to type \al to have it on the first completion screen. The @ snippets are designed such that two prefixes cannot start with a common substring. Moreover, \ requires more keystrokes (3 on my layout) than @ on many keyboard layouts.

@Astrantia
Copy link
Contributor

Astrantia commented Oct 8, 2018

@jlelong Why does this happen though?
gif

@jlelong
Copy link
Collaborator

jlelong commented Oct 8, 2018

This is related to vscode#35651
Intellisense does not take into account non alphabetical characters, hence the long list you get. But, no matter the list, the snippet you expect is always the first one!

@Astrantia
Copy link
Contributor

Astrantia commented Oct 8, 2018

@jlelong You misunderstood the point of the gif. I expect to get suggestions for @8, @/, @% as they are also defined, but im only getting suggestions for @alphabet chars

@Astrantia
Copy link
Contributor

@Astrantia
Copy link
Contributor

Update: I had to set "editor.tabCompletion": "onlySnippets" for @% + Tab to expand the snippet. I still don't get suggestion pop-up, but tabbing works now.

@innerlee
Copy link
Contributor Author

innerlee commented Oct 8, 2018

okay, I will wait for microsoft/vscode#45385

@innerlee innerlee closed this Oct 8, 2018
@innerlee
Copy link
Contributor Author

innerlee commented Oct 9, 2018

For anyone interested, here is a extension file with this pr merged. https://github.com/innerlee/LaTeX-Workshop/releases/tag/v5.11.1

@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We can no longer tab out \( \) Feature Request: Auto-Brackets in math-mode
4 participants