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

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

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