python - vscode 智能感知与 PyQt4 配合使用太慢

标签 python pyqt visual-studio-code intellisense

如果您使用 PyQt4 类,在使用 python 扩展编写 Visual Studio 代码时弹出的智能感知建议需要花费太多时间(例如 20 秒)才会出现。我尝试在项目内部和外部使用不同的文件,得到相同的结果。 即使在 40 行 .py 中导入 from PyQt4 import QtGui 并有一个继承自 QtGui.QTableWidget 的简单类,建议永远需要时间,如果你按 ctrl+space 更糟糕,它根本不会加载。

注释导入并删除 PyQt4 类的继承,使 Intellisense 再次立即工作。

我不确定这是否证明 https://github.com/Microsoft/vscode-python 中的问题是合理的

也许我做错了什么?

为了完成,以下是我的用户设置:

{
    "python.linting.enabled": true,
    "editor.formatOnSave": true,
    "python.linting.pylintArgs": [
        "--disable=R,C",
        "--extension-pkg-whitelist=PyQt4"
    ],
    "git.confirmSync": false,
    "git.autofetch": true,
    "csv-preview.separator": ";",
    "workbench.startupEditor": "newUntitledFile",
    "python.formatting.autopep8Args": [
        "--max-line-length=100"
    ]
}

更新:同样的项目,Intellisense 在 debian 下的 VS code 中运行速度要快得多。 (4-5 秒而不是 20 秒以上)

最佳答案

Jedi 在 PyQt 方面根本不快。这是一个已知问题,我们正在努力在不久的将来将分析引擎从 Visual Studio 迁移到 VS Code(关注我们的博客 https://aka.ms/pythonblog 以了解发布公告,了解它何时可用)。

关于python - vscode 智能感知与 PyQt4 配合使用太慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50298745/

相关文章:

visual-studio-code - Visual Studio 代码 - 如何复制搜索结果?

python - 如何配置python+uwsgi+nginx?

python - 简单的 AtomPub 服务器库

python - 在 PyQt 中使用对话框获取文件路径时出错

python - 如何从 QListWidget 中删除选定的行/项目? (Python/PyQt)

python - 如何将 QComboBox 中的文本设置为居中对齐而不使其在 PyQt 中可编辑

python - 如何使用 geopanda 或 shapely 在同一地理数据框中找到最近的点

python - 如果 len(list) 在 Python 中

visual-studio-code - 从vscode中的集成终端内打开一个新的集成终端的命令是什么?

ssh - Visual Studio Code - 一个工作区中的多个远程 SSH 连接?