Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WI #1350 Make changes to avoid theses index out of range exceptions #1352

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions TypeCobol.LanguageServer.Test/LSRTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,40 @@ public void FormalizedCommentIncScan()
LSRTestHelper.Test("FormalizedCommentIncScan", LsrTestingOptions.NoLsrTesting, false, true);
}

/// <summary>
/// This test is releated to issue:https://github.com/TypeCobolTeam/TypeCobol/issues/1350
/// The following steps were raising an exception, before the fix.
///
/// Inside TypeCobol Editor:
/// - Go to the beginning of a line for instance in the middle of a document
/// - Ctrl+Shift+End
/// - Suppr
/// - Ctrl+S
/// - Ctrl+Z
/// </summary>
[TestMethod]
[TestCategory("Incremental")]
public void SelectEndSuppressSaveUndo()
{
LSRTestHelper.Test("SelectEndSuppressSaveUndo", LsrTestingOptions.NoLsrTesting, false);
}

/// <summary>
/// This test is releated to issue:https://github.com/TypeCobolTeam/TypeCobol/issues/1350
/// The following steps were raising an exception, before the fix.
///
/// Inside TypeCobol Editor:
/// - Goto the beginning of the first line of a document.
/// - Enter
/// - Enter
/// </summary>
[TestMethod]
[TestCategory("Incremental")]
public void BeginTopLineEnterEnter()
{
LSRTestHelper.Test("BeginTopLineEnterEnter", LsrTestingOptions.NoLsrTesting, false);
}

#endregion

