PTVS
PTVS copied to clipboard
No IntelliSense when import folder under the workspace.
Environment

Steps to Reproduce
- Open folder in SE.
- Add new python file in SE named WholsRunningMe.py
- Add folder named TestMethod under current workspace
- Add init.py file in Folder
- Type code in init.py
def FOLDER1_MSG():
print("hello world!")
- Type code in WholsRunningMe.py
import TestMethod
TestMethod.FOLDER1_MSG()
Expected behavior Make sure IntelliSense should show when import statement
Additional context and screenshots
No IntelliSense when import folder

The dropdown for import completions doesn't show up in general, not even for standard modules. However, once the import is typed, using the module works, and completions appear for its members.
It doesn't seem to matter whether it's a folder or a project, though. Imports just aren't there.
Likely caused by LSP protocol incompatibilities. It works in 17.3.0 Preview 3.0 [32607.526.main], where the LSP client is updated. Can you please re-check on that version?
In today's build , i can repro this when import module under the solution

I can reproduce it only with the following steps:
- Ensure that employee.pyi doesn't exist.
- Create employee.pyi.
- Try triggering Intellisense.
With those, the module doesn't show up in import completions regardless of how near a match it is. However, if I close and reload the project, completions show up. Deleting .pyi and starting from the first step repros again.
Can you confirm whether this also holds true for your repro? Or does it happen independently of .pyi file presence?
I can repro it without .pyi file. After restart VS, i still got no IntelliSense

I can also repro it when import folder under the workspace

In today's build ,I can repro it when import folder outside the workspace

I still cannot reproduce. Is there anything special about the Python environment that is selected (even if it's global)?
@int19h
In today's build ,I can repro it when import folder outside the workspace
The Python environment is global default(install from VS)

Is PythonSettings.json (and specifically "SearchPaths") the same as on the earlier screenshot? Also, can you share the filesystem tree showing where the folder being imported is actually located relative to the opened folder, as well as any .py files inside the imported folder?
@int19h PythonSettings.json (and specifically "SearchPaths") is the same as on the earlier screenshot
imported folder's location:
there is one "init.py" file in the imported folder
current workspace's location:

In today's build , the IntelliSense is missing after restarting VS