Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Improvements:
- Embed the source commit SHA as a `commitId` field in the packaged extension's `package.json` so the exact commit a (pre-)release was built from can be identified, since the marketplace version number alone cannot be traced back to a commit. [#4801](https://github.com/microsoft/vscode-cmake-tools/issues/4801)

Bug Fixes:
- Fix CMake syntax highlighting treating escaped `$<` sequences in quoted regex strings as generator expressions. [#5028](https://github.com/microsoft/vscode-cmake-tools/issues/5028)
- Fix a test run that matched no tests being reported as success. When specific tests are requested (e.g. programmatically via the API/Copilot) but none match a discovered test — for example an agent passing a partial or non-existent test name — CTest exits 0 ("No tests were found!!!"), which callers could misread as "all tests passed". Such runs now return a failure with a clear message when tests exist but the requested ones weren't found. [#4915](https://github.com/microsoft/vscode-cmake-tools/issues/4915)
- Stop showing "Adding a file without a valid code model" / "Deleting a file without a valid code model" warning notifications when a source file is automatically added or deleted and there is no valid CMake code model (for example when using clangd with the C/C++ IntelliSense engine disabled, or before the project has been configured). The automatic list-file update now stays silent in this case; the warning is only shown when the update is explicitly invoked via the "CMake: Add new source file" / "CMake: Remove deleted source file" commands. [#5009](https://github.com/microsoft/vscode-cmake-tools/issues/5009)
- Fix running a single test from the inline Test CodeLens or the project outline building the default (or all) target instead of the test's own executable; single-test runs now build only that test's target.
Expand Down
5 changes: 3 additions & 2 deletions syntaxes/CMake.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@
"endCaptures": { "0": { "name": "punctuation.definition.string.end.cmake" } }
},
"generatorExpression": {
"comment": "Do not start a generator expression at escaped $< sequences, such as CMake regex patterns matching a literal generator expression prefix.",
"name": "meta.generator-expression.cmake",
"begin": "\\$<",
"begin": "(?<!\\\\)\\$<",
"beginCaptures": { "0": { "name": "punctuation.definition.generator-expression.begin.cmake" } },
"end": ">",
"endCaptures": { "0": { "name": "punctuation.definition.generator-expression.end.cmake" } },
Expand Down Expand Up @@ -412,4 +413,4 @@
"match": "\\b(?i:return)\\b"
}
}
}
}
12 changes: 11 additions & 1 deletion test/visual-syntax-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20")
message(STATUS "CMake 3.20+")
endif()

# Issue #5028: Fix highlighting of escaped $< in CMake regex strings
function(validate_configure_path value description)
if("${value}" MATCHES "\\$<")
message(FATAL_ERROR
"${description} must be known at configure time; generator expressions "
"are not supported."
)
endif()
endfunction()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down Expand Up @@ -471,4 +481,4 @@ set_target_properties(MyLib PROPERTIES
SOURCES "lib.cpp"
COMPILE_DEFINITIONS_DEBUG "DEBUG=1"
LINK_FLAGS_RELEASE "/OPT:REF"
)
)