#region SyntaxColoring
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "BeginTopLineEnterEnter.tlsp",
"session": "C:\\Users\\MAYANJE\\AppData\\Roaming\\TypeCobol.LanguageServerRobot\\Repository\\Session2019_04_12_12_24_02_073\\TestSuite_2019_04_12_12_24_02_073.slsp",
"user": "MAYANJE",
"date": "2019/04/12 12:24:02 093",
"uri": "file:///C:/Users/MAYANJE/Source/Repos/1350_LSRaiseExceptions/TypeCobol/TypeCobol.LanguageServer.Test/LSRTests/BeginTopLineEnterEnter/BeginTopLineEnterEnter.tlsp",
"initialize": "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"initialize\",\"params\":{\"processId\":-1,\"rootPath\":\"C:\\\\Users\\\\MAYANJE\\\\Source\\\\Repos\\\\1350_LSRaiseExceptions\\\\TypeCobol\\\\bin\\\\Debug\",\"rootUri\":\"file:/C:/Users/MAYANJE/Source/Repos/1350_LSRaiseExceptions/TypeCobol/bin/Debug/\",\"capabilities\":{\"workspace\":{\"applyEdit\":true,\"didChangeConfiguration\":{\"dynamicRegistration\":true},\"didChangeWatchedFiles\":{\"dynamicRegistration\":false},\"symbol\":{\"dynamicRegistration\":true},\"executeCommand\":{\"dynamicRegistration\":true}},\"textDocument\":{\"synchronization\":{\"willSave\":true,\"willSaveWaitUntil\":true,\"dynamicRegistration\":true},\"completion\":{\"completionItem\":{\"snippetSupport\":true},\"dynamicRegistration\":true},\"hover\":{\"dynamicRegistration\":true},\"signatureHelp\":{\"dynamicRegistration\":true},\"references\":{\"dynamicRegistration\":true},\"documentHighlight\":{\"dynamicRegistration\":true},\"documentSymbol\":{\"dynamicRegistration\":true},\"formatting\":{\"dynamicRegistration\":true},\"rangeFormatting\":{\"dynamicRegistration\":true},\"onTypeFormatting\":{\"dynamicRegistration\":true},\"definition\":{\"dynamicRegistration\":true},\"codeAction\":{\"dynamicRegistration\":true},\"codeLens\":{\"dynamicRegistration\":true},\"documentLink\":{\"dynamicRegistration\":true},\"rename\":{\"dynamicRegistration\":true}}},\"trace\":\"off\"}}",
"initialize_result": "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":false,\"triggerCharacters\":[\"::\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":false,\"documentHighlightProvider\":false,\"documentSymbolProvider\":false,\"workspaceSymbolProvider\":false,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}",
"did_change_configuation": "{\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":[\"C:\\\\Users\\\\MAYANJE\\\\Source\\\\Repos\\\\1350_LSRaiseExceptions\\\\TypeCobol\\\\bin\\\\Debug\\\\TypeCobol.CLI.exe\",\"-1\",\"-s\",\"C:\\\\TypeCobol\\\\Sources\\\\##Latest_Release##\\\\skeletons.xml\",\"-e\",\"rdz\",\"-c\",\"C:\\\\TypeCobol\\\\Copys\",\"-y\",\"C:\\\\TypeCobol\\\\Sources\\\\##Latest_Release##\\\\Intrinsic\\\\Intrinsic.txt\",\"--autoremarks\",\"--outputFormat\\u003dCobol85Mixed\",\"-md\",\"30\"]}}",
"didOpen": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didOpen\",\"params\":{\"textDocument\":{\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"languageId\":\"__lsp4j_TypeCobol\",\"version\":0,\"text\":\" IDENTIFICATION DIVISION.\\r\\n PROGRAM-ID. DVZXERRM.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n LINKAGE SECTION.\\r\\n * 66 RPOINT2 RENAMES RX OF MPOINT THRU RY OF MPOINT.\\r\\n\\r\\n * A true comment\\r\\n PROCEDURE DIVISION.\\r\\n\\r\\n * INNER Cannot be seen by the parent, event if it global\\r\\n * DISPLAY INNER0.\\r\\n * DISPLAY DOIT2 OF PITS3 OF PITS.\\r\\n declare procedure TT PUBLIC.\\r\\n D input a TYPE MyT.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n 01 MyT TYPEDEF STRICT PIC X(9).\\r\\n procedure division.\\r\\n .\\r\\n end-declare.\\r\\n\\r\\n END PROGRAM DVZXERRM.\"}}}",
"messages": [
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"diagnostics\":[]}}"
},
{
"category": 0,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didChange\",\"params\":{\"textDocument\":{\"version\":0,\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\"},\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"contentChanges\":[{\"range\":{\"start\":{\"line\":0,\"character\":0},\"end\":{\"line\":0,\"character\":0}},\"rangeLength\":-1,\"text\":\"\\r\\n\"}]}}"
},
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"diagnostics\":[]}}"
},
{
"category": 0,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didChange\",\"params\":{\"textDocument\":{\"version\":0,\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\"},\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"contentChanges\":[{\"range\":{\"start\":{\"line\":1,\"character\":0},\"end\":{\"line\":1,\"character\":0}},\"rangeLength\":0,\"text\":\"\\r\\n\"}]}}"
},
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\",\"diagnostics\":[]}}"
}
],
"didClose": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didClose\",\"params\":{\"textDocument\":{\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM52426283183559897214.cee\"}}}",
"IsValid": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"success": true,
"diff_index": [
-1
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "SelectEndSuppressSaveUndo.tlsp",
"session": "C:\\Users\\MAYANJE\\AppData\\Roaming\\TypeCobol.LanguageServerRobot\\Repository\\Session2019_04_12_12_12_24_908\\TestSuite_2019_04_12_12_12_24_908.slsp",
"user": "MAYANJE",
"date": "2019/04/12 12:12:24 928",
"uri": "file:///C:/Users/MAYANJE/Source/Repos/1350_LSRaiseExceptions/TypeCobol/TypeCobol.LanguageServer.Test/LSRTests/SelectEndSuppressSaveUndo/SelectEndSuppressSaveUndo.tlsp",
"initialize": "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"initialize\",\"params\":{\"processId\":-1,\"rootPath\":\"C:\\\\Users\\\\MAYANJE\\\\Source\\\\Repos\\\\1350_LSRaiseExceptions\\\\TypeCobol\\\\bin\\\\Debug\",\"rootUri\":\"file:/C:/Users/MAYANJE/Source/Repos/1350_LSRaiseExceptions/TypeCobol/bin/Debug/\",\"capabilities\":{\"workspace\":{\"applyEdit\":true,\"didChangeConfiguration\":{\"dynamicRegistration\":true},\"didChangeWatchedFiles\":{\"dynamicRegistration\":false},\"symbol\":{\"dynamicRegistration\":true},\"executeCommand\":{\"dynamicRegistration\":true}},\"textDocument\":{\"synchronization\":{\"willSave\":true,\"willSaveWaitUntil\":true,\"dynamicRegistration\":true},\"completion\":{\"completionItem\":{\"snippetSupport\":true},\"dynamicRegistration\":true},\"hover\":{\"dynamicRegistration\":true},\"signatureHelp\":{\"dynamicRegistration\":true},\"references\":{\"dynamicRegistration\":true},\"documentHighlight\":{\"dynamicRegistration\":true},\"documentSymbol\":{\"dynamicRegistration\":true},\"formatting\":{\"dynamicRegistration\":true},\"rangeFormatting\":{\"dynamicRegistration\":true},\"onTypeFormatting\":{\"dynamicRegistration\":true},\"definition\":{\"dynamicRegistration\":true},\"codeAction\":{\"dynamicRegistration\":true},\"codeLens\":{\"dynamicRegistration\":true},\"documentLink\":{\"dynamicRegistration\":true},\"rename\":{\"dynamicRegistration\":true}}},\"trace\":\"off\"}}",
"initialize_result": "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"result\":{\"capabilities\":{\"textDocumentSync\":2,\"hoverProvider\":true,\"completionProvider\":{\"resolveProvider\":false,\"triggerCharacters\":[\"::\"]},\"signatureHelpProvider\":{\"triggerCharacters\":[]},\"definitionProvider\":true,\"referencesProvider\":false,\"documentHighlightProvider\":false,\"documentSymbolProvider\":false,\"workspaceSymbolProvider\":false,\"codeActionProvider\":false,\"documentFormattingProvider\":false,\"documentRangeFormattingProvider\":false,\"renameProvider\":false}}}",
"did_change_configuation": "{\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":[\"C:\\\\Users\\\\MAYANJE\\\\Source\\\\Repos\\\\1350_LSRaiseExceptions\\\\TypeCobol\\\\bin\\\\Debug\\\\TypeCobol.CLI.exe\",\"-1\",\"-s\",\"C:\\\\TypeCobol\\\\Sources\\\\##Latest_Release##\\\\skeletons.xml\",\"-e\",\"rdz\",\"-c\",\"C:\\\\TypeCobol\\\\Copys\",\"-y\",\"C:\\\\TypeCobol\\\\Sources\\\\##Latest_Release##\\\\Intrinsic\\\\Intrinsic.txt\",\"--autoremarks\",\"--outputFormat\\u003dCobol85Mixed\",\"-md\",\"30\"]}}",
"didOpen": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didOpen\",\"params\":{\"textDocument\":{\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"languageId\":\"__lsp4j_TypeCobol\",\"version\":0,\"text\":\" IDENTIFICATION DIVISION.\\r\\n PROGRAM-ID. DVZXERRM.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n LINKAGE SECTION.\\r\\n * 66 RPOINT2 RENAMES RX OF MPOINT THRU RY OF MPOINT.\\r\\n\\r\\n * A true comment\\r\\n PROCEDURE DIVISION.\\r\\n\\r\\n * INNER Cannot be seen by the parent, event if it global\\r\\n * DISPLAY INNER0.\\r\\n * DISPLAY DOIT2 OF PITS3 OF PITS.\\r\\n declare procedure TT PUBLIC.\\r\\n D input a TYPE MyT.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n 01 MyT TYPEDEF STRICT PIC X(9).\\r\\n procedure division.\\r\\n .\\r\\n end-declare.\\r\\n\\r\\n END PROGRAM DVZXERRM.\"}}}",
"messages": [
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"diagnostics\":[]}}"
},
{
"category": 0,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didChange\",\"params\":{\"textDocument\":{\"version\":0,\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\"},\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"contentChanges\":[{\"range\":{\"start\":{\"line\":5,\"character\":0},\"end\":{\"line\":22,\"character\":28}},\"rangeLength\":508,\"text\":\"\"}]}}"
},
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"diagnostics\":[{\"range\":{\"start\":{\"line\":1,\"character\":8},\"end\":{\"line\":1,\"character\":28}},\"severity\":2,\"code\":\"37\",\"source\":\"\",\"message\":\"Warning: \\\"END PROGRAM\\\" is missing.\"}]}}"
},
{
"category": 0,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didSave\",\"params\":{\"textDocument\":{\"version\":0,\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\"},\"text\":\" IDENTIFICATION DIVISION.\\r\\n PROGRAM-ID. DVZXERRM.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n LINKAGE SECTION.\\r\\n\"}}"
},
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"diagnostics\":[{\"range\":{\"start\":{\"line\":1,\"character\":8},\"end\":{\"line\":1,\"character\":28}},\"severity\":2,\"code\":\"37\",\"source\":\"\",\"message\":\"Warning: \\\"END PROGRAM\\\" is missing.\"}]}}"
},
{
"category": 0,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didChange\",\"params\":{\"textDocument\":{\"version\":0,\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\"},\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"contentChanges\":[{\"range\":{\"start\":{\"line\":5,\"character\":0},\"end\":{\"line\":5,\"character\":0}},\"rangeLength\":0,\"text\":\" * 66 RPOINT2 RENAMES RX OF MPOINT THRU RY OF MPOINT.\\r\\n\\r\\n * A true comment\\r\\n PROCEDURE DIVISION.\\r\\n\\r\\n * INNER Cannot be seen by the parent, event if it global\\r\\n * DISPLAY INNER0.\\r\\n * DISPLAY DOIT2 OF PITS3 OF PITS.\\r\\n declare procedure TT PUBLIC.\\r\\n D input a TYPE MyT.\\r\\n DATA DIVISION.\\r\\n WORKING-STORAGE SECTION.\\r\\n 01 MyT TYPEDEF STRICT PIC X(9).\\r\\n procedure division.\\r\\n .\\r\\n end-declare.\\r\\n\\r\\n END PROGRAM DVZXERRM.\"}]}}"
},
{
"category": 1,
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\",\"diagnostics\":[]}}"
}
],
"didClose": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didClose\",\"params\":{\"textDocument\":{\"uri\":\"file:/C:/Users/MAYANJE/AppData/Local/Temp/1/tcbl/DVZZJCM5496314490461340137.cee\"}}}",
"IsValid": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"success": true,
"diff_index": [
-1
]
}
12 changes: 12 additions & 0 deletions TypeCobol.LanguageServer.Test/TypeCobol.LanguageServer.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="LSRTests\BeginTopLineEnterEnter\input\BeginTopLineEnterEnter.tlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LSRTests\BeginTopLineEnterEnter\output_expected\BeginTopLineEnterEnter.rlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LSRTests\FormalizedCommentIncScan\input\FormalizedCommentIncScan.tlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -304,6 +310,12 @@
<None Include="LSRTests\ReplacingSyntaxOff\output_expected\replacingSyntaxOff.rlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LSRTests\SelectEndSuppressSaveUndo\input\SelectEndSuppressSaveUndo.tlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LSRTests\SelectEndSuppressSaveUndo\output_expected\SelectEndSuppressSaveUndo.rlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LSRTests\SetToAddressOfCompletion\input\SetToAddressOfCompletion.tlsp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
7 changes: 4 additions & 3 deletions TypeCobol.LanguageServer/TypeCobolServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ public override void OnDidChangeTextDocument(DidChangeTextDocumentParams paramet
}

