今天看了一下,猜应该是configurations里面多写一个就行,试了下,真的能够同时debug Python和Go代码。python
能够打断点、单步执行Python和Go代码。express
launch.json 以下json
{ // 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": [ { "name": "Python: 当前文件", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal" }, { "name": "Go: 当前文件", "type": "go", "request": "launch", "program": "${file}", "mode": "auto" } ] }
而后在DEBUG后面选择用哪个配置跑就好了。spa
只是还有两点以为作得不太好的地方,debug
一是 watch里面不会显示nil值,而是显示类型。code
二是 不知道是否由于加了watch,两个变量都会在未初始化的时候报错,感受像IDE的bug。orm
Failed to eval expression: { "Expr": "f2", "Scope": { "goroutineID": 1, "frame": 0 }, "Cfg": { "followPointers": true, "maxVariableRecurse": 1, "maxStringLen": 64, "maxArrayValues": 64, "maxStructFields": -1 } } Eval error: could not find symbol value for f2blog
Failed to eval expression: { "Expr": "f", "Scope": { "goroutineID": 1, "frame": 0 }, "Cfg": { "followPointers": true, "maxVariableRecurse": 1, "maxStringLen": 64, "maxArrayValues": 64, "maxStructFields": -1 } } Eval error: could not find symbol value for fip