You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
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
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)
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.
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.
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?
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.
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
Activity
jakebailey commentedon Nov 9, 2018
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.
ogrisel commentedon Nov 10, 2018
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.
ogrisel commentedon Nov 10, 2018
I think I could not see the error output without waiting for 10+ minutes though (if I recall correctly).
jakebailey commentedon Nov 10, 2018
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.
ogrisel commentedon Nov 10, 2018
I tried a fresh clone of scikit-learn in my
/tmpfolder, 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 theMicrosoft.Python.LanguageServerprocess 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?
jakebailey commentedon Nov 10, 2018
I'll give it a go on my Arch machine with the instructions you've given and see how it goes.
jakebailey commentedon Nov 10, 2018
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.
ogrisel commentedon Nov 10, 2018
Glad you could reproduce it. Thanks.
[-]"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[/+]