forCapabilities

fun forCapabilities(capabilities: ServerCapabilities?): DocumentSyncMode

Resolve the DocumentSyncMode from a server's capabilities.

The textDocumentSync capability is, per the LSP spec, either the TextDocumentSyncKind number (legacy form) or a TextDocumentSyncOptions object ({openClose, change}), modelled by the ServerCapabilitiesTextDocumentSync union. When it is absent the spec defaults to no syncing; we follow upstream and still advertise open/close while defaulting change to TextDocumentSyncKind.NONE.