前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >vscode开发调试js、python

vscode开发调试js、python

作者头像
sofu456
发布2019-07-09 14:10:33
7.6K0
发布2019-07-09 14:10:33
举报
文章被收录于专栏:sofu456

1.调试js

安装Debuger for chrome插件,点击F5,选择chrome,vscode自动生成lauch.json如下,

代码语言:javascript
复制
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "启动 Chrome 并打开 localhost",
            "url": "${file}",//修改这里,每次调试当前文件
            "webRoot": "${workspaceFolder}"
        }
    ]
}"${file}",//修改这里,每次调试当前文件
            "webRoot": "${workspaceFolder}"
        }
    ]
}

chrome attach调试,chrome端使用--remote-debugging-port=9222方式启动,然后配置lauch.json的request为attach

js动态加载的文件,vscode断点无效(未验证的断点----可以用debuger下断点):

在要被调用的文件开始处,加//@ sourceURL=ParcelProcessWaitForArchivedListPage.js,加上注释后打开chrome调试,vscode可以捕获chrome断点,断点需要设置到chrome里面,vscode调试。如果//@ sourceURL=文件的本地绝对路径,就可以在vscode上直接调试了,而且断点有效。提示://@ sourceURL中间要有空格

参考:https://blog.csdn.net/ebay/article/details/45894543

2.配置setting.json调试python

设置pythonpath和pylintpath路径,如果要使用anaconda,配置python目录为的env目录下的python.exe即可

3.lauch.json预定义变量

代码语言:javascript
复制
${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运行任务

5.vscode调试器扩展

参考:https://code.visualstudio.com/docs/extensions/example-debuggers

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018年06月28日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档