แสดงบทความที่มีป้ายกำกับ vscode แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ vscode แสดงบทความทั้งหมด

08 ตุลาคม 2565

Debug Rust program on vscode (Visual Studio Code)

 Debug Rust program on vscode (Visual Studio Code)

  • Create new rust project by running cargo new hello
  • Open hello folder using vscode
  • Install vscode CodeLLDB extension
  • Make sure your .vscode/launch.json file will be like this (you can copy this 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": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'hello'",
"cargo": {
"args": [
"build",
"--bin=hello",
"--package=hello"
],
"filter": {
"name": "hello",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'hello'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=hello",
"--package=hello"
],
"filter": {
"name": "hello",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

  • Set breakpoint and click debug Debug executable 'hello'


28 พฤษภาคม 2562

Replace new line with enter (\n) in Visual Studio Code (vscode)




To replace each new line with enter (\n) in Visual Studio Code (vscode)
  • do the steps from images below and click "Replace All" button






To replace each enter (\n) with a new line in Visual Studio Code (vscode)
  • do the steps from  images below and click "Replace All" button