vscode-debugger - 无法使用 Gauge 框架启动 VSCode 调试器
问题描述
软件版本:
- 蟒蛇:3.9.7
- 仪表:1.4.1
- Visual Studio 代码:1.60.0
- VSCode 的仪表插件(getgauge.gauge):v0.0.21
- Pylance(ms-python.vscode-pylance):v2021.9.0
我有一个基于 Python 设置的 Gauge 框架。我有一个规范文件,安装了场景。我还在胶水代码中设置了一个断点。当我单击 Debug Spec 超链接时,我收到一条错误消息,内容如下:
无法启动调试器:调试器不适用于独立文件。请打开文件夹 c:\Projects\IAS_Desktop_Automation\ias_desktop_automation。
请告诉我如何让调试器工作。
更新:我也从 gauge.log 获得了日志文件结果
09-09-2021 11:06:34.700 [Gauge] [DEBUG] Created gauge_screenshots_dir at c:\Projects\GaugeFramework\ias_net_automation\reports\html-report\screenshots
09-09-2021 11:06:34.701 [Gauge] [INFO] Compatible version of plugin python not found. Installing plugin python...
09-09-2021 11:06:34.701 [Gauge] [DEBUG] Gathering metadata for python
09-09-2021 11:06:34.703 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.105 [Gauge] [DEBUG] Plugin python 0.3.17 is already installed.
09-09-2021 11:06:35.106 [Gauge] [DEBUG] Plugin html-report is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Plugin screenshot is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Parsing started.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Started concepts parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 38 concepts parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Started specifications parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 1 specifications parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Parsing completed.
09-09-2021 11:06:35.504 [Gauge] [DEBUG] Checking updates...
09-09-2021 11:06:35.505 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.675 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.696 [python] [INFO] Python: 3.9.7
09-09-2021 11:06:35.696 [python] [DEBUG] Loading step implementations from c:\Projects\GaugeFramework\ias_net_automation\step_impl dirs.
09-09-2021 11:06:35.771 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.978 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/xml-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:41.804 [python] [INFO] Runner Ready for Debugging
这是 lsp.log 中的一个,其中可能包含一些更具启发性的信息:
09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: --> request #7: textDocument/codeLens: {"textDocument":{"uri":"file:///c%!!(MISSING)A(MISSING)/Projects/GaugeFramework/ias_net_automation/specs/testData.spec"}}
09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: <-- result #7: textDocument/codeLens: [{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":12}},"command":{"title":"Run Scenario","command":"gauge.execute","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec:3"]}},{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":14}},"command":{"title":"Debug Scenario","command":"gauge.debug","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec:3"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run Spec","command":"gauge.execute","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":10}},"command":{"title":"Debug Spec","command":"gauge.debug","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec"]}}]
解决方案
此问题是由最新的仪表扩展更新(版本 0.0.21)引入的
- 将您的自动更新扩展更改为无
- 将 vscode 中的仪表扩展下调至 0.0.20
您可以在“版本历史记录”选项卡下从此处获取版本 20: https ://marketplace.visualstudio.com/items?itemName=getgauge.gauge#install-from-source
将下载文件放在您的工作区中,然后在终端中运行以下命令:
code --install-extension getgauge.gauge-0.0.20.vsix
推荐阅读
- lua - 如何在 powerdns 中为 aaaa 请求替换 ipv4 答案?
- android - Android 导航组件中的目的地链接
- p2p - 一个bit torrent客户端如何知道上传和下载的数据量等传输细节?
- postgresql - 我应该如何设计用户屏蔽系统?
- java - 参考列不会保存在单向一对多关系休眠中
- javascript - 覆盖对象内调用其初始实现的函数
- c++ - 用于枚举绑定但未连接的套接字的 WIndows API
- python - 寻找彼此靠近的对象边界
- php - 如何在php中创建文件扫描器时修复超时
- unity3d - Unity 材质中的发射对附近的静态物体没有影响