简体   繁体   English

VS 代码 python 自动完成非常慢

[英]VS code python autocompletion very slow

I have an issue using python for VS code on windows.我在 windows 上将 python 用于 VS 代码时遇到问题。

The autocompletion and color syntaxing is very slow (more than 153secs).自动完成和颜色语法非常慢(超过 153 秒)。 I tried to disable all extensions as mentionned here Visual Studio Code Intellisense is very slow - Is there anything I can do?我试图禁用此处提到的所有扩展Visual Studio Code Intellisense 非常慢 - 我能做些什么吗? but without any improvement.但没有任何改善。 My python file is very small (60 lines).我的 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)

Any tips to trouble shoot my issue?有什么解决我的问题的技巧吗?

Edit:编辑:

  • Python 3.10.1 - 64bits Python 3.10.1 - 64 位
  • Pylance V2022.2.1 Pylance V2022.2.1
  • VScode 1.64.2 VScode 1.64.2
  • Windows 10 Windows 10

I a similar problem yesterday and tried to reinstall VSCode but pylance was still super slow (normal on start but slower and slower).我昨天遇到了类似的问题,并尝试重新安装 VSCode,但 pylance 仍然非常慢(启动时正常,但越来越慢)。

This morning, I tried to install an older version of PyLance extension (v2022.1.5) and it seems that now it works properly.今天早上,我尝试安装旧版本的 PyLance 扩展 (v2022.1.5),现在看来它可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM