latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.51k stars 52 forks source link

\begin snippet for environments with arguments #1170

Open frangio opened 1 month ago

frangio commented 1 month ago

The \begin snippet is not ideal for environments with arguments such as array because the tabstop is placed inside the environment after a newline, whereas one would want to fill in the arguments, e.g. \begin{array}{ccc}.

Unsure how this could be addressed. Perhaps the snippet should be \begin{$1}$0\n\\end{$1}, that is without an automatic newline?

clason commented 1 month ago

That would be inconvenient for every other environment. I don't think there's a clear win here.

frangio commented 1 month ago

The other option I can think of is to have two matching snippets so the user can choose, with the default being the current one.