提交 6448b30f 编写于 作者: M Matt Bierner

Strict null check formatting edit

上级 9867c9af
......@@ -323,6 +323,7 @@
"./vs/editor/contrib/folding/test/syntaxFold.test.ts",
"./vs/editor/contrib/fontZoom/fontZoom.ts",
"./vs/editor/contrib/format/format.ts",
"./vs/editor/contrib/format/formattingEdit.ts",
"./vs/editor/contrib/goToDefinition/clickLinkGesture.ts",
"./vs/editor/contrib/goToDefinition/goToDefinition.ts",
"./vs/editor/contrib/gotoError/gotoError.ts",
......
......@@ -25,13 +25,18 @@ export class FormattingEdit {
}
if (typeof newEol === 'number') {
if (editor.hasModel()) {
editor.getModel().pushEOL(newEol);
}
}
return singleEdits;
}
private static _isFullModelReplaceEdit(editor: ICodeEditor, edit: ISingleEditOperation): boolean {
if (!editor.hasModel()) {
return false;
}
const model = editor.getModel();
const editRange = model.validateRange(edit.range);
const fullModelRange = model.getFullModelRange();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册