Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of vscode-cmake-tool custom debug buttons/functionality #4061

Open
thernstig opened this issue Sep 12, 2024 · 5 comments
Open

Removal of vscode-cmake-tool custom debug buttons/functionality #4061

thernstig opened this issue Sep 12, 2024 · 5 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch
Milestone

Comments

@thernstig
Copy link

thernstig commented Sep 12, 2024

Brief Issue Summary

The CMake extension supports a custom debug or launch experience. But the experience creates a huge cognitive dissonance for how debugging/launching works for other programming languages and extensions in VS Code.

VS Code has a very specific way to configure launch/debugging via a launch.json. This is readily explained here https://code.visualstudio.com/docs/editor/debugging. As can be seen, it has its own Run and Debug icon in the activity bar.

VS Code by default also comes with the very common/default keyboard shortcuts F5 to start debugging, or Ctrl+F5 to run without debugging (launch).

Problems

There are multiple problems with the approach this extension has taken with a custom launch/debugging experience.

It is not visible in the Run and Debug view

Notice how the CMake extensions' custom debug options are not visible here. Only the ones from launch.json are:

image

The Status Bar shows double launch/debug buttons

A) is the default VS Code debugging/launch experience
B) Is the custom buttons add by the CMake extension

This "double the amount of buttons" is confusing.

image

The default debugging keyboard shortcut is overriden by the CMake extension

A) is the default VS Code keyboard shortcuts that launches the debug config selected in the Run and Debug view
b) Is the CMake extension that actually overrides the "without debugging" part for Ctrl+F5, which is a very bad user experience.

image

Hides implementation details

The custom CMake extension debugging hides all launch/debug details, and does not allow for users to easily set new options/overrides as can be done in launch.json, so everything is a bit of magic.

Solution

I strongly believe all this custom debug (status bar icons, keyboard shortcuts) etc should be removed. And that VS Code's builtin Run and Debug view/support should be used. This creates less information for users to learn since most are accustomed to other ways with other extensions and programming languages.

Instead all meny options such as CMake: Debug and CMake: Run Without Debugging should create default entries in launch.json when invoked if none exists. It simplifies a lot for users.

Additional references

https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/debug-launch.md
https://code.visualstudio.com/updates/v1_94#_start-debugging-from-chat-experimental (might not work properly with the custom debug experience)

@github-project-automation github-project-automation bot moved this to Blocked in CMake Tools Sep 12, 2024
@Yingzi1234 Yingzi1234 added enhancement an enhancement to the product that is either not present or an improvement to an existing feature and removed triage labels Sep 13, 2024
@gcampbell-msft gcampbell-msft added this to the On Deck milestone Oct 2, 2024
@gcampbell-msft gcampbell-msft moved this from Blocked to Pending Prioritization in CMake Tools Oct 2, 2024
@mwerle
Copy link

mwerle commented Oct 3, 2024

Strong +1 from me; I regularly switch between CMake and non-CMake projects and it always takes me a bit of time to remember how this extension works if it's been some time.

I found this proposal after searching how to get the CMake extension to start a debugging session using just "F5"..

@thernstig
Copy link
Author

@gcampbell-msft I want to add that even news like https://code.visualstudio.com/updates/v1_94#_start-debugging-from-chat-experimental most likely will not work well with the custom debug experience.

@gcampbell-msft
Copy link
Collaborator

@mwerle @thernstig To make things clear, we do not attempt to replace the typical debugging experience provided by VS Code, we only provide some attempts to make things easier when opening debug sessions. We still hook into the typical C++ debugging from the cpptools extension.

I definitely agree that the overriding of the default debugging shortcut makes this difficult, we plan to take #4125 after a CHANGELOG entry is made.

However, we will still take this feedback into consideration. Thanks

@thernstig
Copy link
Author

thernstig commented Oct 25, 2024

@gcampbell-msft For all intents and purposes I think people do get thrown of by the custom/hidden debugging experience if not seeing it in the launch.json file. As explained in the original issue (last paragraph); adding the two run/debug configs to launch.json first time the commands are invoked would be "explicit over implicit". And more so mimic how every other debug extension does this for other languages afaik. But I am repeating myself now😆We have been heard 😃

(the "every other language" is a huge guess, but what I seen from the few I use)

@gcampbell-msft
Copy link
Collaborator

@thernstig I think that definitely makes sense, we appreciate your feedback and your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: debug/launch
Projects
Status: Pending Prioritization
Development

No branches or pull requests

4 participants