文档首页> AI开发平台ModelArts> 常见问题> Notebook(新版)> VS Code使用技巧> 使用VS Code调试代码时不能进入源码
更新时间:2024-04-30 GMT+08:00
分享

使用VS Code调试代码时不能进入源码

如果已有launch.json文件,请直接看步骤三。

步骤一:打开launch.json文件
  • 方法一:单击左侧菜单栏的Run(Ctrl+Shift+D)按钮,再单击create a launch.json file。如下图所示:

  • 方法二:单击上侧菜单栏中的Run > Open configurations按钮

步骤二:选择语言

如果需要对Python语言进行设置,在弹出的Select a debug configuration中选择Python File,其他语言操作类似。如下图所示:

步骤三:编辑launch.json,增加justMyCode": false配置,如下所示。

	    {
	        // 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",
	                "justMyCode": false
	            }
	        ]
	    }
分享:

VS Code使用技巧 所有常见问题

more