Class SynchronizationService
Encapsulates all logic for handling model changes and synchronizing across different parsers.
public class SynchronizationService
- Inheritance
-
SynchronizationService
- Inherited Members
Constructors
SynchronizationService(ILspServer, IModelServer, IEnumerable<IModelSynchronization>)
Initializes a new instance of the SynchronizationService class with a reference to the LSP server.
public SynchronizationService(ILspServer lspServer, IModelServer modelServer, IEnumerable<IModelSynchronization> synchronizations)
Parameters
lspServerILspServerThe language server instance for sending workspace edits.
modelServerIModelServerThe model server instance that is used by other syntaxes (GLSP Server).
synchronizationsIEnumerable<IModelSynchronization>the synchronizations supported by this service
Methods
CanSynchronize(Uri)
Indicates whether the given Uri can be synchronized
public bool CanSynchronize(Uri uri)
Parameters
uriUrithe uri of the document
Returns
- bool
true, if a synchronization is available, otherwise false
CompletePartnerUpdate(Parser)
Completes the update of the given document
public void CompletePartnerUpdate(Parser document)
Parameters
documentParserthe document that was updated
CompleteUpdate(IEnumerable<Uri>)
Completes the update of the given document
public void CompleteUpdate(IEnumerable<Uri> uris)
Parameters
urisIEnumerable<Uri>the uris of the document that was updated
CompleteUpdate(Uri)
Completes the update of the given document
public void CompleteUpdate(Uri uri)
Parameters
uriUrithe uri of the document that was updated
GetSynchronizations(Parser)
Gets inconsistencies for the given document
public IEnumerable<IRunningSynchronization> GetSynchronizations(Parser document)
Parameters
documentParserthe document for which inconsistencies should be calculated
Returns
- IEnumerable<IRunningSynchronization>
A collection of inconsistencies
GetSynchronizations(Uri)
Gets inconsistencies for the given document
public IEnumerable<IRunningSynchronization> GetSynchronizations(Uri document)
Parameters
documentUrithe document for which inconsistencies should be calculated
Returns
- IEnumerable<IRunningSynchronization>
A collection of inconsistencies
IsSynchronized(Uri)
Indicates whether the given uri is currently synchronized
public bool IsSynchronized(Uri uri)
Parameters
uriUrithe uri of the document
Returns
- bool
true, if a synchronization is active, otherwise false
PreparePartnerUpdate(Parser)
Prepares the given document for an update
public void PreparePartnerUpdate(Parser document)
Parameters
documentParserthe document that is about to update
PrepareUpdate(IEnumerable<Uri>)
Prepares the given document for an update
public void PrepareUpdate(IEnumerable<Uri> uris)
Parameters
urisIEnumerable<Uri>the uris of the document that is about to update
PrepareUpdate(Uri)
Prepares the given document for an update
public void PrepareUpdate(Uri uri)
Parameters
uriUrithe uri of the document that is about to update
StartSynchronizing(Parser, IEnumerable<Parser>, bool)
Orchestrates synchronization between a source parser and a collection of other parsers.
public void StartSynchronizing(Parser parser, IEnumerable<Parser> otherParsers, bool isManual = false)
Parameters
parserParserThe parser that triggered the synchronization.
otherParsersIEnumerable<Parser>All other parsers to check for synchronization.
isManualboolA flag indicating if the synchronization was manually triggered.
StopSynchronization(Parser)
Stops all synchronizations of the given parser
public void StopSynchronization(Parser parser)
Parameters
parserParserthe document whose synchronization shall be stopped