Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No autocompletion for single-file mode starting from Pyright version 1.1.378 #6348

Closed
anthony-S93 opened this issue Sep 4, 2024 · 9 comments · Fixed by microsoft/pyright#8893
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@anthony-S93
Copy link

anthony-S93 commented Sep 4, 2024

Describe the bug
Autocomplete no longer works with single-file mode starting from pyright version 1.1.378

Steps to reproduce

  1. Create an empty python file test.py
  2. Open the file with text editor.
  3. Start pyright in single file mode.
  4. Write any python code.
  5. Observe the lack of autocomplete.

I've included full LSP debug logs for single-file mode and normal mode:

  1. single-file-mode.log
  2. normal-mode.log

Both of these logs are generated after launching pyright in two different modes on an empty python file test.py. In both instances, pyright was launched by the Neovim LSP Client.

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1723675123

Downgrading pyright to version 1.1.377 fixes the issue.

@anthony-S93 anthony-S93 added the bug Something isn't working label Sep 4, 2024
@erictraut
Copy link
Contributor

The auto-completion functionality in pyright is generally owned and maintained by the pylance team.

Could someone from the pylance team please transfer this issue and investigate & triage as you see fit? Thanks!

@debonte debonte removed the bug Something isn't working label Sep 4, 2024
@debonte debonte transferred this issue from microsoft/pyright Sep 4, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 4, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

Hover doesn't work either for a single file.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

Problem doesn't repro in Pylance though.

@heejaechang
Copy link
Contributor

let me take a look

@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

It looks like the default workspace is recreated for some reason. So it loses the sourceFileInfo in the original default workspace and subsequent requests don't find any source files.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

It's a difference in _getDefaultWorkspaceKey and _getWorkspaceKey in the WorkspaceFactory. It doesn't return the same value for both. Probably from the python path removal stuff.

@heejaechang
Copy link
Contributor

are you fixing it?

@heejaechang
Copy link
Contributor

I am sending PR to pyright directly.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

I could, I was in the middle of debugging it to make sure it wasn't affecting Pylance. But if you have a PR ready, feel free to submit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants