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.

"Object reference not set to an instance of an object" when trying Go To Symbol in Workspace #378

Closed

Description

This is a follow up on #137 that was closed prior to version 0.1.60.0.

Here is the full error message with the new version:

Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.60.0
Initializing for /opt/venvs/py37/bin/python
[Error - 12:01:32 PM] Request workspace/symbol failed.
  Message: Object reference not set to an instance of an object.
  Code: -32000 
   at Microsoft.Python.LanguageServer.Implementation.Server.<>c__DisplayClass133_0.<GetModuleVariables>b__4(ILocationInfo l)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.Python.LanguageServer.Implementation.Server.<>c__DisplayClass133_0.<GetModuleVariables>b__2(IMemberResult m)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.EnumerablePartition`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.Python.LanguageServer.Implementation.Server.GetModuleVariablesAsync(ProjectEntry entry, GetMemberOptions opts, String prefix, Int32 timeout, CancellationToken token)
   at Microsoft.Python.LanguageServer.Implementation.Server.WorkspaceSymbols(WorkspaceSymbolParams params, CancellationToken cancellationToken)
   at Microsoft.Python.LanguageServer.Implementation.LanguageServer.WorkspaceSymbols(JToken token, CancellationToken cancellationToken)

Activity

  1. jakebailey commented on Nov 9, 2018

    @jakebailey
    Member

    I know that the scikit-learn project is pretty large and PLS takes a while to go through it, but are you doing this Ctrl+T and # after it's finished, or near the beginning of the analysis?

    I think I have an idea of the problem, but haven't been able to reproduce it with scikit-learn using what you had reported in the VSC extension repo.

  2. ogrisel commented on Nov 10, 2018

    @ogrisel
    Author

    I did ctrl-t while it was indexing I think (100% cpu). I did ctrl-t at the end as well and it did not work either.

    Does VS Code symbol navigation work for you on the scikit-learn source folder with the MS language server? I have never see it work so far.

  3. ogrisel commented on Nov 10, 2018

    @ogrisel
    Author

    I think I could not see the error output without waiting for 10+ minutes though (if I recall correctly).

  4. jakebailey commented on Nov 10, 2018

    @jakebailey
    Member

    The current implementation waits for the entire analysis to complete before allowing these sorts of lookups to happen (for better or worse). But, even when I remove those checks and allow queries through when it's still working, I wasn't able to get the issue to happen, and I'll get search results (though it's slow to finish, maybe 10 seconds to find "kmeans").

    I'm still looking for ways this nullref is happening, though. I may just have to "fix" it for now by ignoring nulls until we can actually catch the null while debugging.

  5. ogrisel commented on Nov 10, 2018

    @ogrisel
    Author

    I tried a fresh clone of scikit-learn in my /tmp folder, I opened a python file to trigger the python specific things for that project, then waited 15 minutes or more (checking in htop from time to time when the Microsoft.Python.LanguageServer process would stop using 100% of one of my CPUs).

    When done I pressed ctrl-T only once (without typing anything else) and got the error message I already reported earlier (and no results in the navigation menu).

    I am running Linux, maybe this is a Linux specific bug?

  6. jakebailey commented on Nov 10, 2018

    @jakebailey
    Member

    I'll give it a go on my Arch machine with the instructions you've given and see how it goes.

  7. jakebailey commented on Nov 10, 2018

    @jakebailey
    Member

    Aha, yes, after letting it run to completion (I opened sklearn/neighbors/classification.py) and hitting Ctrl+T, it throws that exception, and no further symbol requests work either (which is surprising itself).

    I'll look into it, but might only be able to actually figure it out on Monday when I have VS in front of me.

  8. ogrisel commented on Nov 10, 2018

    @ogrisel
    Author

    Glad you could reproduce it. Thanks.

  9. changed the title [-]"Object reference not set to an instance of an object" when trying Go To Symbol in Workspace on the scikit-learn source folder[/-] [+]"Object reference not set to an instance of an object" when trying Go To Symbol in Workspace[/+] on Nov 19, 2018
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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions