texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

Some cwl file entries ignored #1813

Closed zoof closed 2 years ago

zoof commented 2 years ago

The latex-document.cwl file compiled into TeXstudio includes commands \bigskip, \medskip and \smallskip but on my Debian 11 system with TeXstudio 4.0.1, none of these show up as autocomplete options despite latex-document.cwl being selected.

I have noticed this on prior versions of TeXstudio as well but now only after looking at the source cwl files have I noticed that these commands are included but don't work.

zoof commented 2 years ago

Same appears to be true for the multline environment from the amsmath.cwl file.

mbertucci47 commented 2 years ago

In the current setup \bigskip, \medskip, and \smallskip are in tex.cwl, and they have the classifier #* which means they only show in the "All" tab of the completer. You can change the default of Preferred Command Set from "Typical" to "All" in the Completion section of the options in Configure TeXstudio.

On the other hand \begin{multline} is not classified with #* so it should be showing up by default.

zoof commented 2 years ago

Actually, in latex-document.cwl, it is not classified with #*:

\bigg[%|\bigg]#mM
\bigg|%|\bigg|#mM
\bigskip
\boldmath
\botfigrule#*

while in tex.cwl it is:

\bgroup..\egroup#*
\bigbreak#*
\bigskip#*
\bigskipamount#*
\bordermatrix#*

It also appears that \begin{multline} is classified as #\math:

\begin{gathered}[alignment]#\math
\begin{matrix}#m\array
\begin{multline}#\math
\begin{multline*}#\math
\begin{pmatrix}#m\array
\begin{smallmatrix}#m\array

so selecting "all" should work, and it does once I did.

zoof commented 2 years ago

Looks like there is a conflict and \bigskip needs to be removed from ams-document.cwl.

mbertucci47 commented 2 years ago

Check the most recent version of latex-document.cwl. Those skip commands are defined in just tex so they must have been removed from latex-document.cwl since your last update. Try downloading the most recent version (which is 4.0.0 as far as I know).

The #\math classification just means to treat its contents as in math mode. \begin{multline} is showing up fine in the completer on my end.

zoof commented 2 years ago

Ah, I must have downloaded an old version of the source code where \bigskip was still in latex-document.cwl.