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

Probably a bug of Microsoft Python Language Server #3970

Closed
jerryc05 opened this issue Jan 13, 2019 · 4 comments
Closed

Probably a bug of Microsoft Python Language Server #3970

jerryc05 opened this issue Jan 13, 2019 · 4 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@jerryc05
Copy link

Environment data

  • VS Code version: 1.31.0 insider
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: Win10 1809
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

no error output

Actual behaviour

error output after opening a .py file

Steps to reproduce:

  1. open a .py file and wait a few second

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)



Microsoft Python Language Server version 0.1.72.0
Initializing for [hidden]\python.exe
[Error - 12:32:39 AM] System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PythonTools.Analysis.AnalysisSet.Split[T](IAnalysisSet set, IReadOnlyList`1& ofType, IAnalysisSet& rest)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.FinalizeNames(IAnalysisSet types)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluatorAnnotationConverter.MakeGeneric(IAnalysisSet baseType, IReadOnlyList`1 args)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.MakeGenericOp.Apply[T](TypeAnnotationConverter`1 converter, Stack`1 stack)
   at Microsoft.PythonTools.Parsing.Ast.TypeAnnotation.Walker.GetResult[T](TypeAnnotationConverter`1 converter)
   at Microsoft.PythonTools.Analysis.Values.TypingTypeInfo.<>c__DisplayClass8_0.<GetIndex>b__0(Node n)
   at Microsoft.PythonTools.Analysis.Analyzer.InterpreterScope.GetOrMakeNodeValue(Node node, NodeValueKind kind, Func`2 maker)
   at Microsoft.PythonTools.Analysis.AnalysisValueSetExtensions.GetIndex(IAnalysisSet self, Node node, AnalysisUnit unit, IAnalysisSet index)
   at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Node node)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ReturnStatement node)
   at Microsoft.PythonTools.Parsing.Ast.ReturnStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
   at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
   at Microsoft.PythonTools.Analysis.Analyzer.FunctionAnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
   at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
   at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken)
   at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()
##########Linting Output - pylint##########

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXX
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 13, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 14, 2019
@karrtikr
Copy link

karrtikr commented Jan 14, 2019

You are using Microsoft Python Language Server version 0.1.72.0 as visible in Output panel, try updating to the latest version.
Check Issue #3977 with instructions on how to install the latest version of the language server:

@karrtikr karrtikr removed the triage label Jan 14, 2019
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 14, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 14, 2019
@jerryc05
Copy link
Author

@karrtikr Hi, I upgraded Language Server to the latest 0.1.75.0 and the problem still exists. I even tried to change to the python distribution from python.org, but nothing changed. Any clue to fix it? thanks.

@karrtikr
Copy link

karrtikr commented Jan 15, 2019

@jerryc05 Try reinstalling the vscode, Python extension to the latest version as well. There might be compatibility issues.

You can try troubleshooting using PYTHON_INTERACTIVE_TROUBLESHOOTING.md guide.

@jerryc05
Copy link
Author

@karrtikr Hi thank you for your advice but unfortunatelly it still did not work. Maybe I should submit an issue to the ms language server repo.

@karrtikr karrtikr added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. upstream-language server and removed triage labels Jan 17, 2019
@karrtikr karrtikr removed their assignment Jan 17, 2019
@karrtikr karrtikr added the bug Issue identified by VS Code Team member as probable bug label Jan 17, 2019
@jerryc05 jerryc05 changed the title Probably a bug of IntelliSense Probably a bug of Microsoft Python Language Server Jan 18, 2019
@ghost ghost removed the needs upstream fix label Jan 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants