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.69k stars 344 forks source link

keyvals with spaces in "val" part marked incorrect #2377

Open mbertucci47 opened 2 years ago

mbertucci47 commented 2 years ago

Environment

Expected behavior

For keyvals with cwl listing of the form key=#val1,val2,..., the completer recognizes values with spaces, but when actually filled in they're marked as incorrect. For the cwl

# mypackage.cwl
\foo{keyvals}
#keyvals:\foo
key=#val,my val,anotherval,yet another val
#endkeyvals

the completer works fine:

iss1

Actual behavior

When filled in, the values with spaces are marked as incorrect:

iss2

Here's the listing for the last picture:

\documentclass{article}
\usepackage{mypackage}

\begin{document}
\foo{key=val}
\foo{key=my val}
\foo{key=anotherval}
\foo{key=yet another val}
\end{document}

I'll note this comes up in many places, e.g. the numbered key in thmtools:

iss3
sunderme commented 2 years ago

what is the real scenario, where this plays a role ?

mbertucci47 commented 2 years ago

Defining keyvals like this only seems to come up in tikz/pgfkeys packages, in which case the cwl listing usually has a #c anyways. I suppose this should be a FR or enhancement rather than a bug report.