Skip to content

Probably a bug of Microsoft Python Language Server #3970

Description

@jerryc05

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 (View→Output, 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

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jan 13, 2019
  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 14, 2019
  3. karrtikr commented on Jan 14, 2019

    @karrtikr

    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:

  4. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jan 14, 2019
  5. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 14, 2019
  6. jerryc05 commented on Jan 15, 2019

    @jerryc05
    Author

    Kartik Raj (@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.

  7. karrtikr commented on Jan 15, 2019

    @karrtikr

    jerryc05 (@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.

  8. jerryc05 commented on Jan 17, 2019

    @jerryc05
    Author

    Kartik Raj (@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.

  9. removed their assignment
    on Jan 17, 2019
  10. changed the title [-]Probably a bug of IntelliSense[/-] [+]Probably a bug of Microsoft Python Language Server[/+] on Jan 18, 2019
  11. locked as resolved and limited conversation to collaborators on Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions