syncSyntax<State> method
TextSyntaxSnapshot<State>
syncSyntax<State>(
- TextSyntaxSession<
State> session, { - String? language,
- bool force = false,
Incrementally synchronizes session and updates the dedicated syntax
decoration layer without disturbing search or diagnostics.
Implementation
TextSyntaxSnapshot<State> syncSyntax<State>(
TextSyntaxSession<State> session, {
String? language,
bool force = false,
}) {
if (!force && !workAssessment.allowSynchronousSyntax) {
return session.snapshot ??
TextSyntaxSnapshot<State>(
decorations: decorationsForLayer(textSyntaxDecorationLayerKey),
language: language ?? session.language,
document: _document,
);
}
final snapshot = session.syncDocument(
_document,
language: language,
force: force,
change: _lastDocumentChange,
);
setDecorationLayer(
textSyntaxDecorationLayerKey,
snapshot.decorations,
priority: textSyntaxDecorationLayerPriority,
);
return snapshot;
}