
Hello,
I have 2 questions about the AST.
1:
I need to get the latest AST every time just after an end user types "if[ENTER_KEY]" to support auto-indent function.
But the SyntaxEditor.Document.ParseData.Ast is not always the latest when "NotifyDocumentTextChanged" callback is called.
So, please tell me how to get the latest AST when "IEditorDocumentTextChangeEventSink.NotifyDocumentTextChanged" callback is called.
Is it OK to call SyntaxLanguageParsingExtensions' "Parse" method every time "NotifyDocumentTextChanged" is called?
Or is there a better way to achieve this?
My current code is like below;
void IEditorDocumentTextChangeEventSink.NotifyDocumentTextChanged(SyntaxEditor editor, EditorSnapshotChangedEventArgs e) {
if (e.TextChange.Type != TextChangeTypes.Enter) {
return;
}
...
ILLParseData parseData = (ILLParseData) editor.Document.Language.Parse(e.NewSnapshot.Text);
...
}
2:
The documentation "Walkthrough: Callbacks and Error Handling" says, "An Error node is inserted when a non-terminal fails to match.."
I tried QuickStarts "4c - Error Handling" and input invalid text there but "Document Outline" pane did not show any "Error" node.
Are there any other conditions that are not written on the documentation in order to have an "Error" node?