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

[bug][python] ros variablePresentation in launch.json isn't hiding special and function variables #798

Open
2 tasks done
Combinacijus opened this issue Oct 4, 2022 · 1 comment
Assignees
Labels
bug Something isn't working Debugging help wanted Extra attention is needed Python

Comments

@Combinacijus
Copy link

  • Linux: 20.04
  • ROS 1: Noetic

Version of the plugin
v0.8.3

Copy the Version information from the Help | About menu

Version: 1.71.2
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:12:14.256Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-48-generic snap
Sandboxed: No

what is the bug

variablePresentation parameter in launch.json does not work when using debugging via launch file "type": "ros", "request": "launch". It does work when debugging as python script "type": "python", "request": "launch"

Not hiding:
image

Hidding:
image

launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            // DO Work. variablePresentation unnecessary variables 
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "variablePresentation": {
                "all": "hide",
                "protected": "inline"
            }
        },
        {
            // DON'T work. variablePresentation does nothing to hide unnecessary variables
            "name": "path_planning.launch",
            "type": "ros",
            "request": "launch",
            "target": "/home/georobot/ros_ws/georobot_ws/src/au_automow_common/automow_planning/launch/path_planning.launch",
            "variablePresentation": {
                "all": "hide",
                "protected": "inline"
            }
        }
    ]
}

Repro steps

<how to reproduce the bug. Please attach sample files or github repo if appropriate.>

  1. Create any python ros node with couple variables
  2. Add a breakpoint after variables are set
  3. Create launch file to launch that node
  4. Create debug config launch.json for that launch file and add parameter https://github.com/ms-iot/vscode-ros/blob/master/media/documentation/debug-support/create-launch-debug-config.gif:
"variablePresentation": {
    "all": "hide",
    "protected": "inline"
}
  1. Run debugger and check if special and function variables are hidden

expected behavior

For special and function variables to be hidden when using variablePresentation setup.

additional context

Similar issue on python debugger side although python debugger works correctly microsoft/debugpy#961

@Combinacijus Combinacijus added the bug Something isn't working label Oct 4, 2022
@ooeygui ooeygui changed the title [bug] ros variablePresentation in launch.json isn't hiding special and function variables [bug][python] ros variablePresentation in launch.json isn't hiding special and function variables Oct 10, 2022
@ooeygui ooeygui self-assigned this Oct 10, 2022
@ooeygui
Copy link
Member

ooeygui commented Oct 10, 2022

Thank you for the detailed bug - very much appreciated!

The root of the issue is that the VSCode ROS extension creates a new debug type called "ROS", which shells out to sub-debuggers. In order to pass these through to the underlying debugger, they need to be exposed on the ROS debug object.

I'd love a community PR for this one.

@ooeygui ooeygui added the help wanted Extra attention is needed label Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Debugging help wanted Extra attention is needed Python
Projects
None yet
Development

No branches or pull requests

2 participants