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
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
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