pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

No Intellisense when the file is saved after Pylance initializes

Open MufanColin opened this issue 2 years ago • 1 comments

Environment data

  • Language Server version: 2023.1.10
  • OS and version: darwin arm64
  • Python version (and distribution if applicable, e.g. Anaconda):
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: off

Code Snippet

import sys
  1. open the integrated terminal in vscode and type code test1.py to create a new empty file called test1.py(with all python extensions installed, python, pylance, etc.)
  2. notice that at this time, there will be white dot after test1.py which indicates that this file is not saved yet.
  3. do not type anything into the test1.py file and press command + S to save the file
  4. now the white dot after test1.py disappears
  5. type import sys
  6. no intellisense suggestions
  7. type sys.(sys and a dot after it)
  8. no intellisense suggestions for methods inside sys module. This problem can be solved by closing the window and reopening vscode, but it is not very convenient.

Expected behavior

XXX

Actual behavior

XXX

Logs

XXX

MufanColin avatar Jan 10 '23 07:01 MufanColin

I'm able to repro this. It seems that it only repros if the file is saved after Pylance initializes. If you save early enough, completions work as expected.

When it repros, Pylance does get textDocument/completion requests, but its replies are empty (no results).

debonte avatar Apr 13 '23 00:04 debonte