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" #598

Description

On the old LS in release:

Opening document untitled:Untitled-1
[Error - 10:48:38 AM] Request textDocument/completion failed.
  Message: unknown document
  Code: -32000 
   at Microsoft.Python.LanguageServer.Implementation.ProjectFiles.GetEntry(Uri documentUri, Boolean throwIfMissing) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\ProjectFiles.cs:line 53
   at Microsoft.Python.LanguageServer.Implementation.ProjectFiles.GetEntry(TextDocumentIdentifier document, Nullable`1 expectedVersion, ProjectEntry& entry, PythonAst& tree) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\ProjectFiles.cs:line 59
   at Microsoft.Python.LanguageServer.Implementation.Server.Completion(CompletionParams params, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\Server.Completion.cs:line 34
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Completion(JToken token, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\LanguageServer.cs:line 301

The file gets opened, but doesn't seem to get added anywhere, nor analyzed. This may also be causing exceptions on file updates which I'm not sure are logged in the output panel.

To reproduce (same as #597):

  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).

Activity

  1. MikhailArkhipov commented on Apr 11, 2019

    @MikhailArkhipov

    That was fixed with #837

  2. jakebailey commented on Apr 11, 2019

    @jakebailey
    MemberAuthor

    Yup, this was the issue for the old LS (which is now defunct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions