// Target cannot be dirty if not writing into buffer
if(this.textFileService.isDirty(this.resource)){
returnTPromise.wrapError<IReference<ITextEditorModel>>(newError(localize('errorKeybindingsFileDirty',"Unable to write because the keybindings configuration file is dirty. Please save it first and then try again.")));
returnPromise.reject(newError(localize('errorKeybindingsFileDirty',"Unable to write because the keybindings configuration file is dirty. Please save it first and then try again.")));
returnTPromise.wrapError<IReference<ITextEditorModel>>(newError(localize('parseErrors',"Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.")));
returnPromise.reject(newError(localize('parseErrors',"Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again.")));
}
if(parsed.result){
if(!isArray(parsed.result)){
returnTPromise.wrapError<IReference<ITextEditorModel>>(newError(localize('errorInvalidConfiguration',"Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again.")));
returnPromise.reject(newError(localize('errorInvalidConfiguration',"Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again.")));