// Document cleared
if (contentChange.range == null || contentChange.rangeLength == -1)
if (contentChange.range == null)
{
//JCM: I have noticed that if the entire text has changed, is better to reload the entire file
//To avoid crashes.
try
{
docContext.LanguageServerConnection(false);
typeCobolWorkspace.OpenTextDocument(docContext, contentChange.text, this.Workspace.LsrTestOptions);
return;
}
Expand All @@ -211,7 +212,8 @@ public override void OnDidChangeTextDocument(DidChangeTextDocumentParams paramet
else if (docContext.FileCompiler.CompilationResultsForProgram.CobolTextLines.Count != 0)
{
// Get original lines text before change
string originalFirstLineText =
int lineCount = docContext.FileCompiler.CompilationResultsForProgram.CobolTextLines.Count;
string originalFirstLineText = lineCount <= contentChange.range.start.line ? "" :
docContext.FileCompiler.CompilationResultsForProgram.CobolTextLines[contentChange.range.start.line]
.Text;
string originalLastLineText = originalFirstLineText;
Expand Down Expand Up @@ -319,7 +321,6 @@ public override void OnDidChangeTextDocument(DidChangeTextDocumentParams paramet
{
RemoteConsole.Log(" - " + textChange.ToString());
}

}

public override void OnDidCloseTextDocument(DidCloseTextDocumentParams parameters)
Expand Down
2 changes: 1 addition & 1 deletion TypeCobol/Compiler/CompilationDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public void UpdateTextLines(TextChangedEvent textChangedEvent)
case TextChangeType.LineRemoved:
if (compilationDocumentLines.LastOrDefault() == null)
continue;
if (compilationDocumentLines.Count < textChange.LineIndex) //Avoid line remove exception
if (compilationDocumentLines.Count <= textChange.LineIndex) //Avoid line remove exception
continue;

compilationDocumentLines.RemoveAt(textChange.LineIndex);
Expand Down