vs.language.cmake
vs.language.cmake copied to clipboard
Syntax highlighting of variables is insufficient
CMake is pretty generous when it comes to allowed variable name characters. The cmake-language(7) at point Variable References states the following:
Literal variable references may consist of alphanumeric characters, the characters
/_.+-
, and Escape Sequences. Nested references may be used to evaluate variables of any name. See also policyCMP0053
documentation for historical considerations and reasons why the$
is also technically permitted but is discouraged.
Whereas the file syntaxes/CMake.tmLanguage
contains the following entry:
<dict>
<key>match</key>
<string>\$\{\w+\}</string>
<key>name</key>
<string>storage.source.cmake</string>
</dict>
and it seems too narrow.
In practice, ${IS_GCC_AT_LEAST_9.1}
is a valid variable in CMake, however, the syntax highlighting doesn't think so.