Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

This changes visible behavior

The CMake syntax highlighter was flagging SOURCE_FILES and other deprecated command names as invalid even when used as variable names:

set(SOURCE_FILES ${CPP_FILES} ${H_FILES})  # Incorrectly shown as deprecated
add_executable(app ${SOURCE_FILES})         # Incorrectly shown as deprecated

The following changes are proposed:

  • syntaxes/CMake.tmLanguage: Anchor deprecated command pattern to line start (^\s*\b) instead of matching anywhere (\b), consistent with how regular commands are matched (lines 33-37, 42-43)
  • Fixed typo: "Derecated" → "Deprecated"
  • CHANGELOG.md: Added bug fix entry for v1.23

The purpose of this change

Deprecated CMake commands (SOURCE_FILES, BUILD_NAME, VTK_WRAP_*, etc.) from CMake 1.x should only be flagged when used as commands at line start, not when used as variable names or in expansions like ${SOURCE_FILES}.

Pattern change:

- <string>\b(?i:ABSTRACT_FILES|BUILD_NAME|SOURCE_FILES|...)\b</string>
+ <string>^\s*\b(?i:ABSTRACT_FILES|BUILD_NAME|SOURCE_FILES|...)\b</string>

Other Notes/Information

TextMate grammar change only—no code impact. Variable names can be arbitrary; using SOURCE_FILES as a variable is valid 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
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • 40vvsblobprodwus2135.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • b15vsblobprodwus2164.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • b53vsblobprodwus2154.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • d94vsblobprodwus2119.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • k4pvsblobprodwus2140.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • n6wvsblobprodwus2123.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • p2tvsblobprodwus2189.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (dns block)
  • v41vsblobprodwus2175.vsblob.vsassets.io
    • Triggering command: /usr/local/bin/node node /usr/local/bin/yarn install (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>[Bug] Odd SOURCE_FILES variable highlighting?</issue_title>
<issue_description>### Brief Issue Summary

SOURCE_FILES seems to have a special highlighting - e.g. see the snippet below.

Is it a bug? Highlighting looks like there was some kind of syntax issue but there isn't.

Image
find_package(Boost REQUIRED)

set(XXX ${TEST})

file(GLOB CPP_FILES *.cpp)
file(GLOB H_FILES *.h)
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
set(TEST_FILES ${CPP_FILES} ${H_FILES})
add_executable(IfcGeomServer ${SOURCE_FILES})
target_link_libraries(IfcGeomServer IfcGeom ${kernel_libraries} ${OPENCASCADE_LIBRARIES})

install(TARGETS IfcGeomServer)

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.107.0-insider",
  "cmtVersion": "1.21.36",
  "configurations": [
    {
      "folder": "l:\\Projects\\Github\\test",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

.

Additional Information

No response</issue_description>

<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

NON-NEGOTIABLE PROCESS

  1. Triage & understanding (issue-first)
  • Read the entire issue thread.
  • Extract and write down:
    • expected behavior
    • actual behavior
    • repro steps (or minimal repro you infer)
    • affected OS/toolchains/generators/presets
    • whether it is a regression and from which version/commit (if indicated)
  • Identify which CMake Tools feature area is involved (configure/build/test/debug, presets, kits, status bar, tasks, command palette, IntelliSense).
  1. Orient yourself in the repo (implementation map)
  • Identify the relevant user-facing workflows impacted (configure/build/test/debug, presets, kits, status bar, tasks, command palette).
  • Locate the existing implementation areas (commands, configuration/presets handling, test integration, UI, telemetry/logging).
  • Identify existing tests and how they are run in CI; prefer extending existing suites over inventing a new harness.
  1. Changelog discipline (required)
  • Find the project’s changelog / release notes mechanism (e.g., CHANGELOG.md, docs/changelog, “Unreleased” section, or a dedicated changes/ folder).
  • Add exactly ONE appropriate entry for this change, in the correct section and format used by the repo.
  • The entry must describe user-visible behavior (not internal refactors).
  • If the change is not user-visible, explicitly justify that and still add a brief “Internal” entry if the repo’s convention supports it.
  • Ensure the changelog entry matches wording/tense/category conventions already used by the repo.
  1. Implementation standards
  • Follow existing code style, naming, and patterns in this repository.
  • Prefer small, readable changes; avoid broad refactors unless clearly necessary to fix the issue correctly.
  • Preserve backward compatibility for settings/presets when possible; be careful with defaults and precedence rules.
  • Update docs/settings schema/messages if user-facing behavior or configuration changes.
  • Logging: use the extension’s existing logging utilities; avoid noisy output and avoid logging secrets/paths unnecessarily.
  1. Testing & verification (required)
    Automated:
  • Identify the most relevant automated tests (unit/integration/e2e) and add or update tests to cover the issue scenario.
  • Run the repo’s test suite and any lint/format checks the repo uses.
  • Do not claim tests passed unless you actually ran them; if you cannot run them, state that explicitly and provide a concrete test plan.

Targeted scenario verificatio...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: hanniavalera <90047725+hanniavalera@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix odd highlighting for SOURCE_FILES variable Jan 29, 2026
Copilot AI requested a review from hanniavalera January 29, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants