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.
Import with ",." throws out of bounds exception #738
Closed
Description
import os,.
Type the .
after the ,
, and you get:
[Error - 5:10:47 PM] Request textDocument/completion failed.
Message: Index was outside the bounds of the array.
Code: -32000
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleImport(ModuleName moduleImportExpression, NameExpression asNameExpression, Boolean forceAbsolute) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\Handlers\ImportHandler.cs:line 53
at Microsoft.Python.Analysis.Analyzer.Handlers.ImportHandler.HandleImport(ImportStatement node) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\Handlers\ImportHandler.cs:line 43
at Microsoft.Python.Parsing.Ast.ImportStatement.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\ImportStatement.cs:line 51
at Microsoft.Python.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\SuiteStatement.cs:line 38
at Microsoft.Python.Parsing.Ast.PythonAst.Walk(PythonWalker walker) in C:\Users\jabaile\python-language-server\src\Parsing\Impl\Ast\PythonAst.cs:line 82
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.Analyze(IDependencyChainNode`1 node, Int32 version, Stopwatch stopWatch, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzer.cs:line 275
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzerEntry.<>c.<GetAnalysisAsync>b__27_0(Task`1 t) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzerEntry.cs:line 48
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(PythonAnalyzerEntry entry, CancellationToken timeoutCt, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzer.cs:line 91
at Microsoft.Python.Analysis.Analyzer.PythonAnalyzer.GetAnalysisAsync(IPythonModule module, Int32 waitTime, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\Analysis\Ast\Impl\Analyzer\PythonAnalyzer.cs:line 84
at Microsoft.Python.LanguageServer.Implementation.Server.Completion(CompletionParams params, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\Implementation\Server.Editor.cs:line 36
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Completion(JToken token, CancellationToken cancellationToken) in C:\Users\jabaile\python-language-server\src\LanguageServer\Impl\LanguageServer.cs:line 239