Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 528204 - "format on save" throws exception for content type that …
…does not have a formatter
  • Loading branch information
mrennie committed Dec 6, 2017
1 parent c0b4c98 commit 9de0185
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bundles/org.eclipse.orion.client.ui/web/orion/formatter.js
@@ -1,6 +1,6 @@
/*******************************************************************************
* @license
* Copyright (c) 2016 IBM Corporation and others.
* Copyright (c) 2016, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
Expand All @@ -12,7 +12,8 @@
/*eslint-env browser, amd*/

define ([
], function() {
'orion/Deferred'
], function(Deferred) {

function Formatter(serviceRegistry, inputManager, editor) {
this.serviceRegistry = serviceRegistry;
Expand Down Expand Up @@ -53,6 +54,7 @@ define ([
var context = {start: selection.start, end: selection.end};
return service.format(this.editor.getEditorContext(), context);
}
return new Deferred().resolve();
}
};
return {Formatter: Formatter};
Expand Down

0 comments on commit 9de0185

Please sign in to comment.