python - VS code python 自动补全非常慢

标签 python visual-studio-code intellisense

我在 Windows 上使用 python 进行 VS 代码时遇到问题。

自动完成和颜色语法非常慢(超过 153 秒)。我尝试禁用此处提到的所有扩展Visual Studio Code Intellisense is very slow - Is there anything I can do?但没有任何改善。 我的 python 文件非常小(60 行)。

[Info  - 13:49:36] (32004) [IDX(2)] Long operation: index libraries c:\Users\XXX\XXX.py (2089ms)
[Info  - 13:49:36] (32004) Indexer done(2). indexed 504 files
[Info  - 13:52:07] (32004) [BG(1)] Long operation: getSemanticTokens full at c:\Users\XXX\XXX.py (153210ms)
[Info  - 13:53:43] (32004) [FG] Long operation: completion at c:\Users\XXX\XXX.py:33:12 (5334ms)

有什么提示可以解决我的问题吗?

编辑:

  • Python 3.10.1 - 64 位
  • 皮兰斯 V2022.2.1
  • VScode 1.64.2
  • Windows 10

最佳答案

我昨天遇到了类似的问题,并尝试重新安装 VSCode,但 pylance 仍然 super 慢(启动时正常,但越来越慢)。

今天早上,我尝试安装旧版本的 PyLance 扩展 (v2022.1.5),现在似乎可以正常工作了。

关于python - VS code python 自动补全非常慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71126862/

相关文章:

xsd - IntelliSense 支持在 Visual Studio 中编辑 NuGet 规范

c++ - MSVS C++ 2012 : how to disable compiling-while-editting

python - 使用 Python 和 Flask 长时间运行的任务

c# - 找不到预启动任务 'build'

c++ - 在 VS2019 或 VSCode 中使用 Unreal Engine 4.24.2 时,如何修复这些错误的 Intellisense 错误?

javascript - eslint 使用路径映射配置的 jsconfig.json 解决导入错误

typescript - 如何防止重复的自动建议导入

python - 使用 Scipy 最小化函数最小化

python - 无法在 tensorflow 中成功读取图像

python - Django:通过 pk 将模型添加到 ManyToMany,无需获取