Save this as subcaptionTemp.cwl
in ~/.config/texstudio/
or %APPDATA%\texstudio\
!
# manipulated the auto-generated subcaption.cwl for Holt
# subcaption package
# Axel Sommerfeldt 04/16/2013
# URL: http://mirror.switch.ch/ftp/mirror/tex/help/Catalogue/entries/subcaption.html
#include:caption
#
#
# Chapter 1 Loading the package
#
#
\captionsetup[sub]{%<options%>}
#keyvals:\captionsetup
margin=%<num%>pt
margin={%<left amount%>,%<right amount%>}
margin*=%<num%>pt
margin*={%<left amount%>,%<right amount%>}
font=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
font+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
font={%<option 1%>,%<option 2%>}
labelfont=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
labelfont+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
labelfont={%<option 1%>,%<option 2%>}
textfont=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
textfont+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
textfont={%<option 1%>,%<option 2%>}
labelformat=#default,empty,parens,simple,brace
labelsep=#none,period,space,quad,colon,newline,endash
skip=%<num%>pt
list=#false,true,no
hypcap=#false,true
indention=%<amount%>pt
position=#auto,top,above,bottom,below
#endkeyvals
#
#
# Chapter 2 The \subcaption command
#
#
\subcaption{heading}#/minipage
\subcaption[list entry]{heading}#/minipage
\subcaption*{heading}#/minipage
\setcaptionsubtype#S
\setcaptionsubtype*#S
#
#
# Chapter 3 The subfigure & subtable environments
#
#
\begin{subfigure}{width}
# pos can be b (default: )
\begin{subfigure}[pos]{width}
\begin{subtable}{width}
\begin{subtable}[pos]{width}
\end{subfigure}
\end{subtable}
\captin@For{subtyelist}#S
#
#
# Chapter 4 The \subcaptionbox command
#
#
# inner-pos can be c, l, r, s (default: c)
\subcaptionbox[list entry]{heading}[width][inner-pos]{contents}
\subcaptionbox[list entry]{heading}[width]{contents}
\subcaptionbox[list entry]{heading}{contents}
\subcaptionbox{heading}[width][inner-pos]{contents}
\subcaptionbox{heading}[width]{contents}
\subcaptionbox{heading}{contents}
\subcaptionbox*{heading}[width][inner-pos]{contents}
\subcaptionbox*{heading}[width]{contents}
\subcaptionbox*{heading}{contents}
#
#
# Chapter 5 The \DeclareCaptionSubType command
#
#
# numbering-pos can be arabic, roman, Roman, alph, Alph, fnsymbol... (defaul: alph)
\DeclareCaptionSubType[numbering scheme]{float type}#*d
\DeclareCaptionSubType{float type}#*d
\DeclareCaptionSubType*[numbering scheme]{float type}#*d
\DeclareCaptionSubType{float type}#*d
#
#
# Chapter 6 References
#
#
\thesubfigure#S
\thesubtable#S
\p@subfigure#S
\p@subtable#S
\subref{key}#*r
\subref*{key}#*r
#keyvals:\captionsetup
subrefformat=#parens
#endkeyvals
\phantomsubcaption
# other commands
\subfigureautorefname#S
\subfigurename#S
\subtableautorefname#S
\subtablename#S
\theHsubfigure#S
\theHsubtable#S
Then go to your preferences and load this file:

I would be happy for any feedback. If this works nicely for you, I will submit it to the maintainers of TXS.
Best Answer
Actually, it's not you who is missing something, but the Custom Highlighting. It's an unfinished feature. See the FAQ for what it can(not) do.
If it's just about telling the syntax checker, you should use a custom cwl file. Note, that TXS autogenerates a cwl file by inspecting the package. But this mechanism is not perfect due to the complexity of LaTeX. Therefore it may not find all specified commands. You are welcome to take this cwl as a starting point, add the missing commands and provide it to us, so we can include it in TXS.
For instance, to tell the syntax checker and completer that there is the
compactenum
environment, just add the following line to your custom cwl file: