jlelong / vscode-latex-basics

LaTeX grammars for Visual Studio Code
MIT License
19 stars 10 forks source link

autoClosingPairs #3

Closed jlelong closed 2 years ago

jlelong commented 2 years ago

This is a follow-up on https://github.com/James-Yu/LaTeX-Workshop/issues/2731#issuecomment-984058899

@tamuratak We should discuss the autoClosingPairs setting for the -language-configuration.json files. Consider the case of \let(, there are 3 possibilities

  1. ["\\left(", ""],: \left( is inserted on its own
  2. ["\\left(", "\\right)"],: \left( is automatically closed by \right) when editor.autoClosingBrackets is set to languageDefined
  3. No entry: \left( is automatically completed by ) before a white space except when editor.autoClosingBrackets is set to never

@aeschli @alexr00 do you have any opinion ?

alexr00 commented 2 years ago

@jlelong I am not a frequent LaTeX user; however, it looks like option 2 is probably what most people want most of the time. I took a look through all the autoClosingPairs we have in VS Code, and this proposal doesn't seem unreasonable based on what we already have.

This seems most similar to html tags to me. While they aren't listed in autoClosingPairs, html tags also automatically close in VS Code.