{"action":"created","issue":{"url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/124","labels_url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/124/comments","events_url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/124/events","html_url":"https://github.com/TypeCobolTeam/TypeCobol/issues/124","id":115290359,"number":124,"title":"Multi-pass parsing","user":{"login":"wiztigers","id":13147832,"avatar_url":"https://avatars.githubusercontent.com/u/13147832?v=3","gravatar_id":"","url":"https://api.github.com/users/wiztigers","html_url":"https://github.com/wiztigers","followers_url":"https://api.github.com/users/wiztigers/followers","following_url":"https://api.github.com/users/wiztigers/following{/other_user}","gists_url":"https://api.github.com/users/wiztigers/gists{/gist_id}","starred_url":"https://api.github.com/users/wiztigers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiztigers/subscriptions","organizations_url":"https://api.github.com/users/wiztigers/orgs","repos_url":"https://api.github.com/users/wiztigers/repos","events_url":"https://api.github.com/users/wiztigers/events{/privacy}","received_events_url":"https://api.github.com/users/wiztigers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/labels/Tests","name":"Tests","color":"666666"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/milestones/14","html_url":"https://github.com/TypeCobolTeam/TypeCobol/milestones/Server:%20multipass","labels_url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/milestones/14/labels","id":1395607,"number":14,"title":"Server: multipass","description":"Create a server that clients can use not only to parse a given document once, but to tell it how the document was modified, and get the correct parsing result each time, too.\r\n","creator":{"login":"wiztigers","id":13147832,"avatar_url":"https://avatars.githubusercontent.com/u/13147832?v=3","gravatar_id":"","url":"https://api.github.com/users/wiztigers","html_url":"https://github.com/wiztigers","followers_url":"https://api.github.com/users/wiztigers/followers","following_url":"https://api.github.com/users/wiztigers/following{/other_user}","gists_url":"https://api.github.com/users/wiztigers/gists{/gist_id}","starred_url":"https://api.github.com/users/wiztigers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiztigers/subscriptions","organizations_url":"https://api.github.com/users/wiztigers/orgs","repos_url":"https://api.github.com/users/wiztigers/repos","events_url":"https://api.github.com/users/wiztigers/events{/privacy}","received_events_url":"https://api.github.com/users/wiztigers/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-11-05T13:42:05Z","updated_at":"2015-11-05T14:08:21Z","due_on":"2015-12-30T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-11-05T14:08:21Z","updated_at":"2015-11-05T14:10:26Z","closed_at":null,"body":"I'm attempting to write a test asserting that you can parse a document, then modify it and reparse it a given number of times, and that the code elements are always consistent with the modifications.\r\nI saw that `TestCollection.CheckPipeline` tests are totaly empty, so I tried to roll my own in d9f4fafda5639c70a65ff4deaf728a4718ca7f9d.\r\n\r\nI'm trying to wrap my head around how this should be done, and it seems either I went the wrong direction, or there is something off with the current implementation.\r\n\r\nProblem is: wether I update or remove a given line, or even clear the whole document, the resulting code elements are not as expected.\r\nFor example, clearing the following document ...\r\n```cobol\r\nIDENTIFICATION DIVISION.\r\n  PROGRAM-ID. Empty.\r\n```\r\n... gives a parsing result corresponding to this document:\r\n```cobol\r\nIDENTIFICATION DIVISION.\r\nIDENTIFICATION DIVISION.\r\n```\r\n\r\nHow I attempt to do the test can be seen in d9f4fafda5639c70a65ff4deaf728a4718ca7f9d, but to summarize:\r\n```csharp\r\n...\r\n// ... document is Sample/Programs/Empty.cbl ...\r\nvar compiler = new FileCompiler(null, filename, project.SourceFileProvider, \r\n                                project, format.ColumnsLayout, options, false);\r\ncompiler.CompileOnce();\r\n// ... compare CodeElements with ResultFiles/Programs/Empty.0.txt ...\r\n\r\n// ... create an event TextChangeType.LineInserted, line=2, and text \"END PROGRAM Empty.\"\r\ncompiler.CompilationResultsForProgram.UpdateTextLines(e);\r\ncompiler.CompileOnce();\r\n// ... compare CodeElements with ResultFiles/Programs/Empty.1.txt ...\r\n\r\n// ... create an event TextChangeType.LineUpdated, line=1, and text \"PROGRAM-ID. Emptier.\"\r\ncompiler.CompilationResultsForProgram.UpdateTextLines(e);\r\ncompiler.CompileOnce();\r\n// ... compare CodeElements with ResultFiles/Programs/Empty.2.txt ...\r\n\r\n// ... create an event TextChangeType.DocumentCleared\r\ncompiler.CompilationResultsForProgram.UpdateTextLines(e);\r\ncompiler.CompileOnce();\r\n// ... compare CodeElements with ResultFiles/Programs/Empty.3.txt\r\n```"},"comment":{"url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/comments/154068007","html_url":"https://github.com/TypeCobolTeam/TypeCobol/issues/124#issuecomment-154068007","issue_url":"https://api.github.com/repos/TypeCobolTeam/TypeCobol/issues/124","id":154068007,"user":{"login":"wiztigers","id":13147832,"avatar_url":"https://avatars.githubusercontent.com/u/13147832?v=3","gravatar_id":"","url":"https://api.github.com/users/wiztigers","html_url":"https://github.com/wiztigers","followers_url":"https://api.github.com/users/wiztigers/followers","following_url":"https://api.github.com/users/wiztigers/following{/other_user}","gists_url":"https://api.github.com/users/wiztigers/gists{/gist_id}","starred_url":"https://api.github.com/users/wiztigers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiztigers/subscriptions","organizations_url":"https://api.github.com/users/wiztigers/orgs","repos_url":"https://api.github.com/users/wiztigers/repos","events_url":"https://api.github.com/users/wiztigers/events{/privacy}","received_events_url":"https://api.github.com/users/wiztigers/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T14:10:26Z","updated_at":"2015-11-05T14:10:26Z","body":"@laurentprudhon @prudholu  , any ideas ?\r\nRather than using `UpdateTextLines`, shouldn't I provide a custom implementation of `TextDocument`, mirroring the client's line modifications ?\r\nBut then, how can I poke the parser so it re-parses only what has changed ?"}}