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

rust-analyzer debug feature fails in vscode #307

Open
Alphapage opened this issue Oct 15, 2023 · 2 comments
Open

rust-analyzer debug feature fails in vscode #307

Alphapage opened this issue Oct 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working k::toolchain Related to project toolchain question Further information is requested

Comments

@Alphapage
Copy link

Hello,

Scenario: Unsuccessfull debug from vscode file
   Given a developer who uses vscode
   When he clicks debug at the top of main function generated by rust-analyzer
   Then debug fails with "Failed to parse: Failed to parse feature: Could not read path:" even if the absolute path is set as input

From my first investigation, it seems cucumber is trying to merge path from its own crate location, instead of the testing crate path.
If I create a launch.json debug configuration, then I don't have any problem: the test is running as expected.

Thank you in advance for your help.

@tyranron
Copy link
Member

@Alphapage I'm not VSCode user, so didn't hit such problem.
Could you specify which command is run when "Debug" is clicked?

@tyranron tyranron self-assigned this Oct 16, 2023
@tyranron tyranron added bug Something isn't working question Further information is requested k::toolchain Related to project toolchain labels Oct 16, 2023
@Alphapage
Copy link
Author

Sorry, but it seems to be related to : rust-lang/rust-analyzer#10408

Working config from launch.json:

{
            "type": "lldb",
            "request": "launch",
            "name": "Debug integration test 'cucumber'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--test=cucumber",
                    "--package=dev"
                ],
                "filter": {
                    "name": "cucumber",
                    "kind": "test"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        }

Rust-analyzer debug lens config:

{
  "type": "lldb",
  "request": "launch",
  "name": "run cucumber",
  "program": "/Users/desktop/dev/target/debug/deps/cucumber-5d6945f264a7a24d",
  "args": [],
  "cwd": "/Users/desktop/dev",
  "sourceMap": {},
  "sourceLanguages": [
    "rust"
  ],
  "env": {
    "RUST_BACKTRACE": "short",
    "COMMAND_MODE": "unix2003",
    "HOME": "/Users/desktop",
    "HOMEBREW_CELLAR": "/opt/homebrew/Cellar",
    "HOMEBREW_PREFIX": "/opt/homebrew",
    "HOMEBREW_REPOSITORY": "/opt/homebrew",
    "INFOPATH": "/opt/homebrew/share/info:",
    "LOGNAME": "desktop",
    "LaunchInstanceID": "821CDDA6-A04D-4480-B374-91A3ED30BC08",
    "MANPATH": "/opt/homebrew/share/man::",
    "MallocNanoZone": "0",
    "OLDPWD": "/",
    "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
    "PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/desktop/.cargo/bin:/Users/desktop/dev/bin",
    "PWD": "/",
    "SECURITYSESSIONID": "186a3",
    "SHELL": "/bin/zsh",
    "SHLVL": "0",
    "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.MeZJWHAoqG/Listeners",
    "TMPDIR": "/var/folders/3v/j9vt6qc502b5ht2p8w_9c76m0000gn/T/",
    "USER": "desktop",
    "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
    "VSCODE_CODE_CACHE_PATH": "/Users/desktop/Library/Application Support/Code/CachedData/f1b07bd25dfad64b0167beb15359ae573aecd2cc",
    "VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
    "VSCODE_CWD": "/",
    "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
    "VSCODE_IPC_HOOK": "/Users/desktop/Library/Application Support/Code/1.83-main.sock",
    "VSCODE_NLS_CONFIG": "{\"locale\":\"en-gb\",\"osLocale\":\"en-fr\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
    "VSCODE_PID": "544",
    "XPC_FLAGS": "0x0",
    "XPC_SERVICE_NAME": "application.com.microsoft.VSCode.41679192.41679198",
    "_": "/Applications/Visual Studio Code.app/Contents/MacOS/Electron",
    "__CFBundleIdentifier": "com.microsoft.VSCode",
    "__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x0",
    "ELECTRON_RUN_AS_NODE": "1"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working k::toolchain Related to project toolchain question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants