1.調試js
安裝Debuger for chrome插件,點擊F5,選擇chrome,vscode自動生成lauch.json如下,
{
// 使用 IntelliSense 瞭解相關屬性。
// 懸停以查看現有屬性的描述。
// 欲瞭解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "啓動 Chrome 並打開 localhost",
"url": "${file}",//修改這裏,每次調試當前文件
"webRoot": "${workspaceFolder}"
}
]
}
2.配置setting.json調試python
設置pythonpath和pylintpath路徑,如果要使用anaconda,配置python目錄爲的env目錄下的python.exe即可
3.lauch.json預定義變量
${workspaceRoot} - the path of the folder opened in VS Code
${workspaceRootFolderName} - the name of the folder opened in VS Code without any slashes (/)
${file} - the current opened file
${relativeFile} - the current opened file relative to workspaceRoot
${fileBasename} - the current opened file's basename
${fileBasenameNoExtension} - the current opened file's basename with no file extension
${fileDirname} - the current opened file's dirname
${fileExtname} - the current opened file's extension
${cwd} - the task runner's current working directory on startup
${lineNumber} - the current selected line number in the active file
lauch文件中的可配置多個調試json項,key值“”中自動提示,配置完後在vscode的調試選項中可以看到多項調試選項
4.task.json配置編譯過程
task定義的命令可以被lauch.json調用,ctrl+shift+b運行任務