Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Switching language mode to Python on an unsaved file throws "Module path should be rooted" #597

Description

Completions in untitled:Untitled-1 at (0, 8)
[Error - 10:40:55 AM] Request textDocument/completion failed.
  Message: One or more errors occurred. (Module path should be rooted)
  Code: -32000 
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.Python.LanguageServer.Implementation.Server.GetAnalysis(Uri uri, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\Server.Documents.cs:line 72
   at Microsoft.Python.LanguageServer.Implementation.Server.Completion(CompletionParams params, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\Server.Editor.cs:line 35
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Completion(JToken token, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\LanguageServer.cs:line 238

To reproduce:

  1. Open a new file in VSC, do not save.
  2. Use the command palette to change the language mode to Python.
  3. Try to use the analysis (completion, hover, etc).

The LS seems to analyze it, but breaks when it goes to serve a request.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions