vs.language.cmake icon indicating copy to clipboard operation
vs.language.cmake copied to clipboard

Syntax highlighting of variables is insufficient

Open adambadura opened this issue 2 years ago • 0 comments

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 policy CMP0053 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.

adambadura avatar Sep 02 '22 05:09 adambadura