Skip to content

[Bug] when a launch configuration has a name field, the project outline always shows [unset] despite being properly set #808

@snehara99

Description

@snehara99

Brief Issue Summary

When a makefile.launchConfigurations entry includes the name field (added in #793), the Makefile: Project
Outline panel always displays the launch target as "Unset" after selection, even though the configuration
is correctly matched internally.

Root Cause

LaunchTargetNode.getShortLaunchTargetName() in tree.ts receives the display name (e.g., "Run with
arguments") from launchConfigurationDisplayName(). It passes this to stringToLaunchConfiguration(), which
expects the technical cwd>binary(args) format. Since a user-friendly name doesn't match that format,
parsing returns undefined, and the tree unconditionally falls back to showing "Unset".

A secondary issue is that readCurrentLaunchConfiguration() in configuration.ts passes the prose string "No
launch configuration set." to updateLaunchTarget() when no configuration is active. This non-empty string
also fails parsing but isn't truly a display name — it leaks status-bar text into the tree.

Steps to Reproduce

  1. Add a launch configuration with a name field in .vscode/settings.json:
    "makefile.launchConfigurations": [
    {
    "name": "Run with arguments",
    "cwd": "${workspaceFolder}",
    "binaryPath": "${workspaceFolder}/out.exe",
    "binaryArgs": ["arg1", "arg2"]
    }
    ]
  2. Run Makefile: Configure
  3. Run Makefile: Set the make launch configuration and select "Run with arguments"
  4. Observe the Makefile: Project Outline panel

Expected: Launch target shows Launch target: [Run with arguments] Actual: Launch target shows Launch
target: [Unset]

The Makefile Tools output panel confirms the configuration was matched successfully (Reading current
launch configuration "Run with arguments" from the workspace state.), so this is purely a display issue in
the tree view.

Debug Log

n/a

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions