because of some ugly corporate design I needed to create the following figure environment/design with the caption on the right side.
Problem is, that I don't get suggestions from the label inside the
\figthree{sample.jpg}{caption}{fig:label}
command.
\newcommand{\figthree}[3]{\begin{figure}
[!h]%\makebox[131.8mm+4.32cm][l]{
\raggedright
\begin{minipage}[t]{131.8mm}% \input{#1}
\vspace*{0pt}
\includegraphics[width=\linewidth]{#1}
\end{minipage}
% \hspace*{2mm}
\begin{minipage}[t]{42mm}
\vspace{-\ht\strutbox}%
\captionof{figure}{#2}\label{#3}%
\end{minipage}%}
\end{figure}}

\figthreecommand and understand that its third argument is a label. A hack that could work is to add\iffalse\label{fig:label}\fi. It wouldn't be seen by TeX but TeXStudio might see it... – Phelype Oleinik Aug 10 '18 at 14:33\figthree. Maybe something like\figthree{imagefile}{caption%text}{label}#lshould work. – Troy Aug 10 '18 at 14:38\figthree? The OP is looking for a solution that adds the label to the list of known label keys you get when you write\ref– daleif Aug 10 '18 at 14:48\figthreeto the list of labels recognized by TXS. That's the point of the#lclassifier. Hence, the label will be presented as an option for autocompletion when using\ref. – Troy Aug 10 '18 at 14:50