简体   繁体   English

使用 sys.path.append 添加路径时,VSCode IntelliSense 不适用于模块

[英]VSCode IntelliSense not working for modules when using sys.path.append to add paths

I am adding path that are higher up or in a sibling directories using following code.我正在使用以下代码添加更高或同级目录中的路径。 And I am not getting IntelliSense for modules inside these folders.而且我没有获得这些文件夹中模块的 IntelliSense。 Any idea how to get this IntelliSense?知道如何获得这个 IntelliSense 吗?

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

The function colorPrint is defined inside LoggingHelper module in Utility folder. function colorPrint 在 Utility 文件夹的 LoggingHelper 模块中定义。

I solved it as following.我解决了它如下。 I am adding parent folder and resolving all modules inside the parent folder.我正在添加父文件夹并解析父文件夹中的所有模块。 This way, I get IntelliSense这样,我得到了 IntelliSense

在此处输入图像描述

在此处输入图像描述

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

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