The parser
What is still open in the parser: recovering inside an item, and a concrete syntax tree
How the lexer, the layout pass and the recursive-descent parser work, and how the parser reads past a mistake to the next top-level item, is in The parser in the Deep dives section. This page keeps what is still open.
Recovering inside an item
After a mistake, the parser leaves out the top-level item the mistake is in and reads on at the next one. It could recover inside an item too, at the next statement of a block or the next arm of a match, with an error node in the tree where the mistake was, so that the rest of the def being typed keeps its types. The type checker and the language server would then learn to skip error nodes. Until then the language server reads the last text that parsed for the item being typed.
A concrete syntax tree
Comments and whitespace travel with the lexer’s tokens, so the formatter and the refactorings could work from a tree that keeps every token and its trivia, instead of re-attaching comments by position. That is to be decided once the refactorings show whether they need one.