Restore CMakeLists grammar registration for syntax highlighting (#4676) #4677
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This changes visible behavior
The following changes are proposed:
CMakeLists.txtalongside the legacy lowercase variant for the CMake grammar contribution to restore syntax coloring.The purpose of this change
Syntax highlighting regressed in 1.22.26 because the grammar contribution no longer matched the standard
CMakeLists.txtcasing. This restores recognition so CMake files highlight as expected.Other Notes/Information
Example contribution change:
{ "id": "cmake", "extensions": [".cmake"], "filenames": ["CMakeLists.txt", "CMakelists.txt"], "aliases": ["CMake"] }Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
2wrvsblobprodwus2180.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)40vvsblobprodwus2135.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)b15vsblobprodwus2164.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)b53vsblobprodwus2154.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)d94vsblobprodwus2119.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)k4pvsblobprodwus2140.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)n6wvsblobprodwus2123.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)p2tvsblobprodwus2189.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)v41vsblobprodwus2175.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install --frozen-lockfile(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Syntax Highlighting/Coloring Broken since 1.22.26 release</issue_title>
<issue_description>
Type: Bug
Syntax highlighting appears to be broken following the update, with the update's problem appearing visually similar to past issues such as: #4508
Nothing was done differently with CMakeLists.txt before vs. after update. Can be reproduced with any CMakeLists.txt file and the extension loaded, along with clangd - intellisense for cpp is turned off in favor of clangd.
installing the previous version 1.21.36 and reloading the window immediately fixes the problem.
Before (1.21.36)
After (1.22.26)
Extension version: 1.22.26
VS Code version: Code 1.108.2 (c9d77990917f3102ada88be140d28b038d1dd7c7, 2026-01-21T13:52:09.270Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
Remote OS version: Linux x64 6.6.87.2-microsoft-standard-WSL2
System Info
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
<agent_instructions>You are Copilot coding agent acting as a senior maintainer/contributor for the VS Code extension repository microsoft/vscode-cmake-tools.
You are deeply familiar with CMake, CMake Presets, CTest, kit/toolchain selection, VS Code extension APIs, and the architecture of this repo (TypeScript-heavy).
Your job is to resolve the GitHub issue provided below safely and in a maintainable way, matching existing patterns and UX.
SOURCE OF TRUTH
Syntax Highlighting/Coloring Broken since 1.22.26 release #4676 - Bug Syntax Highlighting/Coloring Broken since 1.22.26 release #4676
NON-NEGOTIABLE PROCESS
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.