Skip to content

Commit

Permalink
chore(linter): add vscode debugger launch config (#8271)
Browse files Browse the repository at this point in the history
refer to this
[reply](https://discord.com/channels/1079625926024900739/1080101477672046712/1265758176754794598),
add CodeLLDB launch config for debugging oxlint.

usage for real dev like:
```json
{
  "type": "lldb",
  "request": "launch",
  "name": "Debug Oxlint",
  "cargo": {
    "env": {
      "RUSTFLAGS": "-g"
    },
    "args": ["build", "--bin=oxlint", "--package=oxlint"],
    "filter": {
      "name": "oxlint",
      "kind": "bin"
    }
  },
  "args": ["--ignore-pattern=./ignore/**"],
  "cwd": "/home/xxx/temp/oxlint-7102"
}
```

besides, i tired add config in `args` to override `Cargo.toml`
`[profile.dev] debug = false`, but cargo in CodeLLDB throw error.
```json
"args": [
  "build", "--bin=oxlint", "--package=oxlint", 
  "--config profile.dev.debug=true"
]
```

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
1zumii and autofix-ci[bot] authored Jan 8, 2025
1 parent aebe0ea commit 45eb354
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
"SERVER_PATH_DEV": "${workspaceRoot}/target/debug/oxc_language_server",
"RUST_LOG": "debug"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Oxlint",
"cargo": {
"env": {
"RUSTFLAGS": "-g"
},
"args": ["build", "--bin=oxlint", "--package=oxlint"],
"filter": {
"name": "oxlint",
"kind": "bin"
}
}
// "args": ["--ARGS-TO-OXLINT"],
// "cwd": "PATH-TO-TEST-PROJECT"
}
]
}

0 comments on commit 45eb354

Please sign in to comment.