Language Server: System.NullReferenceException: Object reference not set to an instance of an object. #2523
Labels
area-intellisense
LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
bug
Issue identified by VS Code Team member as probable bug
Environment data
Actual behavior
Output for
Python
in theOutput
panel opens with a "System.NullReferenceException" error after typing "from ." in an "__init__.py" file.Expected behavior
No error
Steps to reproduce:
The error occurs after typing the dot. The error does not occur with other file names (e.g. "some_file.py"). I cannot tell if this is related to a closed issue with a similar error.
Screenshots at the bottom.
Logs
Output for
Python
in theOutput
panel:[Error - 8:33:17 AM] System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PythonTools.Analysis.ModuleResolver.GetModuleFullName(String originatingModule, String relativePath)
at Microsoft.PythonTools.Analysis.ModuleResolver.ResolvePotentialModuleNames(String importingFromModuleName, String importingFromFilePath, String relativeModuleName, Boolean absoluteImports)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder
1.AddRange(IEnumerable
1 items)at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable
1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)at Microsoft.PythonTools.Analysis.Analyzer.DDG.TryImportModule(String modName, Boolean forceAbsolute, ModuleReference& moduleRef, IReadOnlyList
1& remainingParts) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node) at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node) at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.AnalysisUnit.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()
Output from
Console
under theDeveloper Tools
panel:None
Screenshots
vscode

vscode-insider

The text was updated successfully, but these errors were encountered: