Table of Contents

Class SynchronizationService

Namespace
NMF.AnyText
Assembly
NMF.AnyText.Synchronizations.dll

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

lspServer ILspServer

The language server instance for sending workspace edits.

modelServer IModelServer

The model server instance that is used by other syntaxes (GLSP Server).

synchronizations IEnumerable<IModelSynchronization>

the synchronizations supported by this service

Methods

CanSynchronize(Uri)

Indicates whether the given Uri can be synchronized

public bool CanSynchronize(Uri uri)

Parameters

uri Uri

the 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

document Parser

the document that was updated

CompleteUpdate(IEnumerable<Uri>)

Completes the update of the given document

public void CompleteUpdate(IEnumerable<Uri> uris)

Parameters

uris IEnumerable<Uri>

the uris of the document that was updated

CompleteUpdate(Uri)

Completes the update of the given document

public void CompleteUpdate(Uri uri)

Parameters

uri Uri

the uri of the document that was updated

GetSynchronizations(Parser)

Gets inconsistencies for the given document

public IEnumerable<IRunningSynchronization> GetSynchronizations(Parser document)

Parameters

document Parser

the 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

document Uri

the 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

uri Uri

the 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

document Parser

the document that is about to update

PrepareUpdate(IEnumerable<Uri>)

Prepares the given document for an update

public void PrepareUpdate(IEnumerable<Uri> uris)

Parameters

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

uri Uri

the 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

parser Parser

The parser that triggered the synchronization.

otherParsers IEnumerable<Parser>

All other parsers to check for synchronization.

isManual bool

A flag indicating if the synchronization was manually triggered.

StopSynchronization(Parser)

Stops all synchronizations of the given parser

public void StopSynchronization(Parser parser)

Parameters

parser Parser

the document whose synchronization shall be stopped