Skip to content

Implement session state tracking for "Run and Debug" button when Inte… - #14719

Open
Prashant Kumar Rai (8prashant) wants to merge 1 commit into
microsoft:mainfrom
8prashant:main
Open

Implement session state tracking for "Run and Debug" button when Inte…#14719
Prashant Kumar Rai (8prashant) wants to merge 1 commit into
microsoft:mainfrom
8prashant:main

Conversation

@8prashant

Copy link
Copy Markdown

Fixes #13001

When C_Cpp.intelliSenseEngine is set to "disabled", the language server client is not started. Previously, cpptools.buildAndDebug.isSourceFile and cpptools.buildAndDebug.isFolderOpen context keys (which control the visibility of the "Run / Debug C/C++ File" and "Add Debug Configuration" editor action buttons) were only updated within the language server client (client.ts). Consequently, disabling IntelliSense would cause the Run/Debug shortcut buttons to never appear in the editor title bar.

This PR updates the Debugger extension initialization (Debugger/extension.ts) to track active text editor changes and keep buildAndDebugIsSourceFile and buildAndDebugIsFolderOpen up to date regardless of whether IntelliSense is enabled or disabled.

Changes

  1. Added updateBuildAndDebugSessionState and registered an onDidChangeActiveTextEditor listener in DebuggerExtension.initialize.
  2. Added unit tests in Extension/test/scenarios/SingleRootProject/tests/buildAndDebug.test.ts verifying session state updates for source files, header files, non-C/C++ files, and undefined editors.

Verification

  • Compiled with TypeScript (yarn compile) with 0 errors.
  • Ran tests via yarn test --scenario=SingleRootProject and verified all BuildAndDebug SessionState Tests pass.

…lliSense is disabled and add corresponding tests
@github-project-automation github-project-automation Bot moved this to Pull Request in cpptools Aug 30, 2026
@8prashant
Prashant Kumar Rai (8prashant) marked this pull request as ready for review August 30, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Request

Development

Successfully merging this pull request may close these issues.

Disabling intellisense disables debugging

2 participants