Skip to content

Run and Debug codelens link buttons for main (non test) entry point launch with differing cwd paths #17012

@Keshi

Description

@Keshi

Observed behaviour: In the scenario of an bin package inside a virtual workspace, such as in this minimal example (https://github.com/Keshi/minimal-virtual-workspace), choosing to Run or Debug the main function using the codelens buttons results in different working directories.
If the application is one that expects to dynamically load a settings or asset file relative to the cwd, then the application will always fail to load the file through one of either Run or Debug.

Expected/Desired behaviour: Run and Debug codelens buttons both launch the application using the same cwd behaviour (as observed by the application) as Run currently does.

rust-analyzer version: rust-analyzer version: 0.3.1906-standalone (e4a405f 2024-03-31)
rustc version: rustc 1.77.1 (7cf61ebde 2024-03-27)
editor or extension: VSCode, rust-analyzer 0.3.1906

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

repository link (if public, optional):
https://github.com/Keshi/minimal-virtual-workspace

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions