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

Autocomplete for '\begin{}' inserts a double closing '}' #2075

Closed
albanleandri opened this issue May 9, 2020 · 5 comments · Fixed by #2080
Closed

Autocomplete for '\begin{}' inserts a double closing '}' #2075

albanleandri opened this issue May 9, 2020 · 5 comments · Fixed by #2080
Assignees
Labels
enhancement Issue suggests an enhancement

Comments

@albanleandri
Copy link

albanleandri commented May 9, 2020

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Describe the bug [Required]

Invalid syntax from autocomplete for \begin{itemize} or \begin{enumerate} causing compilation error.

To Reproduce

When typing:
\begin{i}
The suggestions for autocomplete will appear.
In this case, the relevant suggestion will be:
\begin{itemize}
If I proceed with this suggestion then I will have what follows:

\begin{itemize}
    \item 
\end{itemize}}

As you can see, the ending command contains an additional closing curly brace.
It's wrong and will cause a compilation error if not removed (manually).

Expected behavior

I want the autocomplite to lead to what's below:

\begin{itemize}
    \item 
\end{itemize}

Logs [Required]

Please paste the whole log messages here, not parts of ones. It is very important to identify problems.

LaTeX Workshop Output [Required]

To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.

[Paste the log here]

Developer Tools Console [Required]

To access the log, click 'help' -> 'Toggle Developer Tools. Paste anything suspicious.

[Paste the log here]

Screenshots

If applicable, add screenshots to help explain your problem.

image

image

Desktop [Required]

  • OS: Windows 10
  • VS Code version: [e.g. 1.45.0]
  • Extension version: [e.g. 8.9.0]
  • TeX distribution version: [e.g. TeX Live 2020]

Additional questions

Are you using LaTeX Workshop with VS Code Remote?

Yes, I am using LaTeX Workshop

@jlelong
Copy link
Collaborator

jlelong commented May 9, 2020

You should not write the closing } of \begin your self.

May-09-2020 15-52-06

@albanleandri
Copy link
Author

@jlelong actually, I don't, it's auto closing.
Is it a VSC setting I can change?

@jlelong
Copy link
Collaborator

jlelong commented May 9, 2020

OK I understand. I only type \beg and hit TAB to complete. Doing so I only get \begin{. I agree with you that when typing \begin{ you automatically get the closing }.

I will investigate if I can remove the extra } on the fly if it has already been inserted.

@c-harding
Copy link

@jlelong jlelong self-assigned this May 12, 2020
@jlelong jlelong changed the title autocomplete suggestion for \begin{enumerate} or \begin{itemize} leads to erroneous code autocomplete for '\begin{}' inserts a double closing '}' May 12, 2020
@jlelong jlelong changed the title autocomplete for '\begin{}' inserts a double closing '}' Autocomplete for '\begin{}' inserts a double closing '}' May 12, 2020
@jlelong
Copy link
Collaborator

jlelong commented May 12, 2020

I think this is solved by #2080
Could you test this branch to make sure it does not have side effects?

@tamuratak tamuratak pinned this issue May 28, 2020
@tamuratak tamuratak unpinned this issue Jun 6, 2020
Repository owner locked as resolved and limited conversation to collaborators Aug 27, 2020
@tamuratak tamuratak added the enhancement Issue suggests an enhancement label Sep 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Issue suggests an enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants