提交 4b0e0d67 编写于 作者: J Johannes Rieken

don't bubble no provider error

上级 55de001f
...@@ -15,7 +15,7 @@ import { Range } from 'vs/editor/common/core/range'; ...@@ -15,7 +15,7 @@ import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection'; import { Selection } from 'vs/editor/common/core/selection';
import { Position } from 'vs/editor/common/core/position'; import { Position } from 'vs/editor/common/core/position';
import { trimTrailingWhitespace } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand'; import { trimTrailingWhitespace } from 'vs/editor/common/commands/trimTrailingWhitespaceCommand';
import { getDocumentFormattingEdits } from 'vs/editor/contrib/format/format'; import { getDocumentFormattingEdits, NoProviderError } from 'vs/editor/contrib/format/format';
import { EditOperationsCommand } from 'vs/editor/contrib/format/formatCommand'; import { EditOperationsCommand } from 'vs/editor/contrib/format/formatCommand';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
...@@ -199,7 +199,13 @@ class FormatOnSaveParticipant implements ISaveParticipantParticipant { ...@@ -199,7 +199,13 @@ class FormatOnSaveParticipant implements ISaveParticipantParticipant {
setTimeout(reject, 750); setTimeout(reject, 750);
getDocumentFormattingEdits(model, { tabSize, insertSpaces }) getDocumentFormattingEdits(model, { tabSize, insertSpaces })
.then(edits => this._editorWorkerService.computeMoreMinimalEdits(model.uri, edits)) .then(edits => this._editorWorkerService.computeMoreMinimalEdits(model.uri, edits))
.then(resolve, reject); .then(resolve, err => {
if (!(err instanceof Error) || err.name !== NoProviderError.Name) {
reject(err);
} else {
resolve();
}
});
}).then(edits => { }).then(edits => {
if (edits && versionNow === model.getVersionId()) { if (edits && versionNow === model.getVersionId()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册