TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

IndexOutOfRangeException in Scanner.ScanTokensLineContinuationGroup

Open fm-117 opened this issue 1 year ago • 0 comments

Describe the bug Index was outside the bounds of the array. (IndexOutOfRangeException) is thrown by Scanner.ScanTokensLineContinuationGroup.

Stacktrace

   à TypeCobol.Compiler.Scanner.Scanner.ScanTokensLineContinuationGroup(IList`1 continuationLinesGroup, MultilineScanState initialScanState, ColumnsLayout format, TypeCobolOptions compilerOptions, List`1 copyTextNameVariations)
   à TypeCobol.Compiler.Scanner.ScannerStep.ScanTokensLineWithContinuations(Int32 lineToScanIndex, TokensLine lineToScan, TextSourceInfo textSourceInfo, ISearchableReadOnlyList`1 documentLines, PrepareDocumentLineForUpdate prepareDocumentLineForUpdate, TypeCobolOptions compilerOptions, List`1 copyTextNameVariations, IList`1 tokensLinesChanges, MultilineScanState scanState, Int32& nextLineToScanIndex, TokensLine& nextLineToScan)
   à TypeCobol.Compiler.Scanner.ScannerStep.ScanTokensLineWithMultilineScanState(Int32 lineToScanIndex, TokensLine lineToScan, TextSourceInfo textSourceInfo, ISearchableReadOnlyList`1 documentLines, PrepareDocumentLineForUpdate prepareDocumentLineForUpdate, TypeCobolOptions compilerOptions, List`1 copyTextNameVariations, IList`1 tokensLinesChanges, MultilineScanState scanState, Int32& nextLineToScanIndex, TokensLine& nextLineToScan)
   à TypeCobol.Compiler.Scanner.ScannerStep.ScanTextLinesChanges(TextSourceInfo textSourceInfo, ISearchableReadOnlyList`1 documentLines, IList`1 textLinesChanges, PrepareDocumentLineForUpdate prepareDocumentLineForUpdate, TypeCobolOptions compilerOptions, List`1 copyTextNameVariations, MultilineScanState scanState)
   à TypeCobol.Compiler.CompilationDocument.UpdateTokensLines(Action onVersion)
   à TypeCobol.Compiler.FileCompiler.CompileOnce(Nullable`1 exec2Step, Boolean haltOnMissingCopy)
   à TypeCobol.LanguageServer.Workspace.UpdateSourceFile(Uri fileUri, RangeUpdate[] updates)
   à TypeCobol.LanguageServer.TypeCobolServer.OnDidChangeTextDocument(DidChangeTextDocumentParams parameters)
   à TypeCobol.LanguageServer.VsCodeProtocol.LanguageServer.CallDidChangeTextDocument(NotificationType notificationType, Object parameters, LSPProfiling lspProfiling)

To Reproduce TODO

Expected behavior No exception

Technical Check array access in the method

How to test automatically Standard test

fm-117 avatar Jul 07 '23 06:07 fm-117