TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

NullReferenceException in Scanner.GetTokenStartingFrom

Open efr15 opened this issue 1 year ago • 1 comments

Describe the bug A NullReferenceException occurred in method GetTokenStartingFrom.

Stacktrace is:

   à TypeCobol.Compiler.Scanner.Scanner.GetTokenStartingFrom(Int32 startIndex)
    à TypeCobol.Compiler.Scanner.Scanner.ScanTokensLine(TokensLine tokensLine, MultilineScanState initialScanState, TypeCobolOptions compilerOptions, List`1 copyTextNameVariations, BitArray multiStringConcatBitPosition)
    à 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)

parser version: v1.6.5.

To Reproduce TODO

Expected behavior No exception.

Technical TODO

How to test automatically Standard test

efr15 avatar Sep 05 '23 12:09 efr15