define(function(require,exports,module){const DocumentManager=require("document/DocumentManager"),EditorManager=require("editor/EditorManager"),CHANGE_DEBOUNCE_MS=400,SYNC_FULL=1,SYNC_INCREMENTAL=2;function _syncKind(client){const tds=client&&client.capabilities&&client.capabilities.textDocumentSync;if(null==tds)return SYNC_FULL;const kind="object"==typeof tds?tds.change:tds;return kind===SYNC_INCREMENTAL?SYNC_INCREMENTAL:SYNC_FULL}function _toIncrementalChanges(changeList){if(!changeList||!changeList.length)return null;const changes=[];for(let i=0;ilineEnd?-1:i+pos.character}function _applyIncremental(text,changes){for(let i=0;i